[Added] A_StartSound startTime

Moderator: GZDoom Developers

A_StartSound startTime

Postby Rachael » Mon Mar 02, 2020 12:59 am

https://github.com/coelckers/gzdoom/pull/1047

This allows to start a sound at an arbitrary position, instead of always at the beginning. This is a port of Nash's work from the older sound code before the ZMusic refactor.

Nash's sample mod for this is here. (old sample, will not work anymore, see attachment)

Based on Nash's sample, I also updated it to use A_StartSound for the test, as well, since A_PlaySound got deprecated:
a_playsound_start_time_test-2.zip
You do not have the required permissions to view the files attached to this post.
User avatar
Rachael
Webmaster
 
Joined: 13 Jan 2004
Discord: Rachael#3767
Twitch ID: madamerachelle
Github ID: madame-rachelle
Operating System: Windows 10/8.1/8/201x 64-bit
OS Test Version: No (Using Stable Public Version)
Graphics Processor: nVidia with Vulkan support

Re: A_StartSound startTime

Postby Graf Zahl » Mon Mar 02, 2020 1:03 am

Why did you add the new parameter to the deprecated A_PlaySound function? Let's keep it deprecated and not expand it.
User avatar
Graf Zahl
Lead GZDoom+Raze Developer
Lead GZDoom+Raze Developer
 
Joined: 19 Jul 2003
Location: Germany

Re: A_StartSound startTime

Postby Rachael » Mon Mar 02, 2020 1:12 am

Sorry - it was this PR's roots... it originated before the deprecation. Will remove.
User avatar
Rachael
Webmaster
 
Joined: 13 Jan 2004
Discord: Rachael#3767
Twitch ID: madamerachelle
Github ID: madame-rachelle
Operating System: Windows 10/8.1/8/201x 64-bit
OS Test Version: No (Using Stable Public Version)
Graphics Processor: nVidia with Vulkan support

Re: A_StartSound startTime

Postby Nash » Mon Mar 02, 2020 3:13 am

Yeah, the old one was made before the A_StartSound deprecation. Rachael's implementation is new.
User avatar
Nash
 
 
 
Joined: 27 Oct 2003
Location: Kuala Lumpur, Malaysia
Github ID: nashmuhandes

Re: A_StartSound startTime

Postby Graf Zahl » Mon Mar 02, 2020 3:27 am

It looks like it was removed from the wrong function internally, the change seems to be on A_StartSound, not A_PlaySound
User avatar
Graf Zahl
Lead GZDoom+Raze Developer
Lead GZDoom+Raze Developer
 
Joined: 19 Jul 2003
Location: Germany

Re: A_StartSound startTime

Postby Rachael » Mon Mar 02, 2020 6:13 am

Oh, that'll show me to code before bedtime...

Fixed.
User avatar
Rachael
Webmaster
 
Joined: 13 Jan 2004
Discord: Rachael#3767
Twitch ID: madamerachelle
Github ID: madame-rachelle
Operating System: Windows 10/8.1/8/201x 64-bit
OS Test Version: No (Using Stable Public Version)
Graphics Processor: nVidia with Vulkan support

Re: A_StartSound startTime

Postby Graf Zahl » Mon Mar 02, 2020 10:35 am

Did you forget to push?
User avatar
Graf Zahl
Lead GZDoom+Raze Developer
Lead GZDoom+Raze Developer
 
Joined: 19 Jul 2003
Location: Germany

Re: A_StartSound startTime

Postby Rachael » Mon Mar 02, 2020 2:17 pm

Oops, seems I did.
User avatar
Rachael
Webmaster
 
Joined: 13 Jan 2004
Discord: Rachael#3767
Twitch ID: madamerachelle
Github ID: madame-rachelle
Operating System: Windows 10/8.1/8/201x 64-bit
OS Test Version: No (Using Stable Public Version)
Graphics Processor: nVidia with Vulkan support

Re: A_StartSound startTime

Postby Rip and Tear » Wed Mar 04, 2020 9:00 am

It may be worth having a special value (-1?) that starts the sound at the sound's LOOP_START marker (https://zdoom.org/wiki/Audio_loop)
User avatar
Rip and Tear
I <3 ZScript
 
Joined: 02 May 2017
Operating System: Mac OS X 10.8 or later
Graphics Processor: Intel (Modern GZDoom)


Return to Closed Feature Suggestions

Who is online

Users browsing this forum: No registered users and 1 guest