Any Easy Way To Change Sample Rate? (In Windows 7)

MrMuppet

Senior member
Jun 26, 2012
474
0
0
So, when watching movies I obviously want 48 kHz and just as obviously I want 44.1 kHz when listening to music. Is there any quick way to switch between the two sample rates? A shortcut or a batch script or something?

I don't want to use WASAPI output in Foobar2000 as I don't want to give any one program exclusive access (I want to be able to hear other sounds/audio sources even when listening to music).

Any ideas?

Oh, and it's for the HDMI out btw and not the X-Fi (whose master rate stays at 44.1 kHz at all times).
 

mikeymikec

Lifer
May 19, 2011
19,927
14,177
136
I'm confused. Won't the sound hardware do this for you automatically? Otherwise 11/22KHz audio would sound like The Chipmunks have come to town...
 

Fardringle

Diamond Member
Oct 23, 2000
9,200
765
126
Sample rate is determined when the audio file is created. Your computer will automatically play the audio back at whatever sample rate the file is using. You can change the sample rate in an existing file if you simply need it to be a different format to fit the requirements of a device (an MP3 player that can only do certain file types/formats for example) but it's not going to improve the sound quality and very likely will make it sound worse since you are modifying the file without access to the original sound source.
 

MrMuppet

Senior member
Jun 26, 2012
474
0
0
No, it doesn't. You need to use WASAPI for it to do that. That's problem. It's annoying having to enter the audio device properties all the time.

If you play 44.1 kHz content with your playback device set to the standard 48 kHz, the Windows audio mixer will resample the audio to 48 kHz. This is a lossy process introducing artifacts, clipping could even occur, and the Windows resampling algorithm is said to be pretty poor (then using a resampler DSP in Foobar2000 would be a much better option, but still not optimal).

How can you not be aware of this?

samplerate.png
 
Last edited:

Fardringle

Diamond Member
Oct 23, 2000
9,200
765
126
To answer the question, that setting you are looking at is only used when Windows is in 'shared' audio mode. That only happens when multiple different applications want to use the audio device at the same time with different audio streams at different sample rates. If that unlikely event happens, THEN (and only then) Windows will take the setting from that screen you posted and resample all audio streams to the same sample rate so that they can be played back simultaneously. If you are not playing multiple audio streams at the same time, then the sample rate is set by the audio source and not by Windows. An exception to this is if the audio playback program you are using forces resampling instead of using the default settings of the file, and if it is doing that then I suggest getting a new program (or hopefully finding a setting in the program to disable it).
 

MrMuppet

Senior member
Jun 26, 2012
474
0
0
Wouldn't it be running in "shared" audio mode whenever it's not running in "exclusive" audio mode (which WASAPI enables)?

Say, when using default DirectSound output in Foobar2000 (without the optional WASAPI component)?

