Skip to content

Access Sound Amplitude of Microphone In Real Time #586

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

You must be logged in to vote

The simple_capture example is what you want. The playback and duplex examples won't help you, nor will ma_decoder. The pUserData member is just a way for you to associate an arbitrary pointer from your program with the device. That way you can access said pointer wherever you have access to a ma_device object, such as in the data callback. In the capture example it just happens to be that I designed it to use the pUserData pointer with an ma_encoder object. You can assign it to whatever you want, or nothing at all - it just depends on how you want to design your program. For example, I could have instead declared the ma_encoder object globally in which case I wouldn't need to use the pUse…

Replies: 1 comment 3 replies

Comment options

You must be logged in to vote
3 replies
@hiraz01
Comment options

@mackron
Comment options

@hiraz01
Comment options

Answer selected by hiraz01
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