Jump to content
  • Advertisement
Sign in to follow this  
UriKiller

Weird noise while playing a sound

This topic is 4727 days old which is more than the 365 day threshold we allow for new replies. Please post a new topic.

If you intended to correct an error in the post then please contact us.

Recommended Posts

Hello, I'm using Microsoft Visual C++ 6.0. I did a simple application that plays a sound on the soundblaster using waveOutWrite (). Each time I play the sound there is a weird annoying and short noise (sounds like the zz in pizza) and I have no idea why it happens. the format of the sound is: 16 bits per sample (short). 4.1khz (nSamplesPerSec = 41000). the wave format is WAVE_FORMAT_PCM. 1 channel. Here is how I fill the wave data buffer for playing: for (i = 0; i < wavelen; i++) { wavedata = sin (i * 2 * PI * frequency / nSamplesPerSec) * 30000; } After that, I called waveOutPrepareHeader () and then waveoutWrite (). I heard the weird sound clearly when frq was about 250. Does anyone have an idea why this happens?

Share this post


Link to post
Share on other sites
Advertisement
This is a long shot but the sound might be due to the non-standard sampling frequency of yours. I guess your sound card uses natively 44100Hz or 48000 (Live). 41000Hz requires one to convert the sound from one format to another. The quality of this conversion might not be really good (at least SB Lives conversion isn't, it uses 8 tap FIR-filter). So change the sampling frequency to 44100 or 48000.

Share this post


Link to post
Share on other sites
Sign in to follow this  

  • Advertisement
×

Important Information

By using GameDev.net, you agree to our community Guidelines, Terms of Use, and Privacy Policy.

Participate in the game development conversation and more when you create an account on GameDev.net!

Sign me up!