Sound Recorder gives better THD+N than WMP

P

Peter Hooper

Hi,

I work for an digital audio company - I've just done some tests and thought
I'd post the results. I'd like some explanations....

1) I generate a 'perfect' 1kHz sine wave as an 8k sampled PCM. This is 8
samples per cycle. These are 0x80, 0x25, 0x00, 0x25, 0x80, 0xDA, 0xFF, 0xDA

2) If this is played back using sound recorder then I get a THD+N
measurement ( basically a measurement of what you do not want) of 0.28%

3) If I use Windows Media Player I get around 4% !!!!!!

I suspect that WMP is performing a sample rate conversion and getting this
wrong. What do you think?

--Peter
 
C

Chris P. [MVP]

Peter said:
Hi,

I work for an digital audio company - I've just done some tests and
thought I'd post the results. I'd like some explanations....

1) I generate a 'perfect' 1kHz sine wave as an 8k sampled PCM. This
is 8 samples per cycle. These are 0x80, 0x25, 0x00, 0x25, 0x80, 0xDA,
0xFF, 0xDA

2) If this is played back using sound recorder then I get a THD+N
measurement ( basically a measurement of what you do not want) of
0.28%

3) If I use Windows Media Player I get around 4% !!!!!!

I suspect that WMP is performing a sample rate conversion and getting
this wrong. What do you think?

Well your sample would be closer to perfect if it was sampled at 48kHz
16-bit, but yes, from the math perspective it is as close as you can get for
that setup.

8-bit audio most likely will get resampled to 16-bit before heading to the
sound card. Make sure the sample rate conversion quality is set to the
highest setting (is on XP by default). Control Panel -> Sounds & Audio
Devices -> Audio -> Sound Recording -> Advanced -> Performance.

In addition make sure all effects in WMP are turned off, no EQ etc.
 
A

Alessandro Angeli [MVP::DigitalMedia]

Chris said:
In addition make sure all effects in WMP are turned off,
no EQ etc.

WMP7+ cheats and inserts some audio-processing filters
before the renderer and I'm not sure you can render them
harmless even turning off everything in WMP's options.

WMP6.4 is ok instead.

In both cases, if there are third-party audio filters
installed, they are likely to get pulled in.

--

/**
* Alessandro Angeli
*
* MVP :: Digital Media
*
* a dot angeli at biosys dot net
*/
 
C

Chris P. [MVP]

Alessandro said:
WMP7+ cheats and inserts some audio-processing filters
before the renderer and I'm not sure you can render them
harmless even turning off everything in WMP's options.

WMP6.4 is ok instead.

In both cases, if there are third-party audio filters
installed, they are likely to get pulled in.

Microsoft <-- *slap* *slap* *shake finger*
 
P

Peter Hooper

8-bit audio most likely will get resampled to 16-bit before heading to the
sound card. Make sure the sample rate conversion quality is set to the
highest setting (is on XP by default). Control Panel -> Sounds & Audio
Devices -> Audio -> Sound Recording -> Advanced -> Performance.

In addition make sure all effects in WMP are turned off, no EQ etc.

I tried this... and get the same result.

What benefit do you expect to get by re-sampling - rather than playing it in
its native form? It may "sound" better because the nyquist is higher and you
get more higher component frequencies but you are just degrading the signal.

Do you work with one fixed rate in Media Player to make life easier - so you
don't have to recalculate all the coefficents for signal processing, then
just convert back on the way out?

There are many great features in WMP it would be a shame not to use it - I
don't think Sound Recorder is an option. Are Microsoft going to produce a
Media Player with an option "dont mess around with the signal please"? Or
will we have to write our own player?

I think if this and similar problems are resolved then Microsoft would make
it in the pro-audio world.

--Peter
 
A

Alessandro Angeli [MVP::DigitalMedia]

Peter Hooper said:
There are many great features in WMP it would be a shame not to use
it - I don't think Sound Recorder is an option. Are Microsoft going
to produce a Media Player with an option "dont mess around with the
signal please"? Or will we have to write our own player?

Have you tried sing WMP6.4 (mplayer2.exe) instead of WMP7+ (wmplayer.exe)?
WMP6.4 is installed even if you have a newer version. WMP6.4 is a cleaner
front-end for DirectShow than WMP7+. You can also write your own player with
a few lines of code (half a page) using DirectShow, wich is what WMP uses.
Notice also that DirectShow and thus WMP by default use DirectSound to
render the audio, while the SoundRecorder I think ses the old waveOut.


--

Alessandro Angeli

MVP::DigitalMedia

a dot angeli at biosys dot net
 
P

Peter Hooper

Just tried WMP6.4 now and it works!!!

I get the same result as Sound Recorder.

Thanks, I think I will use DirectShow then for a player. Still a pity I
cannot use the latest versions of WMP as it has all the XML/ASX support in
which is really useful for meta-data.

Thanks again,

--Peter
 
A

Alessandro Angeli [MVP::DigitalMedia]

Peter Hooper said:
Just tried WMP6.4 now and it works!!!

I get the same result as Sound Recorder.

Thanks, I think I will use DirectShow then for a player. Still a pity
I cannot use the latest versions of WMP as it has all the XML/ASX
support in which is really useful for meta-data.

What do you need exactly? WMP6.4 can play anything WMP7+ can play, including
the ASX playlists. It only lacks (I would say luckily :)) the media
library, fancy UI and effects and visualizations, which you do not want.

--

Alessandro Angeli

MVP::DigitalMedia

a dot angeli at biosys dot net
 
P

Peter Hooper

Wooo hoooo! Once again you're right. I didn't realise it had all that
functionality :)

So, lets get this right.... WMP7+ is a tarted-up-poor-audio version of
WMP6.4.... why?

--Peter
 
C

Chris P. [MVP]

Peter said:
Wooo hoooo! Once again you're right. I didn't realise it had all that
functionality :)

So, lets get this right.... WMP7+ is a tarted-up-poor-audio version
of WMP6.4.... why?


Well, yes!
All their fancy audio processing, most of which can be bypassed. There must
be something in the chain that does not have a bypass that is causing your
distortion.

Note that when using low samplerates such as yours with DirectSound
(DirectShow ultimately uses DirectSound as it's default renderer) they get
resampled to fit the form of the primary buffer. The resampling, when at
it's highest quality to a high samplerate such as 48kHz is almost
transparent but measurable. In 2K and XP resampling can occur even with
winMM (waveOut) if the low samplerate is not supported in hardware.
 

Ask a Question

Want to reply to this thread or ask your own question?

You'll need to choose a username for the site, which only take a couple of moments. After that, you can post your question and our members will help you out.

Ask a Question

Top