Music and Sounds, best way?

For questions about using Classic.

Post » Fri May 28, 2010 9:29 am

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.
B
2
G
2
Posts: 10
Reputation: 670

Post » Fri May 28, 2010 10:26 am

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.
B
11
S
3
G
4
Posts: 622
Reputation: 3,186

Post » Fri May 28, 2010 11:10 am

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.

Edit:
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.
Image Image
B
161
S
48
G
89
Posts: 7,347
Reputation: 66,249

Post » Sat May 29, 2010 6:14 am

*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 VSTs..so choices are limited.
B
2
S
2
G
3
Posts: 114
Reputation: 1,553


Return to Help & Support using Construct Classic

Who is online

Users browsing this forum: No registered users and 5 guests