SNDSEQ: play sounds over each other

Ask about editing graphics, sounds, models, music, etc here!
Shaders (GLSL) and SNDINFO questions also go here!

Moderators: GZDoom Developers, Raze Developers

Forum rules
Before asking on how to use a ZDoom feature, read the ZDoom wiki first. If you still don't understand how to use a feature, then ask here.
User avatar
Jekyll Grim Payne
 
 
Posts: 950
Joined: Mon Jul 21, 2008 4:08 am
Preferred Pronouns: He/Him
Graphics Processor: nVidia (Modern GZDoom)

SNDSEQ: play sounds over each other

Post by Jekyll Grim Payne »

First of all, I'm looking at the wiki page, and I don't understand the difference between play and playuntildone. They both work exactly the same way for me.

I have this code:

Code: Select all

:DoorOpenNormal
    play        doors/slow/open
    playrepeat    doors/slow/loop
    stopsound    doors/slow/stop
end
What I need to happen is to play the starting sound AND to immediately start playing the looped sound as well. But that doesn't happen; instead "doors/slow/open" plays first, then only after it ends "doors/slow/loop" starts playing.

So, how do I get what I need, and what's the difference between play and playuntildone?
User avatar
Daryn
Posts: 104
Joined: Wed Jan 23, 2019 10:22 am
Preferred Pronouns: He/Him
Operating System Version (Optional): Windows 11 Professional X64
Graphics Processor: nVidia with Vulkan support

Re: SNDSEQ: play sounds over each other

Post by Daryn »

In messing with sound sequences for Dragon Sector, I had to deal with tis, too. The short of it is, SNDSEQ is as it implies, a sequence. I've not been able to get two sounds to play together.

As for the differences between play and playuntil done, 'play' will play the sound,and if the action completes before the sound does, it will stop and play the next sound. Whereas 'playuntildone' will play the sound and wait for the sound to complete before playing the next sound.

What I ended up having to do was edit the sound and layer two sounds on top of each other.
User avatar
Jekyll Grim Payne
 
 
Posts: 950
Joined: Mon Jul 21, 2008 4:08 am
Preferred Pronouns: He/Him
Graphics Processor: nVidia (Modern GZDoom)

Re: SNDSEQ: play sounds over each other

Post by Jekyll Grim Payne »

Daryn wrote:What I ended up having to do was edit the sound and layer two sounds on top of each other.
The problem is, it doesn't work for me. There's a tiny but audible delay between the layered play sound (door starts moving), and the following playrepeat (door moving) sound, even though I checked in Audiacity, and there's no silence whatsoever in the files.
User avatar
Daryn
Posts: 104
Joined: Wed Jan 23, 2019 10:22 am
Preferred Pronouns: He/Him
Operating System Version (Optional): Windows 11 Professional X64
Graphics Processor: nVidia with Vulkan support

Re: SNDSEQ: play sounds over each other

Post by Daryn »

Jekyll Grim Payne wrote:
Daryn wrote:What I ended up having to do was edit the sound and layer two sounds on top of each other.
The problem is, it doesn't work for me. There's a tiny but audible delay between the layered play sound (door starts moving), and the following playrepeat (door moving) sound, even though I checked in Audiacity, and there's no silence whatsoever in the files.
Yeah, same result here. I think though, there's not much we can do about it. SNDSEQ seems pretty limited by what it can do. Depending on what you want to do, it might be possible to do a custom sound playback script that would fire the sounds you want and stop them when the door is finished opening. They'd have to play on a map spot rather than a sector's sequence, but that might work.
User avatar
Chris
Posts: 2906
Joined: Thu Jul 17, 2003 12:07 am
Graphics Processor: ATI/AMD with Vulkan/Metal Support

Re: SNDSEQ: play sounds over each other

Post by Chris »

GZDoom doesn't have the option to play multiple sounds at the exact same time. Since audio is processed asynchronously, there can be an internal mixing update in between the two play calls so they aren't guaranteed to start in sync, though if you get lucky with timing, it may happen. A new function would be needed to start multiple sounds at the same time, or GZDoom would need to be modified to make all sounds wait when they're called to play until the tic is finished processing, then have them all play in sync (though that may be too coarse).

Return to “Assets (and other stuff)”