سؤال

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!

هل كانت مفيدة؟

المحلول

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).

مرخصة بموجب: CC-BY-SA مع الإسناد
لا تنتمي إلى StackOverflow
scroll top