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

編程如何啟動錄音

發布時間: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添加許可權
閱讀全文

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

熱點內容
網路中常用的傳輸介質 瀏覽:518
文件如何使用 瀏覽:322
同步推密碼找回 瀏覽:865
樂高怎麼才能用電腦編程序 瀏覽:65
本機qq文件為什麼找不到 瀏覽:264
安卓qq空間免升級 瀏覽:490
linux如何刪除模塊驅動程序 瀏覽:193
at89c51c程序 瀏覽:329
怎麼創建word大綱文件 瀏覽:622
裊裊朗誦文件生成器 瀏覽:626
1054件文件是多少gb 瀏覽:371
高州禁養區內能養豬多少頭的文件 瀏覽:927
win8ico文件 瀏覽:949
仁和數控怎麼編程 瀏覽:381
項目文件夾圖片 瀏覽:87
怎麼在東芝電視安裝app 瀏覽:954
plc顯示數字怎麼編程 瀏覽:439
如何辨別假網站 瀏覽:711
寬頻用別人的賬號密碼 瀏覽:556
新app如何佔有市場 瀏覽:42

友情鏈接