導航:首頁 > 編程知識 > 編程如何啟動錄音

編程如何啟動錄音

發布時間:2023-04-12 13:01:42

Ⅰ 智慧屋幼兒編程積木怎麼錄音

1、首先打開智慧屋幼兒編程積木設置。
2、然後點擊錄放按鈕,選擇確定。
3、最後將電子積木安裝到做好的積木模型上就可以實現錄音指令。

Ⅱ 用mfc做了一個錄音程序,編程之後怎麼使用這個程序來錄音

可以使用對話框程序,用以按鈕,點擊按鈕調用錄音相關函數並保存錄音到文件,在用旅沒一點按鈕作為語音識別開始按鈕,點拆罩納擊按鈕,調用相關函數對悶伍前面錄音進行識別,然後顯示結果。

Ⅲ android編程 如何調用系統錄音機進行錄音並存放在指定文件夾

如果學過就知道這是一個相對簡單的問題,

  1. 首先進行布局,就是設置寫按鈕,文字之類的。

java">

2.寫個activity,調用系統錄音程序

er{

privateButtonbtnStart;
privateButtonbtnStop;
privateButtonbtnPlay;

;
privateFilerecAudioFile;
privateMusicPlayermPlayer;

@Override
publicvoidonCreate(BundlesavedInstanceState){
super.onCreate(savedInstanceState);
setContentView(R.layout.main);

setupViews();
}

privatevoidsetupViews(){
btnStart=(Button)findViewById(R.id.start);
btnStop=(Button)findViewById(R.id.stop);
btnPlay=(Button)findViewById(R.id.play);

btnStart.setOnClickListener(this);
btnStop.setOnClickListener(this);
btnPlay.setOnClickListener(this);

recAudioFile=newFile("/mnt/sdcard","new.amr");
}

@Override
publicvoidonClick(Viewv){
switch(v.getId()){
caseR.id.start:
startRecorder();
break;
caseR.id.stop:
stopRecorder();
break;
caseR.id.play:
mPlayer=newMusicPlayer(SoundRecorderActivity.this);
mPlayer.playMicFile(recAudioFile);
break;
default:
break;
}
}

privatevoidstartRecorder(){
mMediaRecorder=newMediaRecorder();
if(recAudioFile.exists()){
recAudioFile.delete();
}

mMediaRecorder.setAudioSource(MediaRecorder.AudioSource.MIC);
mMediaRecorder.setOutputFormat(MediaRecorder.OutputFormat.DEFAULT);
mMediaRecorder.setAudioEncoder(MediaRecorder.AudioEncoder.DEFAULT);
mMediaRecorder.setOutputFile(recAudioFile.getAbsolutePath());
try{
mMediaRecorder.prepare();
}catch(IllegalStateExceptione){
e.printStackTrace();
}catch(IOExceptione){
e.printStackTrace();
}

mMediaRecorder.start();
}

privatevoidstopRecorder(){
if(recAudioFile!=null){
mMediaRecorder.stop();
mMediaRecorder.release();
}
}
}</span>
如何保存到特定的目錄,只需要得到recAudioFile=newFile("/mnt/sdcard","new.amr");就可以了。


3.設置播放類,也是調用播放方法。MediaPlayer


4添加許可權
閱讀全文

與編程如何啟動錄音相關的資料

熱點內容
win10文件比率是什麼 瀏覽:652
msdb資料庫置疑 瀏覽:210
移動花卡免流app為什麼要10元 瀏覽:147
xamppphp配置文件 瀏覽:268
刪除ghost文件 瀏覽:642
蘋果7可置換地方 瀏覽:763
win10騰訊文件夾在哪裡 瀏覽:262
在網站前面加什麼可以看會員視頻 瀏覽:908
哪個讀書app支持格式最全 瀏覽:322
魅族mx3提示網路可能會受到監控 瀏覽:308
如何判斷復制文件是否完整 瀏覽:803
qq接收的語音文件在 瀏覽:408
手機qq禁止查看動態 瀏覽:923
如何用編程求解二重積分 瀏覽:366
在桌面上搜索不到文件夾 瀏覽:723
中外文專利網站有哪些 瀏覽:682
尖刀車端面槽怎麼編程 瀏覽:70
電腦重裝會把所有文件都刪掉嗎 瀏覽:982
java匿名內部類構造函數 瀏覽:573
如何ftp文件到linux 瀏覽:894

友情鏈接