[英]Android - Audio recorder FileNotFound
我正在嘗試錄制音頻
this.recorder = new android.media.MediaRecorder();
this.recorder.setAudioSource(android.media.MediaRecorder.AudioSource.MIC); this.recorder.setOutputFormat(android.media.MediaRecorder.OutputFormat.DEFAULT);
this.recorder.setAudioEncoder(android.media.MediaRecorder.AudioEncoder.DEFAULT);
this.recorder.setOutputFile("pruebaAudioRecorder.mp4");
**this.recorder.prepare();**
this.recorder.start();
但是當我調用prepare方法時,拋出FileNotFound異常。
new File(...)
多謝。
這是一個很好的解決方案,請記住添加WRITE_EXTERNAL_STORAGE權限
http://www.benmccann.com/blog/android-audio-recording-tutorial/
聲明:本站的技術帖子網頁,遵循CC BY-SA 4.0協議,如果您需要轉載,請注明本站網址或者原文地址。任何問題請咨詢:yoyou2525@163.com.