0

I'd like to use the Visualizer class to capture system wide audio in a specific format. (44.1khz, 16 bits, Stereo)

I can't figure out how to request a certain format be returned to me. I can get a hack to work in gingerbread and earlier to return audio formatted in 16 bits, but still no stereo. Any ideas StackOverflow?

William Morrison
  • 10,953
  • 2
  • 31
  • 48

1 Answers1

2

As the Visualizer documentation says:

It is not an audio recording interface and only returns partial and low quality audio content.

and

Two types of representation of audio content can be captured:
  • Waveform data: consecutive 8-bit (unsigned) mono samples by using the getWaveForm(byte[]) method
  • Frequency data: 8-bit magnitude FFT by using the getFft(byte[]) method

Without modifying Android itself so that you can get hold of e.g. the Visualizer's input buffer I don't see how you could get data with a higher sampling rate / higher number of channels.

Michael
  • 57,169
  • 9
  • 80
  • 125
  • Thanks for the reply Michael. You know if there's a way to do this using NDK? And just an FYI to you or anyone reading this here, MediaRecorder.snoop returns PCM format: 16 bit, mono, 44.1khz audio. Visualizer returns: 8 bit, mono, 44.1khz samples. – William Morrison Jan 17 '13 at 13:41