Sound Loop Problem! Need help Fast!

Have questions about CoD4 mapping that aren't covered in the tutorials section? Post here!

Moderator: Core Staff

User avatar
TrikX
CJ Wannabe
CJ Wannabe
Posts: 45
Joined: July 23rd, 2012, 1:41 pm

Sound Loop Problem! Need help Fast!

Post by TrikX » October 27th, 2012, 5:39 pm

I finished my map, and made a Music room!
Sound in it works, but it's not looping!

When i put "looping" under loop section in .csv, then i have no sound!
Also when i put PlayLoopSound in script, sound does not work, and with
PlayLocalSound it works but it does not loop!

Please help me, i want to fix that and release my map asap!



This is what i have in my .csv


name,sequence,file,vol_min,vol_max,vol_mod,pitch_min,pitch_max,dist_min,dist_max,channel,type,probability,loop,masterslave,loadspec,subtitle,compression,secondaryaliasname,volumefalloffcurve,startdelay,speakermap,reverb,lfe percentage,center percentage,platform,envelop_min,envelop_max,envelop percentage

#mapsounds,,,,,,,,,,,,,,,,,,,,,,,,,,,,

sound_1,1,music/finish.mp3,0.8,0.95,,0.95,1.05,7,1500,auto,streamed,,looping,,mp_eb_rudnik,,,,,,,,,,,,,

User avatar
Drofder2004
Core Staff
Core Staff
Posts: 13313
Joined: April 13th, 2005, 8:22 pm
Location: UK, London

Re: Sound Loop Problem! Need help Fast!

Post by Drofder2004 » October 27th, 2012, 8:01 pm

I have seen mentioned that mp3's have issues looping when not played at the correct bit rate.
It was a discussion in Rezil's last map release.
Image
Virgin Media 20Mb Broadband:
"Perfect for families going online at the same time, downloading movies, online gaming and more."
Borked internet since: 22-07-2010

User avatar
TrikX
CJ Wannabe
CJ Wannabe
Posts: 45
Joined: July 23rd, 2012, 1:41 pm

Re: Sound Loop Problem! Need help Fast!

Post by TrikX » October 27th, 2012, 8:10 pm

ok. so i have to make .wav or can you tell me on what bitrate .mp3 would loop!?

User avatar
Rezil
Core Staff
Core Staff
Posts: 2030
Joined: July 24th, 2006, 11:21 am
Location: Cramped in a small cubicle/making another jump map

Re: Sound Loop Problem! Need help Fast!

Post by Rezil » October 27th, 2012, 8:13 pm

Apparently it has to be 128kbps or it won't loop. Oddly enough even using 128kbps didn't help with my looping issue. I'd still just suggest you convert it to .wav, it will increase the file size but I think it shouldn't be that big of a problem for most people.
Drofder2004: Drofder's rules for reviewing a map
[...]
#5 If your name is Rezil, minimum 5/5.
---
<LT>YosemiteSam[NL]:
I heard somewhere that the best way to start is juggling 2 balls with one hand, so you will get a feel for it.

User avatar
TrikX
CJ Wannabe
CJ Wannabe
Posts: 45
Joined: July 23rd, 2012, 1:41 pm

Re: Sound Loop Problem! Need help Fast!

Post by TrikX » October 27th, 2012, 8:17 pm

it is 128 kbps! well ty, i will just convert it to .wav then!

thank you both for helping! ;)

User avatar
TrikX
CJ Wannabe
CJ Wannabe
Posts: 45
Joined: July 23rd, 2012, 1:41 pm

Re: Sound Loop Problem! Need help Fast!

Post by TrikX » October 27th, 2012, 8:40 pm

i made .wav now and tried it again, still nothing! -.-
this thing is gonna get me mad!

User avatar
TrikX
CJ Wannabe
CJ Wannabe
Posts: 45
Joined: July 23rd, 2012, 1:41 pm

Re: Sound Loop Problem! Need help Fast!

Post by TrikX » October 28th, 2012, 2:48 pm

i saw ROTANT made on mp_kraftz on finish the music play only with this line of code, and it loops!

getent ("finish","targetname") playloopsound ("finish");


no other scripting besides that, and he uses .mp3
also if you leave the room, you can't hear the music!
i asked him how he done it but he cant remember cause he didn't map in a while!
kie also can't rememberhow to set looping!

so i know someone here knows how to do it with this! please help!

User avatar
Drofder2004
Core Staff
Core Staff
Posts: 13313
Joined: April 13th, 2005, 8:22 pm
Location: UK, London

Re: Sound Loop Problem! Need help Fast!

Post by Drofder2004 » October 28th, 2012, 3:33 pm

Compare his mp3 bitrate to your own. Copy it exactly.
Image
Virgin Media 20Mb Broadband:
"Perfect for families going online at the same time, downloading movies, online gaming and more."
Borked internet since: 22-07-2010

User avatar
TrikX
CJ Wannabe
CJ Wannabe
Posts: 45
Joined: July 23rd, 2012, 1:41 pm

Re: Sound Loop Problem! Need help Fast!

Post by TrikX » October 28th, 2012, 3:39 pm

ok, i could do that, but the problem is that i have an other script, and i don't know how to do do it with this one ROTANT did!
getent ("finish","targetname") playloopsound ("finish");

what do i need to do in order to have only this line and to have my sound working and looping?

User avatar
Drofder2004
Core Staff
Core Staff
Posts: 13313
Joined: April 13th, 2005, 8:22 pm
Location: UK, London

Re: Sound Loop Problem! Need help Fast!

Post by Drofder2004 » October 28th, 2012, 3:56 pm

