The Dink Network

sound number 1 - the quack

June 30th 2024, 06:20 AM
custom_simon.gif
SimonK
Peasant He/Him Australia
 
"quack.wav"- which is loaded into sound slot 1 - does the engine treat this sound differently?

Just swapping it out with another wav file, and the replacement wav file plays really slowly, like it has had a tempo and pitch shift change.

I've looked at the original Quack.wav file and according to Audacity it is 212.31 bpm, with a time signature of 4/4.

Matching that bpm and time signature doesn't seem to help, but it is about a 60% pitch and tempo shift to get the replacement sound back to sounding sort of normal.

June 30th 2024, 07:35 AM
peasantmb.gif
yeoldetoast
Peasant They/Them Australia
Oh, NOW YOU'VE DONE IT! 
Yes, I was considering adding this to my recent review of Sparrowhawk's sound list, but thought it too obscure at the time.

The final playback hz for the duck is determined by the duck's size. For ducks of sprite size 100 (default) or larger, the playback rate is:

duck_hz - (size * 50)


By default, duck_hz is 18Khz but is only changeable in Yedink so far. Therefore, a size 100 duck will play back sound slot 1 at 13KHz assuming no modifications.
For ducks smaller than size 100, the formula is:

(duck_hz - 2000) + (size * 100)


Which results in higher frequency quacks for little ducks. The same applies to pigs (slots 2-4), except that those also receive an 800Hz random variance and have a thing that checks if they've already got a sound playing before oinking again.

Resampling in ffmpeg goes something like:

ffmpeg -i inquack.wav -ar 13000 outquack.wav


Keep in mind that resampling this low will make it sound comparatively horrible, assuming the original is at a standard rate of 44, 48, or 96KHz etc.
June 30th 2024, 09:20 PM
custom_simon.gif
SimonK
Peasant He/Him Australia
 
Okay, somewhat bizarre approach to sound. Thanks.