Skip to main content

Notice

Please note that most of the software linked on this forum is likely to be safe to use. If you are unsure, feel free to ask in the relevant topics, or send a private message to an administrator or moderator. To help curb the problems of false positives, or in the event that you do find actual malware, you can contribute through the article linked here.
Topic: How can I get into a wav/flac file to change the sample rate? (Read 5610 times) previous topic - next topic
0 Members and 1 Guest are viewing this topic.

How can I get into a wav/flac file to change the sample rate?

 I need to do is change this 1 number. Everything else such as every sample in the file will remain uncahnged.


Re: How can I get into a wav/flac file to change the sample rate?

Reply #1
i know the pitch also the speed will change which is the thing i need.
is there any simple tool that can do this change?

Re: How can I get into a wav/flac file to change the sample rate?

Reply #2
The sampling rate fs. value should be in the "header" of the file however I am not quite familiar with those ,so i am seeking  some help here :-)

Re: How can I get into a wav/flac file to change the sample rate?

Reply #3
Open the file in Audacity, type in your desired "Project Rate", and export it to a new file.


Re: How can I get into a wav/flac file to change the sample rate?

Reply #5
Wave File Header Investigator for fast batch processing in place.
http://www.railjonrogut.com/HeaderInvestigator.htm

There are 2 values that need to be changed. Sample rate and byte rate.

Re: How can I get into a wav/flac file to change the sample rate?

Reply #6
Thank y'all so much guys!  :)  :)

Re: How can I get into a wav/flac file to change the sample rate?

Reply #7
i think i've found my clues out :)

Re: How can I get into a wav/flac file to change the sample rate?

Reply #8
Wave File Header Investigator for fast batch processing in place.
http://www.railjonrogut.com/HeaderInvestigator.htm

There are 2 values that need to be changed. Sample rate and byte rate.
still some doubt there.  what does the “bits per sample” option mean? I find it if it’s a 16bit audio file it will be “2” and 24bit files will be “3”.  if you alter a 24bit file in to a “2”, it will become harsh noise totally. 🤔

Re: How can I get into a wav/flac file to change the sample rate?

Reply #9
Uncheck the Change boxes for properties you don't want to alter. Those are for unusual cases when the header is written incorrectly.

Re: How can I get into a wav/flac file to change the sample rate?

Reply #10
Quote
what does the “bits per sample” option mean? I find it if it’s a 16bit audio file it will be “2” and 24bit files will be “3”. 
That looks like a bug/typo and I'm pretty sure it should say bytes per sample.   There are 8-bits in a byte so 16-bits is 2 bytes and I'm not sure what happens if you fill-in the wrong value.

There is a field in the WAV header called byte rate.   It's redundant and can be calculated so I assume Header Inspector re-calculates it and takes care of that automatically.

Re: How can I get into a wav/flac file to change the sample rate?

Reply #11
Quote
what does the “bits per sample” option mean? I find it if it’s a 16bit audio file it will be “2” and 24bit files will be “3”. 
That looks like a bug/typo and I'm pretty sure it should say bytes per sample.   There are 8-bits in a byte so 16-bits is 2 bytes and I'm not sure what happens if you fill-in the wrong value.

There is a field in the WAV header called byte rate.   It's redundant and can be calculated so I assume Header Inspector re-calculates it and takes care of that automatically.
That's the perfect explanation!

Re: How can I get into a wav/flac file to change the sample rate?

Reply #12
You should remember that WAV is a container (a specific case of the RIFF fileformat).
We are used to see PCM sampled audio, but even in the beginnings it could contain other formats, like ADPCM audio.
As such, the header can indicate values that don't apply to all kinds of sampled audio.

Bytes per sample is about the bytes on the file that represent a sample. 2 and 3 are usual, but so is 4, either for float audio or simply for 24bits padded to 32bits for better operation with the cpu.

The byte rate is more about lossy formats, since it's the rate of bytes per second that will be read, to decode them to uncompressed audio.

Anyway, you shouldn't change the header if you don't understand the header

Re: How can I get into a wav/flac file to change the sample rate?

Reply #13
You should remember that WAV is a container (a specific case of the RIFF fileformat).
We are used to see PCM sampled audio, but even in the beginnings it could contain other formats, like ADPCM audio.
As such, the header can indicate values that don't apply to all kinds of sampled audio.

Bytes per sample is about the bytes on the file that represent a sample. 2 and 3 are usual, but so is 4, either for float audio or simply for 24bits padded to 32bits for better operation with the cpu.

