So I need to generate some tones with ToneGenerator and write them to .wav file. Is is possible using ToneGenerator or AudioTrack?
Are there any ways to access audio frames directly in AudioTrack, record to file with AudioOutput or do anything else?
ToneGenerator specifies the output stream type, to which the generated audio data is written. There is no possibility to directly access the generated audio data.
Of course, you can record the played tones, e.g. via internal microphone. But that's probably not what you wanted.
You could also record them digitally on some devices by using AudioRecord when using the appropriate settings for audioSource, sampleRateInHz, channelConfig, audioFormat and streamType.
Concerning AudioTrack, since you have to use write() methods, you necessarily have direct access to the audio data.
If you love us? You can donate to us via Paypal or buy me a coffee so we can maintain and grow! Thank you!
Donate Us With