Page 1 of 2

Looping sounds?

Posted: Wed Aug 27, 2008 3:59 pm
by RaptorX
I put in a couple sounds and when they play they loop even when i want them to stop.
I need help on this one. It's really annoying. :x

Re: Looping sounds?

Posted: Wed Aug 27, 2008 4:24 pm
by Enjay
Bit more information please. How are you playing these sounds? Copies of your SNDINFO etc.

Re: Looping sounds?

Posted: Wed Aug 27, 2008 4:33 pm
by RaptorX

Code: Select all

PIGSIGHT    PIGSIGHT
$Random PIGACT { PIGACT1 PIGACT2 PIGACT3 }
PIGACT1		PIGACT1
PIGACT2		PIGACT2
PIGACT3		PIGACT3
PIGPAIN     PIGPAIN
PIGDIE      PIGDIE
SHTGN1      SHTGN1
SHTGN2      SHTGN2
mutate      mutate
I dont see anything wrong. :(

Re: Looping sounds?

Posted: Wed Aug 27, 2008 4:34 pm
by Ghastly
How are you playing them? If decorate, what function? A_PlaySoundEx? Are you using them as ambient sounds? We can't do much if we don't have a lot of information.

Edit: Actually, those do look like they're defined for a monster, but what functions are you using to play them?

Re: Looping sounds?

Posted: Wed Aug 27, 2008 4:47 pm
by RaptorX
just a playsound

Re: Looping sounds?

Posted: Wed Aug 27, 2008 4:55 pm
by Enjay
How? DECORATE? ACS? Console? What?

Show us the script, or tell us what you are typing. There are probably half a dozen ways to play a sound in Zdoom. We need to see exactly what you are doing. How about uploading a sample WAD and telling us how to reproduce the problem. If we have that kind of information, someone will be able to find out what's wrong.

Re: Looping sounds?

Posted: Wed Aug 27, 2008 5:01 pm
by RaptorX
decorate, a_playsound.
sorry it took long. had to put it on filefront, too large.
http://files.filefront.com/samplewad/;1 ... einfo.html

Re: Looping sounds?

Posted: Wed Aug 27, 2008 5:22 pm
by Enjay
OK, first of all, minor problem, just so you know, the first sprite for the pig (PIGGA1) has somehow ended up outside the S_ markers so Zdoom halts when loading the file because the rotations for sprite A are not complete.

Anyway, you are right. Your sounds loop. It's bizarre and, I don't think it's anything to do with how you have set them up. On a hunch, I exported them all from the WAD and then opened them in GoldWave and resaved them. I stuck them back in the WAD and - tada! it seems to work. So, there is something odd about the sound files themselves. Whether this is a problem with the sound lumps, with Zdoom or with fmod, I have no idea. So, try a different program to save your sound files and see how that works. It's maybe also worth reporting this as a bug to flag it up to Graf/Randy and see if they can shed any light on the matter.

[edit] Even bringing down the console with a WAD using your original sounds loaded and typing "playsound pigsight" plays the appropriate sound which then loops over and over without me having to do anything else. If I load my fixed sounds, it just plays once, as it should.[/edit]

[edit2]And extracting one of your sound lumps and renaming it to replace an original Doom sound, then loading it, and only it - nothing else at all - then playing the sound has it looping over and over. Like I said, I don't know if there is actually a problem with the lumps themselves, or if Zdoom is at fault, but something about that combination of your sounds an Zdoom isn't working correctly. [/edit]

Re: Looping sounds?

Posted: Wed Aug 27, 2008 5:45 pm
by randi
I haven't looked, but I assume the sounds are WAVs with loop points saved in them. By using loop points in the audio file itself, you can divide the sound into an intro part and a looping part, with the intro part played only once and the looping part played repeatedly. (Though whether the playsound call should respect the absence of the looping flag if the sound was saved as a looping sound is perhaps debatable. It's not something I had actually considered.)

Re: Looping sounds?

Posted: Wed Aug 27, 2008 5:47 pm
by Enjay
I didn't know that such a thing was possible in the WAV format. You learn something every day.

Re: Looping sounds?

Posted: Wed Aug 27, 2008 7:29 pm
by Project Shadowcat
Enjay wrote:I didn't know that such a thing was possible in the WAV format. You learn something every day.
It's perfect for music...

Re: Looping sounds?

Posted: Wed Aug 27, 2008 11:22 pm
by DBThanatos
I've had this issue before a couple times (funnily in sounds that i thought "hey! looping this sounds cool!"). I thought it was an user error, so I dropped it without even asking. Now that i know, I can take advantage of this :D

Re: Looping sounds?

Posted: Thu Aug 28, 2008 10:53 am
by Zippy
Enjay wrote:I didn't know that such a thing was possible in the WAV format. You learn something every day.
Enjay wrote:opened them in GoldWave and resaved them
I think GoldWave implements that, calling them "cues" (or something). You can try making a test sound with that and see what comes of it.

I remember having to deal with this because Half-Life didn't always have looping controls for sounds, so if you wanted a looping ambient sound you had to implement the cue into the sound file itself (or use the entities to create a loop of activations continuously replaying the sound).

Re: Looping sounds?

Posted: Thu Aug 28, 2008 2:16 pm
by RaptorX
enjay can you send me the fixed sounds?
I have no idea how to fix it.

Re: Looping sounds?

Posted: Thu Aug 28, 2008 3:20 pm
by Enjay
You would probably fix them by saving them as a different format entirely - eg as ogg files using oggdrop or something. Anyway, I *think* this is the WAD with the fixed versions and I *think* they are all there. If they don't work, let me know.

http://www.zshare.net/download/1780409046662f90/