Creating seamless audio loop for Windows Phone 7

From XNAWiki
Jump to: navigation, search


From a post by Shawn Hargreaves on the App Hub forums:

MediaPlayer does not provide true seamless zero-gap looping (in fact, compressed formats like WMA and MP3 are not in general capable of that as even if you start with a looping uncompressed WAV, the encoder will not typically preserve sample frame accuracy across the loop point).

Options:

  • Use SoundEffect, which does provide seamless looping (but not compressed audio streaming)
  • Use MediaPlayer, and make your song longer so the loop occurs less often (this is what most games typically end up doing)
  • Use DynamicSoundEffectInstance, and write your own streaming system (lots of work, but infinitely flexible as you can do whatever you like this way)

We have no plans to port XACT to Windows Phone. Going forward, all our future investment in audio technology will be in the SoundEffect, Song, and MediaPlayer APIs, as opposed to XACT.