はじめました。SmallBasic塾-分からないことはメールで。学習状況はノートで。結果はプログラムで。そして、チャットでつながる。待ち合った学習方法で、間違ったプログラミングスタイルにならないために

Top > Small Basic > Sound(サウンド)

小学生・中学生からはじめられる
Small Basic
テキストベースの初心者向けプログラミング言語

Sound(サウンド)

Sound オブジェクトは音の再生機能を提供(サンプルの音がライブラリに提供)

 

オペレーション(Operations)
メソッド 構文 内容
PlayClick Sound.PlayClick() クリック音を再生
Returns Nothing
PlayClickAndWait Sound.PlayClickAndWait() クリック音を再生して終了を待つ
Returns Nothing
PlayChime Sound.PlayChime() チャイム音を再生
Returns Nothing
PlayChimeAndWait Sound.PlayChimeAndWait() チャイム音を再生して終了を待つ
Returns Nothing
PlayChimes Sound.PlayChimes() チャイム音を再生
Returns Nothing
PlayChimesAndWait Sound.PlayChimesAndWait() チャイム音を再生して終了を待つ
Returns Nothing
PlayBellRing Sound.PlayBellRing() ベル音を再生
Returns Nothing
PlayBellRingAndWait Sound.PlayBellRingAndWait() ベル音を再生して終了を待つ
Returns Nothing
PlayMusic Sound.PlayMusic(notes) 音符を再生(notes:再生される音符の集合、書式はQBasicでサポートしている ミュージック メイクアップ 言語のサブセット)
Returns Nothing
Play Sound.Play(filePath) 音楽ファイルを再生(MP3、WAV、またはWMAファイルを再生できます。それ以外のファイル形式は、コンピューターにインストールされているオーディオ コーデックによって、再生できない場合があります。 すでに音楽ファイルが一時停止されている場合は、一時停止されたところから再生を再開します)
filePath 音楽ファイルへのパス(ローカルファイル (例: c:\music\track1.mp3)やネットワーク上のファイル (例: http://contoso.com/track01.wma) を指定)
Returns Nothing
PlayAndWait Sound.PlayAndWait(filePath) 音楽ファイルを再生して終了するまで待つ(詳細は、Playを参照)
filePath 音楽ファイルへのパス(Playを参照)
Returns Nothing
Pause Sound.Pause(filePath) 音楽ファイルの再生を一時停
filePath 音楽ファイルへのパス(Playを参照)
Returns Nothing
Stop Sound.Stop(filePath) 音楽ファイルの再生を停止
filePath 音楽ファイルへのパス(Playを参照)
Returns Nothing
     

 

Sound.Play("C:\Users\Public\Music\Sample Music\Sleep Away.mp3")

no = 1
GraphicsWindow.MouseUp = OnClick

Sub OnClick
If no = 1 Then
Sound.PlayClick()
endif

If no = 2 Then
Sound.PlayChime()
endif

If no = 3 Then
Sound.PlayChimes()
endif

If no = 4 Then
Sound.PlayBellRing()
endif

If no >= 4 Then
no = 0
EndIf

no = no + 1
EndSub

▲ページトップに戻る

【本を読んでもよくらからない】 … 個別指導でわかりやすくお教えします
inserted by FC2 system