vlow's picture

Clicking noise at the end of 22kHz mono WAVs [solved]

When I use a 22kHz mono WAV file in OpenAL, playing of the file ends with a clicking noise which is definitely not part of the file. Since I loop that files, I can hear it everytime the file restarts. Is this a known issue? Am I doing something wrong? Is there some way to fix this?


Comments

Comment viewing options

Select your preferred way to display the comments and click "Save settings" to activate your changes.
Frassle's picture

There's probably a jump in the sound wave between the start and end of the file. Make sure the sound starts and ends at the same level.

vlow's picture

thank you, but that is not the case. i can loop the file whithout any problem in audacity. furthermore, i also have the clicking noise at the end of all my samples even if the samples are not looped.

Frassle's picture
vlow wrote:

i also have the clicking noise at the end of all my samples even if the samples are not looped.

Suggests you have amplitude jump at the end of the file. Audacity might be filtering the audio get rid of clicks, before playing.

vlow's picture

No, really, that's not the case: I can see the waveform of several files in several tools and there is no jump in the amplitude. I also have this problem with artificial created constant sinus waves with absolutely no change in amplitude. I even have the problem when using the provided playback example in the example browser! It also clicks at the end.

the Fiddler's picture

Try inspecting the ending bytes of the file in memory (using the debugger) and compare that to the ending bytes on disk (using a hex editor, like the one in Visual Studio.) This is to make sure the file is loaded correctly.

Frassle's picture
vlow wrote:

No, really, that's not the case: I can see the waveform of several files in several tools and there is no jump in the amplitude. I also have this problem with artificial created constant sinus waves with absolutely no change in amplitude. I even have the problem when using the provided playback example in the example browser! It also clicks at the end.

As in running the sample program you hear clicks or playing the wave file in your program you hear clicks?
Can you let us know what system (OS, sound card etc) your using as well.

winterhell's picture

Have you tried playing a different file that could have different settings, like 44.1Khz stereo?

It may be helpful to post some source code.

vlow's picture

I found out what the problem was: There is a block of metainformation at the end of most wavefiles. I had to read the length of the wavedata from the corresponding header and then read exactly that length in order to avoid the metadata being read as wavedata. Now the click is gone! :)