I am trying to add custom voice commands to a glass application using AudioRecorder to capture microphone input and speech recognition. Everything works fine, except for the “stop recording” command, where I need to capture the current microphone input while the MediaRecorder object is recording video.
In particular, I am not getting any errors, but
int bufferResult = recorder.read(readBuffer, 0, readBuffer.length);
reads 0 bytes, and bufferResult is 0. readBuffer.length - 64000 bytes (audio recording in 4 seconds)
I suspect there is some locking of core resources that prevents AudioRecorder from executing .reads (), while MediaRecorder also writes. Has anyone come across this question before? More generally, is there a way to get microphone sound during MediaRecorder recording, either through AudioRecorder, or else?
source
share