The byte rate is more about lossy formats, since it's the rate of bytes per second that will be read, to decode them to uncompressed audio.

Anyway, you shouldn't change the header if you don't understand the header
Thank you for the explanation, Jaz. :)  In fact lately I am doing a experiment which is to interpolate old 16bit CD-ripped files into 24bit using the “secret rabbit code”plugin on foobar2000 which includes a  Sinc Interpolator calculating in 24bit field. what i do is first raise the sampling rate to crazy 44.1k*256 Hertz(the highest ratio supported) then downsample it back to 352.8khz. I’m sure it has positive effects on signal/noise ratio and details in sound, which can be heard by ear very obviously.
Now i wanna push it to the limit, so i put in the 352.8khz file and give it another 256 times upsampling and downsampling. Unfortunately foobar2000 won’t support sampling rate over than 20mhz, so i decide to alter it to fake 44.1khz, after the process i’ll speed it back to 352.8khz.


Re: How can I get into a wav/flac file to change the sample rate?

Reply #15
Quote
I’m sure it has positive effects on signal/noise ratio and details in sound, which can be heard by ear very obviously.
A properly up-sampled file will sound identical to the original.   Nothing should be added or subtracted.   There are more straight-forward ways to alter or "improve" sound (i.e. EQ, or other effects). 

If you are altering the sound (especially in unknown ways) some people may consider it an improvement and some people may consider it worse.

Plus, there is nothing "wrong" with "CD quality".   You can downsample a high-resolution file to 16/44.1 and it will sound identical to the original in a scientific-blind ABX test.   

...A good quality MP3 can often sound identical to a high-resolution original, or it can be very-hard to hear the difference (in a proper blind listening test).


Re: How can I get into a wav/flac file to change the sample rate?

Reply #17
Thank you for the explanation, Jaz. :)  In fact lately I am doing a experiment which is to interpolate old 16bit CD-ripped files into 24bit using the “secret rabbit code”plugin on foobar2000 which includes a  Sinc Interpolator calculating in 24bit field. what i do is first raise the sampling rate to crazy 44.1k*256 Hertz(the highest ratio supported) then downsample it back to 352.8khz. I’m sure it has positive effects on signal/noise ratio and details in sound, which can be heard by ear very obviously.
Now i wanna push it to the limit, so i put in the 352.8khz file and give it another 256 times upsampling and downsampling. Unfortunately foobar2000 won’t support sampling rate over than 20mhz, so i decide to alter it to fake 44.1khz, after the process i’ll speed it back to 352.8khz.

I also have strong doubts of positive effects of this kind of digital cooking.
But if you really appreciate to play with resamplers, give a try to HQplayer:
Quote
Features:
• Software upsampling / downsampling with selectable algorithm up to 32-bit 1.536 MHz or down to 8-bit 32 kHz PCM (30 options, most "apodizing")
• Delta-Sigma modulators for upsampling PCM/DSD content up to 98.304 MHz 1-bit SDM (12 modulators, 32 PCM oversampling options and 2 DSD rate converters)
• Selectable dithering / noise shaping algorithm (9 options)
• Selectable convolution algorithm (FIR) for equalization, such as digital room correction (2 options), for PCM/DSD content
• Optional high-frequency expansion for the convolution engine
• Parametric equalizers for PCM/DSD content
• Software-based digital volume control for PCM and SDM (DSD)
• Playback of DSF/DSDIFF files through any supported audio interface (PCM conversion and DSD rate conversion)
Selectable algoritm and noise filters for DSF/DSDIFF PCM playback (11 / 8 options)
• Native/direct playback of DSF/DSDIFF files (ASIO DSD, DoP v1.1 with both 0x05/0xFA and 0x06/0xF9 markers)
[…]
Resampling filters:
• 15 linear phase
• 2 intermediate phase
• 8 minimum phase
• 3 impulse optimal
• 3 closed form
Dithers and noise-shapers:
• 4 dithers
• 5 noise shapers
Delta-Sigma conversion:
• 12 modulators
• 32 oversampling filters (64x - 2048x)
• Direct rate conversions, 2 algorithms
[…]

Therefore you can increase the incredient of magic audio cooking, and convert a poor 44100/16 to a cyclopean 98.304.000/1 bit or to 1.536.000/32, mixing noise shaping formulas, dithering algorithms and many other stuff… The player also supports CUDA and I'm pretty sure it's necessary (I read that some users must convert their CD overnight to read them the day after…).

