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.