Jump to content


Photo

Music looping problem


  • Please log in to reply
6 replies to this topic

#1 Gral92

Gral92

    GMC Member

  • GMC Member
  • 34 posts

Posted 22 May 2012 - 09:10 PM

Hi there once again.

I've a problem with music in my game. I have a file for a certain level's background theme. When I play it in a media player and make it loop, it does so very smoothly. But when it plays in the game, at the end of the file, there's a short, but very noticeable pause before it starts playing again.

The file is mp3 format.

What to do to make it loop smoothly?
  • 0

#2 Nocturne

Nocturne

    Nocturne Games

  • Administrators
  • 16793 posts
  • Version:GM:Studio

Posted 22 May 2012 - 09:11 PM

Unfortunately there is nothing much you can do. The problem is inherent in the way that mp3 files work.
  • 0

#3 ChefDavid22

ChefDavid22

    No, YOU shut up!

  • GMC Member
  • 1193 posts
  • Version:GM:Studio

Posted 22 May 2012 - 09:27 PM

The one way around this is to add a fade in fade out in your mp3. Download the free program called WavePad Sound Editor and set GM to use the program. It has a nice fade feature. While this isnt a perfect fix it does make it appear you did that on purpose.
  • 0

#4 Gral92

Gral92

    GMC Member

  • GMC Member
  • 34 posts

Posted 23 May 2012 - 03:07 PM

Unfortunately there is nothing much you can do. The problem is inherent in the way that mp3 files work.


Converting the file to something else shouldn't be much of a problem, but will that make it loop smoothly?

If so, any recommended file formats?

Edited by Gral92, 23 May 2012 - 03:07 PM.

  • 0

#5 Daddio

Daddio

    GMC Member

  • GMC Member
  • 266 posts

Posted 23 May 2012 - 04:10 PM

I don't know if this helps, but I've had sound issues as well, regardless of format. To my knowledge, GM doesn't really like MP3 files, but maybe they've fixed that recently?

Collaborating on a game, my dev partner used supersound.dll and then had it run .OGG files, which Game Maker can't run natively. Those files work really well in our game and he has them looping and fading into one another at different points with a bit of coding and the .dll file.
  • 0

#6 dannyjenn

dannyjenn

    GMC Member

  • GMC Member
  • 2061 posts
  • Version:Mac

Posted 23 May 2012 - 04:16 PM

MP3s have a problem in Game Maker where a slight pause is added at the very beginning of the music each time it plays, so it cannot be looped smoothly. If you don't have a midi file then your only other option is to use wav, which would increase the file size and loading time but it should loop smoothly.
That, or do like Daddio said and use a dll to use ogg files.

Edited by dannyjenn, 23 May 2012 - 04:16 PM.

  • 0

#7 MH_Engineer

MH_Engineer

    GMC Member

  • New Member
  • 17 posts
  • Version:GM:Studio

Posted 18 May 2013 - 03:51 PM

Yes I find wav files loop rather well.  If you have a program that can make ogg files, they too should loop well


  • 0




0 user(s) are reading this topic

0 members, 0 guests, 0 anonymous users