3

I am having a big issue with recent updates to the android OS (specifically 3.2 on the Xoom) where using MediaPlayer.setLooping(true); will no longer loop a wav or ogg file with a gap in between loops.

I have an application that requires a seamless loop and it has worked fine using the OpenCore framework, but I can't figure out how to get this to work on the new StageFright framework. Can anyone give me a pointer on how to play a gapless audio loop using StageFright on newer versions of the Android OS?

Ganesh
  • 5,880
  • 2
  • 36
  • 54
csyperski
  • 992
  • 3
  • 15
  • 33

1 Answers1

0

If you are using MediaPlayer class for playback then you have no choice of using the media framework (Opencore Vs Stagefright). However if you have access to Android Source, then you can modify Android multimedia stack so that it uses Opencore framework for ogg / wav playback.

Now, if you have ogg/wav parser and vorbis decoder then you can make use of AudioTrack for playing audio out. The catch is that you have to take care of parsing and decoding; since AudioTrack accepts only pcm samples.

Shash

Ganesh
  • 5,880
  • 2
  • 36
  • 54
Shash316
  • 2,218
  • 18
  • 19