TrikX wrote:ok, i could do that, but the problem is that i have an other script, and i don't know how to do do it with this one ROTANT did!
getent ("finish","targetname") playloopsound ("finish");

what do i need to do in order to have only this line and to have my sound working and looping?
I cant see either your script of Rotants, so I do not know how either of you have done it. Post your script, there are plenty of scripters here.
Image
Virgin Media 20Mb Broadband:
"Perfect for families going online at the same time, downloading movies, online gaming and more."
Borked internet since: 22-07-2010

User avatar
TrikX
CJ Wannabe
CJ Wannabe
Posts: 45
Joined: July 23rd, 2012, 1:41 pm

Re: Sound Loop Problem! Need help Fast!

Post by TrikX » October 28th, 2012, 4:59 pm

ok, so this is what i use, and music works, but with this script i cant get it to loop, not .mp3 or .wav

Code: Select all

trigger_init()
{
	soundtriggers = getentarray( "sound_trigger", "targetname" );

	for( i = 0; i < soundtriggers.size; i++ )
		soundtriggers[i] thread trigger_sound();
}

trigger_sound()
{
	soundpos = getent( self.target, "targetname" );

	for(;;)
	{
		self waittill( "trigger", user );

		if(!isDefined(user.sound) || user.sound != soundpos.script_noteworthy)
		{
			if(isDefined(user.sound))
				user stoplocalsound(user.sound);

			user.sound = soundpos.script_noteworthy;
			user thread play_the_sound(soundpos.script_noteworthy);
			user thread waitForLeave(self, soundpos.script_noteworthy);
		}
		wait 0.25;
	}
}

play_the_sound( sound )
{
	self endon("disconnect");
	self notify("music_change");
	self endon("music_change");

	self playlocalsound( sound );
	wait 500;
	self.sound = undefined;
}

killSuspenseMusic()
{
	wait 1;

	if(isDefined(game) && isDefined(game["music"]) && isDefined(game["music"]["suspense"]))
		for(i = 0;i < game["music"]["suspense"].size;i++)
			game["music"]["suspense"][i] = "null";
}

waitForLeave(trigger, sound)
{
	if(!isSubStr(sound, "1"))
		return;

	self endon("disconnect");
	while(self isTouching(trigger))
		wait 0.5;
	self stopLocalSound(sound);
	self.sound = undefined;;
}

and this is all he has for the music part and it is in main() of the .gsc

Code: Select all

getent ("finish","targetname") playloopsound ("finish");
i cant see his .csv cause he deleted it all from his computer!
but this is mine .csv

Code: Select all

name,sequence,file,vol_min,vol_max,vol_mod,pitch_min,pitch_max,dist_min,dist_max,channel,type,probability,loop,masterslave,loadspec,subtitle,compression,secondaryaliasname,volumefalloffcurve,startdelay,speakermap,reverb,lfe percentage,center percentage,platform,envelop_min,envelop_max,envelop percentage

#mapsounds,,,,,,,,,,,,,,,,,,,,,,,,,,,,

sound_1,1,music/finish.mp3,0.8,0.95,,0.95,1.05,7,1500,auto,streamed,,,,mp_eb_rudnik,,,,,,,,,,,,,
just to say, i tried with .wav and still nothing! so i have 128kbps .mp3 now

also, when i leave the trigger music stops what is supposed to do, but even when i shoot inside the room it stopped,
then i need to leave and enter again to start it!
so the best option for me would be to make a sound loop in 1 room and problem would be solved!

User avatar
TrikX
CJ Wannabe
CJ Wannabe
Posts: 45
Joined: July 23rd, 2012, 1:41 pm

Re: Sound Loop Problem! Need help Fast!

Post by TrikX » October 28th, 2012, 6:52 pm

i made now an other .mp3 file on 80kbps and that one loops! :D
but the problem now is that is playing on the whole map, and if i noclip trough any wall on map music stops and plays again! :O
how can i lower the radius or do i need to change something in .csv or my script?

User avatar
Drofder2004
Core Staff
Core Staff
Posts: 13313
Joined: April 13th, 2005, 8:22 pm
Location: UK, London

Re: Sound Loop Problem! Need help Fast!

Post by Drofder2004 » October 28th, 2012, 7:21 pm

dist_min,dist_max

Those two columns in your CSV are the distance to where you can hear sound and at what volume.
Image
Virgin Media 20Mb Broadband:
"Perfect for families going online at the same time, downloading movies, online gaming and more."
Borked internet since: 22-07-2010

User avatar
TrikX
CJ Wannabe
CJ Wannabe
Posts: 45
Joined: July 23rd, 2012, 1:41 pm

Re: Sound Loop Problem! Need help Fast!

Post by TrikX » October 28th, 2012, 11:52 pm

everything is fixed! :D it took me 3 days but it paid off!
by some miracle ROTANT found the .csv file and sent it to me!
now i have .mp3 file that loops ans plays as it should!

now i'm gonna put link of my new map mp_eb_rudnik on CJ so you all can play and see what i have done!

Again, thank you All for helping! ;)

F |Madness| U
CJ G0D!
CJ G0D!
Posts: 1575
Joined: June 3rd, 2009, 9:02 pm
Location: Cardiff University, UK

Re: Sound Loop Problem! Need help Fast!

Post by F |Madness| U » October 29th, 2012, 8:16 pm

It might be useful for others if you say how the ROTANT method works with that one line of script, so others can use it to help with their own problems, but I'm glad you got your problem fixed.
-

Post Reply

Who is online

Users browsing this forum: No registered users and 33 guests