Closed graychan closed 10 years ago
This baffles me greatly. At present, I do a second pass on the valid parameters obtained from previous probe and remove the failed ones. I got an impression that whether a parameter (e.g., source, format, channel, sample rate, or buffersize) is valid also depends on the parameter tried previously. I suspect that this is a result of some bugs in the AudioRecord object itself (most likely, the JNI implementation in Android or even the device driver).
The app uses a trial-and-error approach to discover valid parameters to initialize AudioRecord. On some platforms, the parameters obtained from the first scan becomes strangely invalid in a later use, such as on a device below,
Perhaps, this could be solved by scanning a second time on the obtained parameters. The second scan would prune the parameters invalid in the second scan.