2

I'm trying to stream an audio file from an uri using opensl. I want to play it immediately, but also have access to the streamed data after the player has finished playing the file.

I know the data is somewhere in memory, because i'm able to use seek during the streamed audio's playback. Also when the player has finished playing the streamed audio file, i stop the player, which sets the players position back to "0", where i can start playing the audio again.

I need to access this data, but where is it? can i get a pointer to it somehow?

iedoc
  • 2,266
  • 3
  • 30
  • 53

1 Answers1

0

If you are streaming the content over the network, I'm not sure if what you're trying to do is possible.

However, as of Android API 14, it is possible to use an audio player device to decode content to a buffer queue data source in PCM format.

For more information on this, check out the NDK documentation /docs/opensles/index.html


Decode audio to PCM Note: this feature is available at API level 14 and higher. A standard audio player plays back to an audio device, and the data sink is specified as an output mix. However, as an Android extension, an audio player instead acts as a decoder if the data source is specified as a URI or Android file descriptor data locator with MIME data format, and the data sink is an Android simple buffer queue data locator with PCM data format.

rmigneco
  • 595
  • 4
  • 16