Gap in loop

This forum is currently in read-only mode.
From the Asset Store
For Adventure, Action, Heroes, Sci-fi and Action-RPG games.
  • Hi! Is there an bug in the xAudio? Or is there something I dont get.

    Rendered out this loop from FLstudio, and I cant find any gap in the mp3file.

    Is there any way to improve this?

    http://shadow-embryo.com/cap/musicgap.zip

  • With "play music", the xAudio2 plugin pauses to reload the file -- the so-called "loop music" is more of a "start over as soon as the computer feels that now would be a nice time for it".

    You can "load resource to channel (+loop)" and "play channel" for gapless looping, but that won't work with an mp3 file.

    In any case, mp3 is a bad format for gapless looping: because it was originally designed for video soundtracks, it only supports lengths of multiples of ... 1/24 second or some such video frame rate. If you encode a sound of any other length to mp3, the end is padded with silence to the next frame boundary; so even with perfectly gapless looping, most mp3 files you can produce will have a gap encoded right into the sound data.

    In summary: sorry, I can't solve your problem unless you can make a _really short_ loop, save it as .wav and use it as a "sound" rather than "music".

  • Awww

    But thanks for the clear explaination

  • or you could download audacity (free) and edit the mp3 file to remove the silence at the end AND the beginning of the track ...

  • Directshow (the API behind Play Music) doesn't seem to support looping directly, so I've implemented looping music as checking on a timer if the music has stopped, and if it has, restarting it. Obviously this will never be seamless. If you want seamless, go for OGG, or an xWMA encoded WAV, and play it looping on a reserved channel.

  • Thanks for the info

    Ogg works much better.

    Too bad you have to instal codecs on other machines to make it work.

    But this is not the case with xWMA?

  • Try Construct 3

    Develop games in your browser. Powerful, performant & highly capable.

    Try Now Construct 3 users don't see these ads
  • WMA is the Windows sound format, so it should play on any Windows machine without problems.

    I should really check out OGG, I have no knowledge of how it works. Does it require caching? How is the file size and performance compared to MP3? Can you just drop a .dll for the OGG codec or something into the application directory or would you have to use an installer?

    The only thing I really know about OGG is you don't have to pay to license it like you do MP3 if you're selling your game.

  • I think you're both getting confused, read the docs on XAudio2 where it's all spelled out.

    You don't need any special codecs to load and play OGG files on a channel, it's built in. (You would need the Windows Media Player codec if you used the 'Play Music' action, because 'Play Music' plays via Windows Media Player). OGG is probably slightly superior in audio quality and compression compared to MP3, but only because MP3 is actually really crap but the whole world insists on keeping on using it.

    xWMA is a special, and rather confusingly named, format for .WAV files. It's based off a stripped down version of the WMA codec. So xWMA and WMA are different things. You don't need a codec to load any of the formats to a channel, xWMA and ADPCM are natively supported by XAudio2. Sadly, I don't know of any popular software which can create xWMA format WAV files.

  • Ah okay. I guess I was confused

  • Ogg is perfect for Construct, its open source, and smaller than mp3.

    Dbpoweramp is a pretty good converter that does a ton of codecs.

    http://www.dbpoweramp.com/

  • ogg is a good format, way better than mp3 imo

    its a small file, like mp3, but its better at alot of stuff, like ppl said here.

    i use it for game music, mp3 seems like the jpeg of sound formats...

    (some of you may not understand this)

Jump to:
Active Users
There are 1 visitors browsing this topic (0 users and 1 guests)