A_StartSound startTime

Moderator: GZDoom Developers

Post Reply
User avatar
Rachael
Posts: 13948
Joined: Tue Jan 13, 2004 1:31 pm
Preferred Pronouns: She/Her
Contact:

A_StartSound startTime

Post by Rachael »

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
(17.39 KiB) Downloaded 60 times
User avatar
Graf Zahl
Lead GZDoom+Raze Developer
Lead GZDoom+Raze Developer
Posts: 49230
Joined: Sat Jul 19, 2003 10:19 am
Location: Germany

Re: A_StartSound startTime

Post by Graf Zahl »

Why did you add the new parameter to the deprecated A_PlaySound function? Let's keep it deprecated and not expand it.
User avatar
Rachael
Posts: 13948
Joined: Tue Jan 13, 2004 1:31 pm
Preferred Pronouns: She/Her
Contact:

Re: A_StartSound startTime

Post by Rachael »

Sorry - it was this PR's roots... it originated before the deprecation. Will remove.
User avatar
Nash
 
 
Posts: 17498
Joined: Mon Oct 27, 2003 12:07 am
Location: Kuala Lumpur, Malaysia
Contact:

Re: A_StartSound startTime

Post by Nash »

Yeah, the old one was made before the A_StartSound deprecation. Rachael's implementation is new.
User avatar
Graf Zahl
Lead GZDoom+Raze Developer
Lead GZDoom+Raze Developer
Posts: 49230
Joined: Sat Jul 19, 2003 10:19 am
Location: Germany

Re: A_StartSound startTime

Post by Graf Zahl »

It looks like it was removed from the wrong function internally, the change seems to be on A_StartSound, not A_PlaySound
User avatar
Rachael
Posts: 13948
Joined: Tue Jan 13, 2004 1:31 pm
Preferred Pronouns: She/Her
Contact:

Re: A_StartSound startTime

Post by Rachael »

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

Fixed.
User avatar
Graf Zahl
Lead GZDoom+Raze Developer
Lead GZDoom+Raze Developer
Posts: 49230
Joined: Sat Jul 19, 2003 10:19 am
Location: Germany

Re: A_StartSound startTime

Post by Graf Zahl »

Did you forget to push?
User avatar
Rachael
Posts: 13948
Joined: Tue Jan 13, 2004 1:31 pm
Preferred Pronouns: She/Her
Contact:

Re: A_StartSound startTime

Post by Rachael »

Oops, seems I did.
User avatar
Rip and Tear
Posts: 187
Joined: Tue May 02, 2017 3:54 pm

Re: A_StartSound startTime

Post by Rip and Tear »

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)
Post Reply

Return to “Closed Feature Suggestions [GZDoom]”