Skip to content

Can miniaudio obtain the OS-specified channel configuration? #817

Answered by mackron
bjorn-nesby asked this question in Q&A
Discussion options

You must be logged in to vote

In your device config, if you leave the channel count set to the 0 and the channel map empty, it'll tell the miniaudio to use the native channel configuration as reported by the backend. To access it, you query it from the ma_device object after initialization.

device.playback.channels;   // <-- The channel count as reported by the backend.
device.playback.channelMap; // <-- The channel map as reported by the backend.

You can use #define MA_DEBUG_OUTPUT to output to stdout the channel count and channel map so you can easily review what it's given back to you in case you wanted to verify the results.

Replies: 2 comments 4 replies

Comment options

You must be logged in to vote
0 replies
Answer selected by bjorn-nesby
Comment options

You must be logged in to vote
4 replies
@mackron
Comment options

@bjorn-nesby
Comment options

@mackron
Comment options

@bjorn-nesby
Comment options

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