Skip to content

Audio conversion issues? #394

Answered by mackron
bonezone2001 asked this question in Q&A
Discussion options

You must be logged in to vote

Can you post the output with #define MA_DEBUG_OUTPUT? One bug you certainly have is that you've specified a channel count of 0 in the device config which tells miniaudio to use the device's native channel count which could be anything, but in the data callback you've hard coded it to 2. Try changing the channel count in the device config to 2.

A second bug is that you're opening the file in text mode and not byte mode. Open the file with "wb" instead of "w".

A piece of general advice - get miniaudio to do the data conversion for you internally. If you always want to use ma_format_s16 for your final output, just set the format in the device config: deviceConfig.capture.format = ma_format_s16

Replies: 1 comment 1 reply

Comment options

You must be logged in to vote
1 reply
@bonezone2001
Comment options

Answer selected by bonezone2001
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Category
Q&A
Labels
None yet
2 participants