Skip to content

Running Simple Duplex example on Android #461

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

You must be logged in to vote

So there's a couple of things wrong here. The ma_device object (and all objects in miniaudio for that matter) are transparent structs and not references. You're declaring the ma_device object on the stack, but then as soon as ma_device_start() returns, you're returning from Java_com_testlib_example_MainActivity_test() which will be destroying your ma_device object. The ma_device_config struct is not used after ma_device_init(), so it's fine to leave that on the stack. I'm suspecting this might be the cause of your issues with this one.

The device ID thing is incorrect. You would probably want to do something like this:

deviceConfig.capture.pDeviceID.aaudio = inputDeviceID;

Replies: 4 comments 2 replies

Comment options

You must be logged in to vote
0 replies
Comment options

You must be logged in to vote
0 replies
Answer selected by WassimErriha
Comment options

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

Comment options

You must be logged in to vote
1 reply
@mackron
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