edit: It "feels" slightly snappier, more dynamic, and "vibrant" (I really don't know how to describe this stuff) when using 44.1/24-bit than 32/16-bit, though it may be placebo. Would need to ABX somehow hmm, but how?
 
Last edited:

MrMuppet

Senior member
Jun 26, 2012
474
0
0
And if that setting doesn't really matter, why does changing it reinitalize the audio even though Foobar2000 is my only audio source atm and "shared" audio mode shouldn't be used anyway?

Did you type this while holding your nose as high as possible?
So, what's your issue anyway? :confused:
 
Last edited:

MrMuppet

Senior member
Jun 26, 2012
474
0
0
I'm not sure what type of sources you're looking for.

But here it says:

"With Vista a new audio architecture was introduced.
The default (Direct Sound) sends all audio to the mixer.
In the audio panel you specify sample rate and bit depth.
All audio not having this sample rate is resampled to match this setting.
If your audio collection is mixed, you won’t have automatic sample rate switching with DS."


http://www.thewelltemperedcomputer.com/KB/DirectSound.htm


And here too it says that DirectSound is resampled in Vista:

http://thewelltemperedcomputer.com/Lib/OperatingSystemsHandlingOfSampleRates.pdf


I have never seen or heard anything indicating that audio is not resampling by Windows' mixer when not in "exclusive mode".


edit: More from the same site:

"Any stream not having the default sample rate as set in the Win audio panel, has to be converted before it is send to the mixer.
Another reason to apply sample rate conversion is a mismatch between the sample rate of the source and the sample rate(s) supported by the hard ware.
E.g. you play a CD but your sound card only supports 48 kHz (the cheap ones do); you downloaded some 24 bit/176 kHz recordings but your sound card supports 24 bit/96 kHz max.
Sample rate conversion must be done by the application sending audio to the mixer.
This can be the SRC as supplied by Win or one supplied by the application."


http://www.thewelltemperedcomputer.com/SW/Windows/Win7/Win7Audio.htm


I think that's where I got it from actually (either that or HA), although it seems like the intuitive thing too.
 
Last edited:

theevilsharpie

Platinum Member
Nov 2, 2009
2,322
14
81
I hear absolutely no difference between using the proper bitrate and an upscaled bitrate, and I'm using headphones that make even the smaller audio artifact apparent.

Perhaps this is a problem that is specific to certain sound cards, but I'm going to join in with the others: don't worry about it.
 

Zorander

Golden Member
Nov 3, 2010
1,143
1
81
I'm sure that Default format thingy is simply what Windows will default playing a sound at if it receives no specific instruction on how to play that sound, i.e. if your media file has a specific output type (e.g. 48000Hz) and your soundcard is capable of playing it, it will play it as such. Outside a software resampler, Windows should not forcibly resample to that one particular default format.

Have you tried using ReClock with your media player? In addition to enabling you to use WASAPI (instead of DS or WaveOut), you can also play around with many other settings, including output frequency.

Regards.

Edit: This whole resampling thing was happening back in the AC97 days (no 44.1KHz playback, hence automatic resampling to 48KHz). Assuming you're not forcibly resampling everything to 44.1KHz with a software resampler, your movie playback should play at the specified frequency and bitrate.
 
Last edited:

MrMuppet

Senior member
Jun 26, 2012
474
0
0
You claiming not to hear a difference doesn't say much. It's not that easy to even differentiate between properly resampling to 32 kHz and using 44.1 kHz bitperfect. And you should be listening to lossless sources obviously (if nothing else to avoid the high frequency cut-off). (Differences should be emphasized for very high frequency, the Nyquist rate and all that.) But some people want it "right" regardless, it makes it "feel" better and improves the experience (placebo or not).

I listen using headphones too btw (DT-770).

Oh, and it's not bitrate we're talking about here, it's sample rate. Upscaled bitrate would make no difference for lossless, but actually improve the quality of lossy floating-point sources (like MP3, by virtually eliminating rounding errors without having to add noise to dither).

---

What makes you so sure?

It's the Windows Mixer doing the mixing and software resampling (one way or another) in this case. Not the soundcard.

If you have a crappy soundcard with a fixed internal sample rate, audio could be resampled twice (first by the Windows Mixer to say 44.1 kHz and then by the shoddy soundcard to say 48 kHz).

Yes, I use ReClock, however I don't want to use WASAPI Exclusive. (Because it's exclusive.)
 
Last edited:

theevilsharpie

Platinum Member
Nov 2, 2009
2,322
14
81
Oh, and it's not bitrate we're talking about here, it's sample rate. Upscaled bitrate would make no difference for lossless, but actually improve the quality of lossy floating-point sources (like MP3, by virtually eliminating rounding errors without having to add noise to dither).

I misspoke, I meant the sample rate. I nominally keep it set at 96KHz, but I tested it with 48KHz and 44.1KHz, and despite testing several different tracks (MP3s and a few 44.1KHz FLACs), I wasn't able to determine any difference between Winamp using the built-in DirectSound output and Foobar2000 using ASIO, regardless of what sample rate I used.
 

mikeymikec

Lifer
May 19, 2011
19,927
14,177
136
So, what's your issue anyway? :confused:

