[Added] Play sounds in a forced pitch (e.g. A_PlaySoundPitched)

Moderator: GZDoom Developers

Play sounds in a forced pitch (e.g. A_PlaySoundPitched)

Postby XxMiltenXx » Sat Dec 30, 2017 11:13 am

Well, as the title says, I'd like a function where you can specify and force the pitch the sound is played at. Not a fancy way, just changing the sample rate as ZDoom already does.

Maybe it could be done as an extension to the original A_PlaySound:

A_PlaySound(sound whattoplay = "weapons/pistol", int slot = CHAN_BODY, double volume = 1.0, bool looping = false, double attenuation = ATTN_NORM, bool local = false, double pitch = 1.0, bool randompitch = true);

So a pitch of 0.5 would half the sample rate, and randompitch determines whether the random pitching (if enabled and set in SNDINFO) should still be factored in on top of it.
XxMiltenXx
 
Joined: 08 Jan 2014
Location: Germany
Operating System: Windows 10/8.1/8 64-bit
Graphics Processor: nVidia with Vulkan support

Re: Play sounds in a forced pitch (e.g. A_PlaySoundPitched)

Postby Blue Shadow » Thu Jul 25, 2019 5:46 am

A_PlaySound has been extended with a pitch parameter. A setter function has also been added.
https://github.com/coelckers/gzdoom/com ... 22c2eda5e8
User avatar
Blue Shadow
 
 
 
Joined: 14 Nov 2010
Operating System: Windows 10/8.1/8 64-bit
Graphics Processor: ATI/AMD (Modern GZDoom)

Re: Play sounds in a forced pitch (e.g. A_PlaySoundPitched)

Postby Major Cooke » Thu Jul 25, 2019 10:44 am

As well as a starting pitch for A_PlaySound directly, too.

I shouldn't have to say this but some people asked me about A_PlaySoundEx, and failed to realized it's deprecated: No. Never. Deprecated means it's no longer going to be updated. End of story. Use A_PlaySound instead.
User avatar
Major Cooke
Do unto others as you would have unto you. Judge yourself first.
 
Joined: 28 Jan 2007


Return to Closed Feature Suggestions

Who is online

Users browsing this forum: No registered users and 1 guest