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.

SNDSEQ: play sounds over each other

Postby Jekyll Grim Payne » Fri Jul 02, 2021 10:11 am

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 allExpand view
: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
Jekyll Grim Payne
 
Joined: 21 Jul 2008
Discord: Agent_Ash#4401
Github ID: jekyllgrim
Operating System: Windows 10/8.1/8/201x 64-bit
OS Test Version: No (Using Stable Public Version)
Graphics Processor: nVidia (Modern GZDoom)

Re: SNDSEQ: play sounds over each other

Postby Daryn » Sun Aug 15, 2021 10:35 pm

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
Daryn
 
Joined: 23 Jan 2019
Operating System: Windows 10/8.1/8/201x 64-bit
OS Test Version: No (Using Stable Public Version)
Graphics Processor: nVidia (Modern GZDoom)

Re: SNDSEQ: play sounds over each other

Postby Jekyll Grim Payne » Fri Sep 03, 2021 5:39 am

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
Jekyll Grim Payne
 
Joined: 21 Jul 2008
Discord: Agent_Ash#4401
Github ID: jekyllgrim
Operating System: Windows 10/8.1/8/201x 64-bit
OS Test Version: No (Using Stable Public Version)
Graphics Processor: nVidia (Modern GZDoom)

Re: SNDSEQ: play sounds over each other

Postby Daryn » Sun Sep 05, 2021 1:42 pm

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
Daryn
 
Joined: 23 Jan 2019
Operating System: Windows 10/8.1/8/201x 64-bit
OS Test Version: No (Using Stable Public Version)
Graphics Processor: nVidia (Modern GZDoom)

Re: SNDSEQ: play sounds over each other

Postby Chris » Sun Sep 05, 2021 7:58 pm

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).
User avatar
Chris
 
Joined: 17 Jul 2003


Return to Assets (and other stuff)

Who is online

Users browsing this forum: SanyaWaffles and 0 guests