loopsound problem

Post your scripting questions / solutions here

Moderator: Moderators

Post Reply
agentmad007
Brigadier General
Posts: 570
Joined: Tue Feb 24, 2004 3:52 pm

loopsound problem

Post 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
blue60007
General
Posts: 1247
Joined: Sun Mar 07, 2004 11:44 pm

Post by blue60007 »

:? That should work. :? Try re typing it, maybe there are some extra spaces or line breaks...
Image
agentmad007
Brigadier General
Posts: 570
Joined: Tue Feb 24, 2004 3:52 pm

Post 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 :( :(
jv_map
Site Admin
Posts: 6521
Joined: Tue Sep 03, 2002 2:53 pm
Location: The Netherlands
Contact:

Post 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.
Image
agentmad007
Brigadier General
Posts: 570
Joined: Tue Feb 24, 2004 3:52 pm

Post 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.
agentmad007
Brigadier General
Posts: 570
Joined: Tue Feb 24, 2004 3:52 pm

Post 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
User avatar
tltrude
Chuck Norris
Posts: 4774
Joined: Sun Jul 07, 2002 4:03 am
Location: Oklahoma, USA
Contact:

open

Post 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
Tom Trude,

Image
agentmad007
Brigadier General
Posts: 570
Joined: Tue Feb 24, 2004 3:52 pm

Post 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
blue60007
General
Posts: 1247
Joined: Sun Mar 07, 2004 11:44 pm

Post 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...
Image
User avatar
tltrude
Chuck Norris
Posts: 4774
Joined: Sun Jul 07, 2002 4:03 am
Location: Oklahoma, USA
Contact:

strange

Post 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.
Tom Trude,

Image
blue60007
General
Posts: 1247
Joined: Sun Mar 07, 2004 11:44 pm

Post by blue60007 »

I guess script_origin's can only play certain formats, while script_models can play all? :?
Image
User avatar
tltrude
Chuck Norris
Posts: 4774
Joined: Sun Jul 07, 2002 4:03 am
Location: Oklahoma, USA
Contact:

origins

Post 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.
Tom Trude,

Image
blue60007
General
Posts: 1247
Joined: Sun Mar 07, 2004 11:44 pm

Post by blue60007 »

Then I guess script_origins only support 16bit audio.
Image
agentmad007
Brigadier General
Posts: 570
Joined: Tue Feb 24, 2004 3:52 pm

Post 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
Post Reply