-1
$\begingroup$

A question came up, and as a layman I am not sure how to appropriately find an answer; bear with me.

Given a 2 minute audio file, say a .wav file sampled at 44,100 Hz, I am curious if it is possible to effectively convert this audio file into a 4 minute one "sampled" at 22,050 Hz via the following process.

We have 44,100 blocks of data being stored every second. It stands to reason that a 22,050 Hz sampler expects half as many blocks per second. One approach to match this slower request rate would be to simply feed in every other block from the original sampling, but this seems like a highly lossy process and wouldn't extend the length of the audio file (also curious to know what effect this would have on this pitch, if any). On the other hand, we can match the slower request rate by feeding in each of the blocks one by one--just half as fast.

In my estimation, feeding the blocks in half as fast means in would take 4 minutes instead of two to finish feeding in the blocks.

Is this a valid strategy to produce a new .wav file?

Would this new .wav file be playable in any meaningful way?

Would the pitch of this wave file be lower?

What is the limiting behavior of iterating this process (Or, what does a .wav file sampled at 1 Hz sound like)?

Thanks.

$\endgroup$
2
$\begingroup$

So, first of all, please call your "blocks of data" audio samples; in the context of audio file formats, we also call them frames, but it's really not a "block of data", but simply: a sequence of 44100 numbers per second. Nothing more, nothing less.

Is this a valid strategy to produce a new .wav file?

We need to make a difference between the signal and the file format here:

  • The only difference between the original file and the new file would be that somewhere in the Wav file header, the sampling rate field would have changed. All the contained audio samples would be the same, so that's not really a "new" thing, imho.
  • The difference in playback really means something. For example, if two events in that audio (say, loud claps) happened 1s apart before, they will now indeed be 2s apart. Event-wise, the thing was slowed.
  • However, what really happens is that you just changed the duration of each sample from 1/44100 s to 1/22050 s.
    That also means that if the frequency a tone was 440.1 Hz before, and thus one period of that tone took 1000 samples, it now still takes 1000 samples (it's still the same samples, remember!), but these take twice as long to play: its frequency is now half as high. You converted a 440.1 Hz tone to a 220.05 Hz tone.
    That happens to all frequencies in your signal: you'll notice that, because not only is everything slower, everything is halved in frequency, and sounds terrible and low.

There's time-stretching algorithms that can do this slowing down without the frequency shift (within margins of errors), but they are a bit more complicated, as they really kind of need to "understand" or decompose the signal into tones and make them play for a longer period of time. To a soundcard, there's nothing special about a tone: it's just a sequence of samples, and thus of discrete events, just like the 1s apart claps; stretching them will have the frequency-lowering effect.
You'll find out about them when you look for time-stretch algorithms on this side.

$\endgroup$
1
$\begingroup$

You can do this very thing in some audio editors. Some let you change the sampling rate without resampling the audio - it literally just changes the marker that says "sampling rate 44100Hz" to "sampling rate 22050Hz."

It does indeed change the play time, and as you expect it doubles the play time when going from 44100Hz to 22050Hz.

It also lowers the pitch. It halves the frequency.

All the female voices sound like male voices, and all the male voices sound like James Earl Jones (that deep voice from Darth Vader) with a bad cold.

$\endgroup$

Your Answer

By clicking “Post Your Answer”, you agree to our terms of service, privacy policy and cookie policy

Not the answer you're looking for? Browse other questions tagged or ask your own question.