Virtual DJ Studio Home | NGWave Home | Official Facebook Page | Unofficial VDJ Users Group

Author Topic: Windows Resampling...  (Read 12169 times)

Offline Justin

  • Site Administrator
  • Administrator
  • Hero Member
  • *****
  • Posts: 951
  • Karma: 11
    • View Profile
    • Virtual DJ Studio
Windows Resampling...
« on: August 02, 2013, 01:06:21 AM »
As I'm working on NGWave, it comes to my attention once again that Windows, for some stupid reason, re-samples all audio to 48 kHz. This is just plain stupid, since most of our music comes from CDs which are always 44.1 kHz. What's the big deal you ask? Well, for one Windows' built-in re-sampling is of poor quality. And since 99.9% of our music originally was recorded at 44.1 kHz, we end up with this tone, audible mostly during low-frequencies. Attached is a 3900 Hz tone you might recognize.

Whenever a low bass tone is played, you will hear a phenomenon known as "aliasing", due to Windows re-sampling the audio from the original 44.1 to 48 kHz, and what you'll hear is that 3.9 kHz tone. This has been an issue since Windows XP...

Unfortunately there is nothing I can do on my end to fix this. They do this because some people, perhaps 1% of Windows users, might be using an optical/digital coax connection to their sound system that requires a 48 kHz sample rate. The rest of us just have to suffer with this 3900 Hz artifact thanks to Microsoft deciding what sample rate we all need to use.

Just another thing, among many, I've discovered while working on the next NGWave version...


[attachment deleted by admin]
-- Justin Nelson, CEO
   Next Generation Software, Inc.
   http://www.vdj.net/

Offline Justin

  • Site Administrator
  • Administrator
  • Hero Member
  • *****
  • Posts: 951
  • Karma: 11
    • View Profile
    • Virtual DJ Studio
Re: Windows Resampling...
« Reply #1 on: August 02, 2013, 01:17:41 AM »
Just to point out some of my own flaws, I got an error message in my own program tonight. You see, I've been opening file after file, for testing purposes, in NGWave, never once actually closing a file. Then, I received this error message I wrote probably 11 years ago saying that I can only have 40 sound files open at one time.

So of course I bumped the limit up to 64, hoping that would be enough :)  The program handles a ton of files open at the same time with no problem - the limit was only imposed to keep from using all your RAM (again, back in '02)... NGWave handles this quite well, and there is no theoretical limit to how many files can be loaded up at once, since it doesn't store the files in RAM.

Under normal circumstances of course you would most likely never have anywhere near 40 audio files opened at the same time for editing. But it's nice to know that you *could* have 40, or 64, open and ready to edit... :)

I'll be pushing a limited BETA out tomorrow (Friday) for feedback, ideas, opinions, etc. Those who participate will receive a free license for the 5.0 version when it is released. I first want to fix some issues where it uses entirely too much CPU time when playing audio - same issue I had with VDJ when Win 7/8 came around. Just some things I have to rewrite to please the all-mighty Gates :)

Stay tuned... I think I need some sleep, haven't closed the computer in quite a few hours...
-- Justin Nelson, CEO
   Next Generation Software, Inc.
   http://www.vdj.net/

Offline Fabio

  • Administrator
  • Hero Member
  • *****
  • Posts: 757
  • Karma: 11
    • View Profile
Re: Windows Resampling...
« Reply #2 on: August 02, 2013, 06:57:47 PM »
Well, I 'm not sure I've heard it before...but for the record I will eventually have to give up on the hosting thing...deafness runs in my family, a lot of my uncles and aunts on my father's side of the family are nearly deaf...my father can still ok...not perfect but well enough...but he's the youngest...I'm hoping I got my mother's side...anyway, this was a long way of saying that I'm probably not the best judge of sound  :-[

Quote
Just to point out some of my own flaws...

Justin...I'm glad we're not the only infallible ones around here  :P
Fabio Q.
Shooting Star Karaoke

Offline Justin

  • Site Administrator
  • Administrator
  • Hero Member
  • *****
  • Posts: 951
  • Karma: 11
    • View Profile
    • Virtual DJ Studio
Re: Windows Resampling...
« Reply #3 on: August 12, 2013, 08:22:12 PM »
Quote
...but for the record I will eventually have to give up on the hosting thing...deafness runs in my family

I have been having the same problem in recent years... don't know if it's from the speakers being close by, or just age, but my hearing is certainly not what it used to be...

But what I have found, through a little Googling, is that this is not unique to me... the aliasing (the 3900Hz tone I hear) is very common. It used to be, you could set your sound card to output at the sample rate you wanted. Now, Windows makes that decision for you. Even as a software developer, I have no control over that. I can request and output a specific sample frequency, and according to the operating system all is well. But in reality, Windows is taking my sample rate and resampling it to whatever it feels is appropriate, even if it is not.

We (software programmers) used to have some bit of control of the hardware, or at least some bit of feedback. Now, Windows emulates the hardware, and our software just has to believe what Windows tells us.

So in short, I open the sound card at 44100 Hz sample rate, and Windows says "OK, you got it". But in reality, Windows is accepting my 44.1 audio and, internally, resampling it to 48 kHz or whatever, without telling me. So my software sounds as good as Microsoft's resampling routines, which, in most cases, sucks ass... and it doesn't bother to tell my application that this is happening, or that it would prefer a specific sample rate which I could accommodate. Instead, it decides that Microsoft knows best, and will lie to my application and proceed to "fix" my audio.

I never had this problem on Linux, BSD Unix, or the Mac platform. Unfortunately if you want to make money selling software, you have to accommodate Microsoft Windows, each version that comes out, with all the new "features"... but I digress........
-- Justin Nelson, CEO
   Next Generation Software, Inc.
   http://www.vdj.net/

Offline Justin

  • Site Administrator
  • Administrator
  • Hero Member
  • *****
  • Posts: 951
  • Karma: 11
    • View Profile
    • Virtual DJ Studio
Re: Windows Resampling...
« Reply #4 on: August 18, 2013, 06:55:46 PM »
Just to bump this up, and update everyone, this issue has been resolved. Since Windows resamples our audio to 48 kHz using a crappy algorithm if the audio is not passed at 48 kHz, VDJ now does a much nicer resample of its own, and passes that directly to Windows.

The 3900 Hz tone is GONE! Where you notice it most (in my testing) is the beginning of Psy - Gangnam Style (because of the low-pass at the beginning, the high-frequency aliasing really comes through). When Virtual DJ Studio 7.0 comes out, it will sound much cleaner, if your ears noticed this at all...

It actually uses the exact same resampling algorithm as the Pitch slider (not key adjust or tempo), which has been time-tested for over 10 years and works without aliasing of any kind.

I'm sure most of you haven't noticed it, but it's been an annoyance of mine for a few years now and I've finally done something about it :)
-- Justin Nelson, CEO
   Next Generation Software, Inc.
   http://www.vdj.net/

Offline Fabio

  • Administrator
  • Hero Member
  • *****
  • Posts: 757
  • Karma: 11
    • View Profile
Re: Windows Resampling...
« Reply #5 on: August 18, 2013, 07:51:32 PM »
Wow, you figured it out!

Good to hear (pun intended!)
Fabio Q.
Shooting Star Karaoke

Offline vcationguy

  • Sr. Member
  • ****
  • Posts: 310
  • Karma: 0
    • View Profile
Re: Windows Resampling...
« Reply #6 on: August 24, 2013, 04:25:44 AM »
Excellent!!!!