Pergunta

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?

Foi útil?

Solução

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.

Licenciado em: CC-BY-SA com atribuição
Não afiliado a StackOverflow
scroll top