If someone came up with the correct (although this is largely irrelevant) answer and said to you "how can you not know this?", I think you or most people in your position would (IMO, rightly) think that the other guy is acting like a bit of a superior prick about it, especially since the reason for the thread is that someone is asking for help.

It would be a different story if someone started a thread as advice for everyone else about how to do xyz, they get a key point wrong and won't admit it when it is (politely and constructively) pointed out, then "how can you not know this?" is completely appropriate (provided that the person saying it isn't talking out of their ass).
 
Last edited:

MrMuppet

Senior member
Jun 26, 2012
474
0
0
It was not meant to be perceived as rude, I was just honestly surprised. I'm sorry, if I offended you. Let's leave it at that. :)

So, does anyone know of a quicker way?
 

rollgibbon

Junior Member
Oct 22, 2013
1
0
0
I have a dac (Musical Fidelity M1DAC) connected to an SPDIF output from an ASUS XONAR ESSENCE STX. (redundant I know, but I had it handy and it has an SPDIF output I can use as a pass through device)

Anyway, my DAC has a row of lights indicating different sample rates (32khz, 44.1khz, 48khz, 88.2khz, 96khz, and 192khz).

To verify what mrmuppet said, The windows Sound Default Format options that he posted a picture of are the only thing that I have found that actually changes the outgoing sample rate. I found this old thread looking for a way to do exactly what mrmuppet was asking several years ago.

Mrmuppet is right.

I have had this dac for around 3 years. I have low and high sample rate music that I listen to in a listening room with a cambridge audio azur 640a v2 amp and a pair of paradigm atom v.6 speakers.

It is audible to me when this setting is changed to 192khz for 192khz recordings vs. 44.1khz in the form of deeper soundstage and more accurate/defined soundstage.

dug this thread up.... mrmuppet you ever find a solution?
 

glugglug

Diamond Member
Jun 9, 2002
5,340
1
81
I think MrMuppet is right.

But I would wager very few (like maybe 1%) of audiophiles could tell the difference between a 48kHz sample played at the native bitrate and downscaled to 44kHz. And that none could tell the difference when upscaling from 44 to 48. You could always just set your default ridiculously high to minimize any difference. My motherboard realtek audio for instance lets me select 192kHz 24 bit. The upscaling ends up losing nothing whatsoever from 48kHz, since 48 divides into 192 evenly. And assuming the most straightforward low CPU usage braindead upscaling algorithm, going from 44kHz to 192 means you mostly have a pattern where roughly 2 out of every 3 44kHz samples playing for 1/48000th of a second (4 192Khz ticks) each, with the 3rd playing for 1/38400th of a second (5 192kHz ticks). The worst transition timing from one sample to the next would be less than 3 microseconds off, which is definitely not going to be perceptible.

Edit: math, worst case is slightly worse than I thought, but still, you aren't going to hear a 3 microsecond difference in when the samples switch.
 
Last edited:

ChronoReverse

Platinum Member
Mar 4, 2004
2,562
31
91
It actually depends. There are certain places where you can hear the aliasing unfortunately and it doesn't have anything to do with audiophile ears (you can hear the effect from Youtube clips and that's far from lossless). If you have a pure tone sweeping up for instance, you'll definitely hear the aliasing from the sampling change. Most people wouldn't realize that what they're hearing isn't actually supposed to sound like that though (and would probably think it's just part of a sound effect).


Unfortunately for the OP, there currently isn't anything convenient like what you want available. The aliasing effect is less likely to be heard in things like movies though so you might as well optimize for your music.
 

Throckmorton

Lifer
Aug 23, 2007
16,829
3
0
I found this thread looking for a quick way to change sample rate.

It's not true that it gets set to whatever the application needs. Here's a screenshot playing a 96khz track in Foobar, yet the Tascam driver shows what I set it to, 44.1khz (for some reason the Tascam is always at 24 bit). And BTW it's very easy to tell when 44.1khz has been upsampled to 48khz. The sound becomes distorted. Every second 48,000 samples have to be sampled from 44,100 samples, so of course there's a quality loss. Same with going down from 48 to 44.1

samplerate.jpg