Recording PCM audio data to an audio device from native code

Can I write PCM samples to an Android audio device directly from my own code? I was able to play PCM samples by sending data to a socket and playing with AudioTrack. Is it possible to avoid all this path to an audio device by contacting your own code directly? Thank!

+3
source share
2 answers

Yes, you can try using your audio devices directly. Access works through the nodes of the Linux virtual device hosted in / dev /.

On my HTC Desire it will be

/dev/msm_pcm_out

, . , node . , , .

, "cat"

( )

su

cat /dev/urandom > /dev/msm_pcm_out

. cat C, .

: , , , .

, Android - , NDK.

+4

, , AudioTrack JNI... .

0

Source: https://habr.com/ru/post/1795574/


All Articles