Only problem: audiofoolery has a cost and it's not only the electricity bill. To enable all feature the software player costs ~2800 €/$. The common version is only 250 €/$. foobar2000 is much more proletarian in comparison  ;D

You can also save a lot of money and energy with Black Friday ABX tests :)
Wavpack Hybrid: one encoder for all scenarios
WavPack -c4.5hx6 (44100Hz & 48000Hz) ≈ 390 kbps + correction file
WavPack -c4hx6 (96000Hz) ≈ 768 kbps + correction file
WavPack -h (SACD & DSD) ≈ 2400 kbps at 2.8224 MHz

Re: How can I get into a wav/flac file to change the sample rate?

Reply #18
I read that some users must convert their CD overnight to read them the day after…
That part actually resembles something that has at least theoretical merit (although I'm not gonna find any of my troublemaking silver discs from late-noughties ripping session to do TOS8 compliant test): secure ripping can improve over CD playback. Because CD playback faces the constraint of realtime.
(Eat that, you physical-media-is-closer-to-the-source audiophools.)

Re: How can I get into a wav/flac file to change the sample rate?

Reply #19
Let’s look this way. i’m gonna give an example,
Mosaic removal algorithm is developing these years.
One of the best known applications is the Javplayer(ya know what i’m talkin:) ) Which is not any sort of AI edge-cutting technology but a re-sampler in a high scale ,multi-frame field and then downsample back to regular resolution.(thus, it can burn up your cpu and graphic card)
Hypothetically, 16bit CD audio is sampled in quite a “Mosaic”way , meaning that the poor 16bit comparing to the original ∞-bit analog source is too little. when the source has way more resolution than the sampled destination, it is a “undersampling”.  Likewise, if we rescale a high resolution image into a low one, there is some redundant sharpness in between the pixels. (That’s the ingredients to “recover” gals’ kitties in mosaic. Or you won’t get a chance to see them :)
Back to CD audio, Sinc interpolator is a proper way to recover those “redundant sharpness” in between the samples and make it closer to its analogue source.
Yes ,there will be some artifacts  ,but compare to the resolution  we gain, it’s worthy.

Re: How can I get into a wav/flac file to change the sample rate?

Reply #20
i’ll upload a 16bit-raw and a 24bit-cooked version of one song next week for you guys to compare.  It’s still converting. :)

Re: How can I get into a wav/flac file to change the sample rate?

Reply #21
That part actually resembles something...
 
 
Assuming the basics are there hardware-wise at the PC, including proper playback software, using better speakers is the first thing to do.  Or better headphones.  Spending effort doing anything else is called doing a Julie-on-e.

I read nothing else in this topic but the quoted.  And this.  And so it remains.
BANNED

Re: How can I get into a wav/flac file to change the sample rate?

Reply #22
That part actually resembles something...

 
Assuming the basics are there hardware-wise at the PC, including proper playback software, using better speakers is the first thing to do.  Or better headphones.  Spending effort doing anything else is called doing a Julie-on-e.

I read nothing else in this topic but the quoted.  And this.  And so it remains.


i got nice headphone and a 32bit ess9028pro based dac, should be qualified to compare 16bit and 24bit audio.
even a Realtek onboard sound card can tell that difference.
when you play 8bit game music on a high-end system, it won't give you 32bit resolution.
In fact ,there’re few more bottlenecks out there, not only one. Aside from the quality of the speaker and analogue circuits and so on ,the poor 16bit resolution is one of them. You just CAN’T get a super lively sound over a 16bit system, other than the 96db dynamic range and some other digital benefits. That’s why we’ve been quarreling since 1980s on the “CD vs Vinyl”debate.

Re: How can I get into a wav/flac file to change the sample rate?

Reply #23
when you play 8bit game music on a high-end system, it won't give you 32bit resolution.
8-bit as in what?  Sample formats of old PC games or actual consoles like the NES that had very limited hardware synthesizer capabilities?

You just CAN’T get a super lively sound over a 16bit system
This is basically a TOS8 violation here.  Care to describe this lively sound that 16-bits per sample can't do?

Re: How can I get into a wav/flac file to change the sample rate?

Reply #24
when you play 8bit game music on a high-end system, it won't give you 32bit resolution.
8-bit as in what?  Sample formats of old PC games or actual consoles like the NES that had very limited hardware synthesizer capabilities?

You just CAN’T get a super lively sound over a 16bit system
This is basically a TOS8 violation here.  Care to describe this lively sound that 16-bits per sample can't do?

could you tell me what is a TOS8?