문제

I am streaming audio data (music) to AudioTrack with track.write(..)

While doing this and making user listen to audio through device's speakers(etc..) can I also have that audio recorded by using Android's own audio system? (Android 4.0+) Is it capable of doing this?

도움이 되었습니까?

해결책

If you're using AudioTrack.write(), thehn you must be writing from a byte stream. If you have the bytes, you can save them anywhere you'd like. Just write them to a file as well, and you'll have it recorded.

Now, it'll be in raw PCM format, mind you. If you want to convert it to WAV, MP3, OGG, etc, you'll have to do that yourself. There are different ways of doing that, but a search should turn something up.

라이센스 : CC-BY-SA ~와 함께 속성
제휴하지 않습니다 StackOverflow
scroll top