-
Notifications
You must be signed in to change notification settings - Fork 70
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Corrupted audio after ByteBuffer change #82
Comments
Note to self: try resetting buffer position with mic_stream/android/src/main/java/com/code/aaron/micstream/MicStreamPlugin.java Lines 129 to 130 in a3c1ddb
|
Thank you for your investigations. I will give it a look ASAP. |
I gave it another shot. Using
I tried swapping the bytes of the resulting array without success so far. I am not sure what the layout of this direct buffer is. Are you able to playback the audio when it is recorded that way? |
I cannot, currently, confirm that the audio is actually correct. I need to fix my test setup but am really short on time currently. I do get a waveform with general correspondence to what the mic is recording. As far as I understood, the ByteBuffer should be the way to go, and I'm getting lost at what the appropriate implementation really is. |
One way to check for endianness issues is printing some (e.g., first 20) samples straight after recording and then again from the received stream. I'm pretty sure I verified the correctness here at least (I'm still looking for a simple way to automate this testing). Another potential pitfall may be incorrect application of AudioRecord parameters. I'll need to check that, too. |
Hi @anarchuser and thank you for your time. I didn't have much time to do more research on this yet, for now I am using a fork which reverts a3c1ddb.
This is something I will do for sure. |
yeah no worries. I'm just maintaining this as a side hobby, I'm happy as long as people find some use in it |
The commit a3c1ddb results in corrupted audio recording on my Android device with PCM-16. From playback, I can recognize the volume but the audio seems fuzzed as if buffer writes started at random places.
I will continue investigating on this issue and document why this change cause issue in the next few days. More context is given in #81 where I misidentified the issue to be with endianness.
The text was updated successfully, but these errors were encountered: