Game Development Community

Help - Music and Sound Effects played simultaneously.

by Romulo Diniz Filippini · in Torque Game Builder · 03/25/2011 (6:29 pm) · 6 replies

Hello everyone!

I've searched for this topic in the forums - Music and sound effects - endlessly and I think that I've seem pretty much all that has been said about it.

Several people had the problem that concerns in playing a looping sound and playing other sound (a non-looping one in most cases) at the same, and it seems that the problem is already a one recurring, and people blame new OpenAl drivers for it.

The question is, there isn't really any solution for this? You guys really make games that don't overlay any sounds? If it is the case, Garage Games shouldn't handle this as a critical issue?

#1
03/26/2011 (6:53 am)
I have no idea what you're talking about. Are you trying to say you can't play multiple sounds at the same time?

I play multiple sounds at the same time in my games in TGB 1.7.5

I have background music (looping), I have sound effects(non-looping) which multiple play at a time some times... I've never even heard of this issue.

I play 3 or more sounds at a time with no issues. In fact, I believe you can play up to 16 sounds at a time (at the least).
#2
03/26/2011 (8:16 am)
It does not work for me. One of the two things happens:

1- The second sound does not play at all.
2- The music is interrupted, the sound plays and after finished, the music returns, now play from the start.

So it could be a hardware issue?
#3
03/26/2011 (8:54 am)
Post more about your system, and the relevant part from the top of the console.log. We might see some hints from OpenAL there.
#4
03/28/2011 (7:31 am)
Ok, there are my codes:

First the audio description block.

$BGmusic = 1;
$SoundEffects = 2;


new AudioDescription(music)
{
   volume = 1.0;
   isLooping = true;
   is3D = false;
   type = 1;
};

new AudioDescription(effect)
{
   volume = 1.0;
   isLooping = false;
   is3D = false;
   type = 2;
};

now the audio profiles block:

// --------------------------------------------------------------------

// --------------------------------------------------------------------
new AudioProfile(bg1)

{
filename = "~/data/audio/2 Lilith Song - Loop 1.ogg";
description = "music";
preload = true;
};


// --------------------------------------------------------------------

// --------------------------------------------------------------------
new AudioProfile(crickets)

{

filename = "~/data/audio/Crickets.ogg";

description = "effect";

preload = true;

};
// --------------------------------------------------------------------

// --------------------------------------------------------------------

I think that it's pretty general code, so the problem could be at the script call:

schedule(0, 0, playBG)
schedule(5000, 0, playCrickets)

function playBG()
{
alxPlay(bg1);
}

function playCrickets()
{
alxPlay(crickets);
}

That is what I use, and at present moment bg1 plays and cricket not.
#5
03/28/2011 (7:34 am)
Use [ ] tags. Not < > .
#6
03/28/2011 (7:38 am)
Where's the console.log?

If you comment out the playBG schedule does the crickets still play?