HSP !!!sound recording *音声を録音・再生する {{outline}} ---- !!Picture Description Task {{ref_text record11-J.hsp}} !ソースコードファイル {{ref record11-J.hsp}} **mciの音声ファイルの設定の箇所、1行に書かないと適切に処理されない点を修正 2020-06-29 !実行ファイル(サンプルの絵入り){{ref record11-J.exe}} ---- 以下のスクリプト中、誤植があります。(2020-06-14) 誤:samplepersec 正:sample<>persec {{pre ; sound recording ; copyleft 2017-06-24 sugiura@nagoya-u.jp ; 2019-09-11 タイムスタンプつけて音声ファイルの保存 ; 再生ファイルをダイアログウィンドウで選択 ; gosub *set pos 300, 200 button gosub "Record", *record mes "" mes "" button gosub "Stop Rec", *teisi mes "" button gosub "Play", *play mes "" mes "" button goto "End", *owari stop *owari mci "close sou" cls pos 300, 200 mes "Bye" wait 100 end ; sub -------------------------- *set mci "set sam channels 2" mci "set sam samplepersec 44100" mci "set sam bitspersample 16" return *record mci "open new alias sam type waveaudio" mci "record sam" return *play dialog "wav", 16, "WAVファイルを選択" dialog "このファイルを再生します:"+refstr,0,"確認" mci "open \""+refstr+"\" alias sou type waveaudio" mci "play sou" return *teisi nen = gettime(0) gatu = gettime(1) niti = gettime(3) ji = gettime(4) fun = gettime(5) taimu = "sound"+nen+"-"+gatu+"-"+niti+"-"+ji+"-"+fun+".wav" mci "stop sam" mci "save sam \""+taimu+"\" mci "close sam" return }} {{ref record05-CLEAN.hsp}} {{ref record05.exe}}