Pregunta

I have some audio data (raw uncompressed audio waveform, no file format) in memory and want to replay it. Android-internal Mediaplayer seems to support only replaying of files stored somewhere on disk, I could not find a setDataSource()-method that would accept an array of data instead of a path/URL.

So how can I replay waveforms that are not stored on disk?

Thanks!

¿Fue útil?

Solución

Use an AudioTrack. See e.g. this page for an example of how to set up an use an AudioTrack (jump to the "Playing the sample with an AudioTrack" section, and just ignore the JNI-stuff).

Licenciado bajo: CC-BY-SA con atribución
No afiliado a StackOverflow
scroll top