Page 1 of 1

loopsound problem

Posted: Thu May 13, 2004 4:38 pm
by agentmad007
hi ,

here is some part of my script

Code: Select all


.................................
bla bla bla

main:


////////////////////////sound////////////////////////////
	local.master = spawn ScriptMaster
	local.master aliascache ring sound/amb/ring.wav soundparms 2.0 0.0 1.0 0.0 200 4000 auto loaded maps "m dm obj"
	local.master aliascache open sound/amb/open.wav soundparms 2.0 0.0 1.0 0.0 200 4000 auto loaded maps "m dm obj"
	local.master aliascache kawoosh sound/amb/kawoosh.wav soundparms 2.0 0.0 1.0 0.0 200 4000 auto loaded maps "m dm obj"
level waittill prespawn 

bla bla 

$speaker1 playsound open 
$speaker2 playsound open 

the command playsound work fine i hear my sound but.....

Code: Select all

$speaker1 loopsound open 
$speaker2 loopsound open 
dont work why ?

my sound isn't long enough so i had to looped it

thx

Posted: Thu May 13, 2004 4:41 pm
by blue60007
:? That should work. :? Try re typing it, maybe there are some extra spaces or line breaks...

Posted: Thu May 13, 2004 4:47 pm
by agentmad007
hehe nono i m not blind this is very strange!

that loopsound command dont want to work !.....i dont want to edit the .wav with a music tool , damn ........but if its the only solution :( :(

Posted: Thu May 13, 2004 5:16 pm
by jv_map
Hmm never heard of this problem before... :?

Are you absolutely sure you can't hear the sound? Do you get any errors in the console? What kind of entities (classname) are $speaker1 and $speaker2?

Try changing the channel the sound plays on, like 'item' instead of auto.

Posted: Thu May 13, 2004 5:25 pm
by agentmad007
yes i m totally sure

in game i change the script command playsound to loopsound

playsound worked but loopsound dont want
thats the only thing i changed

my speakers are script_origin then i ll try item...........

thx.

Posted: Thu May 13, 2004 5:34 pm
by agentmad007
same dont work ........is there any rapport with the sound's quality?

i mean the bitrates .....do i have to convert the .wav to lowest quality ?

actually is 88 kbps

open

Posted: Thu May 13, 2004 5:36 pm
by tltrude
You sould not use "open" as the name because it is a script command word. Change it to "open_snd" or something like that.

level waittill spawn
thread start_sounds
end

//================

start_sounds:

wait 1 // sometimes a little wait is required
$speaker1 loopsound open_snd
$speaker2 loopsound open_snd

end

Posted: Thu May 13, 2004 7:00 pm
by agentmad007

Code: Select all


main:

////////////////////////sound//////////////////////////// 
   local.master = spawn ScriptMaster 
   local.master aliascache open_gate sound/amb/oepn.wav soundparms 2.0 0.0 1.0 0.0 200 4000 auto loaded maps "m dm obj" 


bla bla bla


wait 0.1====> added a key wait (tried even without )

$speaker1 loopsound open_gate====> changed open by open_gate 
$speaker2 loopsound open_gate

dont work

Posted: Thu May 13, 2004 9:49 pm
by blue60007
Hmm... :? Try using a script_model with these key/values:

model/ fx/dummy.tik
targetname speaker1

Although any entity can be a speaker, try that...

strange

Posted: Fri May 14, 2004 3:32 am
by tltrude
I got the wave file from him and tried it with a script_origin. Wouldn't work for me either. Changing it to a script_model fixed it, but still doesn't explain why loopsound fails with a script_origin. It might be something to do with it being an 8 bit wave file, not sure.

Posted: Sat May 15, 2004 3:48 am
by blue60007
I guess script_origin's can only play certain formats, while script_models can play all? :?

origins

Posted: Sat May 15, 2004 4:27 am
by tltrude
I have used script_origins to loop sound before with no problems. All of the stock wave files in the game are 16bit format.

Posted: Sat May 15, 2004 5:01 am
by blue60007
Then I guess script_origins only support 16bit audio.

Posted: Sat May 15, 2004 2:07 pm
by agentmad007
yes think same .......a script_origin can read some kind of format

my .wav was a 8 bit and only playable via script_model fx/dummy.tik