Music and Sounds, best way?

This forum is currently in read-only mode.
From the Asset Store
Best car suspension with spring effect and very cool terrain generation.
  • What is the best way to play music and sounds? We've got three different mp3 files that should loop during different parts of the game. These music files should never play at the same time. So they stop and start at various points. We've also got a bunch of wav files that sometimes play at the same time as music and sometimes not.

    What is the best way to handle this? Currently we're using play from resource, but we have a few crash causing bugs and there are problems with looping.

    If I want to play a wav file when a door opens, no looping, and at the same time as music is playing without interrupting or disturbing the music. What action should I be choosing? Should I have the music loaded in as resource or just file?

    If I want music to play across many layouts and loop, what is the best way to do this? I just need to turn it off when I start new music or die. What action should I be choosing? Should I have this loaded as a resource or just a file in the same place as the cap/exe?

    It seems that I can't have music under music or sounds and have to have it under files to get it to work properly, am I missing something?

    Currently using the latest unstable build.

  • Try Construct 3

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

    Try Now Construct 3 users don't see these ads
  • Hmm as far as I know if you use play music it shouldn't be interrupted by wav files playing. And I myself always use play from file so the files are externally saved.

    And if you want same music to play trough layouts there was somekind of option for that in the xaudio preferences or was it just to make xaudio global.

  • There's really no big difference in using as resource, and externally. As resource just makes the exe bigger. To deal with sounds and music interfering with each other I would make Xaudio global as Sagal suggested, and assign a single channel to music. That way all you have to do is use the Play command under Channel for music, and then you can use Autoplay resource, under Resources for your sounds.

    If you reserve your music channel at the beginning of the layout, Autoplay resource will use the next available channel to play your sounds, and they will play over music.


    I just realized there is no set way to attach a music file to a channel, so you will have to reserve it, then play the file.... Oh Ashley~ I have another suggestion.

  • *blinks* Unless something changed, theres a seperate channel already for music and it can play from resource and file as well. I think thats also the only one that will play mp3 or midi from file. The last time I checked theres no condition to check if the file is still playing though, which I want for mixing files. Trying to find a python module to use, but I also want it to run choices are limited.

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