5
我正在尝试使用小录音从服务中找到声压级,但Android不会让我访问硬件。我收到以下错误,在logcat中:无法访问AudioRecorder
错误来自于下面的代码:
AudioRecord recordInstance = null;
// We're important...
android.os.Process
.setThreadPriority(android.os.Process.THREAD_PRIORITY_URGENT_AUDIO);
short bufferSize = 4096;// 2048;
recordInstance = new AudioRecord(MediaRecorder.AudioSource.MIC, this //line 167
.getFrequency(), this.getChannelConfiguration(), this
.getAudioEncoding(), bufferSize); //object not created
tempBuffer = new short[bufferSize];
recordInstance.startRecording();
什么情况是,recordInstance永远不会正确创建,所以当它到达结束调用recordInstance.startRecording(),recordInstance仍然为null。 Android在定义时拒绝我的程序请求。有人知道那些errno的含义吗?我无法在网上找到列表。
感谢
它是recordInstance.release()。谢谢 – FuegoFingers 2010-12-23 08:06:13