如何在笔记本电脑中输出录制的音频文件?
mFilename = Environment.getExternalStorageDirectory().getAbsolutePath();
mFilename += "/audiorecorder.3gp";
mRecorder = new MediaRecorder();
mRecorder.setAudioSource(MediaRecorder.AudioSource.MIC);
mRecorder.setOutputFormat(MediaRecorder.OutputFormat.THREE_GPP);
mRecorder.setAudioEncoder(MediaRecorder.AudioEncoder.AMR_NB);
mRecorder.setOutputFile(mFilename);
mRecorder.setOnErrorListener(errorListenerForRecorder);
以上是我对 MediaRecord 的设置。我可以完美地将麦克风的声音录制到 .3pg 音频文件中。我在Android AVD上模拟它,只能在SD卡中找到输出文件。但我希望我也可以在我的电脑上输出我的音频文件。同样奇怪的是,当我运行AVD时,我在计算机中找不到输出文件。那么当我运行 AVD 时音频文件存储在哪里?谁能告诉我如何设置输出路径?谢谢!
mFilename = Environment.getExternalStorageDirectory().getAbsolutePath();
mFilename += "/audiorecorder.3gp";
mRecorder = new MediaRecorder();
mRecorder.setAudioSource(MediaRecorder.AudioSource.MIC);
mRecorder.setOutputFormat(MediaRecorder.OutputFormat.THREE_GPP);
mRecorder.setAudioEncoder(MediaRecorder.AudioEncoder.AMR_NB);
mRecorder.setOutputFile(mFilename);
mRecorder.setOnErrorListener(errorListenerForRecorder);
Above is my settings for MediaRecord. I can record sound from microphone into .3pg audio file perfectly. I simulated it on Android AVD and I can only find the output file in SD card. But I hope I can also output my audio file on my computer. It is also strange that I can not find the output file in my computer when I was running AVD. So where the audio file is stored when I was running AVD? Could anyone tell me how to set the output path? THX!
如果你对这篇内容有疑问,欢迎到本站社区发帖提问 参与讨论,获取更多帮助,或者扫码二维码加入 Web 技术交流群。
绑定邮箱获取回复消息
由于您还没有绑定你的真实邮箱,如果其他用户或者作者回复了您的评论,将不能在第一时间通知您!
发布评论
评论(1)
这是您的解决方案。您无法将硬盘的任何驱动器位置引用到 android。 Android 将仅考虑与外部内存或手机内部内存关联的路径。
至于你的问题当你使用 AVD 时输出将存储在哪里也很简单。您可以在文件资源管理器中查看 SD 卡详细信息。在eclipse中获取文件资源管理器窗口->显示视图->文件资源管理器
Well here is your solution. You can't refer to any drive location of your harddisk to android. Android will consider only the path associated to either external memory or internal phone memory.
And as for your question where the output will be stored when you use an AVD is also simple. You can view the SD card details in File Explorer. To get the file explorer in eclipse window->Show view->File Explorer