OpenAL crunchy noise when playing wav files

I get an annoying crunchy sound at the end of a sound when playing some wav files. I don’t notice the same crunchy noise when playing in mediaplayer or other players (Audacity). And I don’t see anything weird going on on the waveform…

what could be the problem?

I’ve tried running in different sampling frequencies (22050 and 44100… same thing)

any help would be apprecieated.

Hmm. “Cunching” sounds like bad data at the end of the wave form,

Im not an OpenAL expert so someone else maybe able to help you better.
Soem thigns to check thopugh are: (1) Does OpenAL expect your wave form to be of a size that is an even multipel of some number (often 2K in other audio systems Ive worked with)? If so you might need to pad the end. (2) Are you sure al lthe data is getting laoded and loaded proeprly before you play it?
(3) Are there any sample JOAL apps that you can play your data through to see if they play it correctly?

Is it possible to post the wav file and/or the code you’re using?

Kev

Link to a sound that you hear noticable “crunch” (listen carefully)… don’t get crunch in media player… only from playing in lwjgl/OpenAl…

http://hem.bredband.net/rashog/shockwave_spawn%20org.wav

Just playing it in one of the tutorials on the OpenAL in enough.

My code is with some small modifications (to allow for many sounds using the same buffers) pretty much the same…

A link to the tutrials… just modify to load my sound… (or rename my sound…)

http://lwjgl.org/documentation_openal_01.php

I notice this “crunching” on most sounds… even those in the tutorial… but not when playing in media player… listen carefully… (when you know it’s there it’s pretty noticeable and annoying…)

My friend says that on his computer he cannot hear the crunshy (or it’s more like clicks) sound… and he’s been here and listen to how it sounds here… so he knows what he’s listening for.

So maybe (and hopefully) it’s just my computer. Just think it’s weird that I get it from playing the files with openAl and not in mediaplayer and stuff…

I know you can get a ‘click’ at the end of playing a waveform, if it doesn’t fade to zero. Media players tend to implement a fade out which hides this. Load up the waveform in Audacity & check the end of the waveform.

Also, if you’ve used Audacity to convert file formats, sometimes it tags a large blank bit on the end, which needs to be trimmed off.

Lastly you can get crappy sound if you’ve got a big-endian problem, although that it noticeable throughout the sample.

the waveform does fade out to zero… so that shouldn’t be a problem.

This big endian problem… how much would that affect the sound? Is there away to check if big endian problem is the case?

It could be related to how you are playing back the sound… what happens in the code after the sound plays? Is there any reseting of audio lines or some such thing that might account for a “pop” ?

I only got endian problems when synthesising my own sounds and streaming the bytes into a Clip. So this could only really happen if you are fiddling about with streaming the sound yourself. The sound was ghastly.