I use java sound (with VorbisSPI and Jorbis) for OGG playback using a SourceDataLine to play a byte array. The problem is that at the end of playback of any sound, there is always a kind of "pop" noise. And I can assure you that I doesn't stop or flush the line before playback ends. This noise makes sound not really good.

What's weird is that even when I test the OGG using a Clip object, the same problem occurs and you know that I can't control line feeding in this situation so it shouldn't be a buffer underrun/overflow problem.

One interesting thing is that when I test the same sound but in the wav format then the problem simply disapear.

So my guess is that the problem seems to be in either VorbisSPI or Jorbis.

Any help or ideas would be greatly appreciated otherwise the playback isn't great.

If the sample doesn't end with 0, the result would indeed be little pop (abeit usually a small one) and it's generally better to *always* have samples end with 0 like Cas described. This is not a patch, it's just good practice.However, I guess you'd have the same problem with the wav version if a non-zero value at the end would be the cause.Did you create the ogg from the wav file or the other way around (the latter to test the wav output)? Does the ogg sound correctly in any other ogg player?Could you post the source?

Actually if I play the OGG in Winamp everything is fine (no pop at the end) so to me it's not a fading issue. And I have to say that I've already faded out the OGG at the end to prevent this problem. In summary eveything seems to be ok but the problem still persists. And yes the playback of the wav is always good. Anyway here is the source code: I have an entity class (StreamedSound which extends AbstractSound) that holds the data and has the capability to render it and another class to control playback (Player).

Well, as we cannot look into winamp's sourcecode, im quite surethat winamp will do a fadeout by itself. At least winamp 0'sthe last byte it plays - this is not hearable even in a samplerateof 8KHZ. I do not know why you flood the forum with you code, simplewrite a small testcase for your needs - and judge for yourself.

Yes, I asked for the source although the source is a bit larger than what I hoped for . Sorry for not having replied yet (I'm a bit busy these days), but as far as I could tell there's no main method in there so if you could add a little test case (preferrably with a test sound uploaded somewhere) that would help a lot given my current time constraints.

Just found that image, while skimming through my hdd (searched something completely different). Well, thought it's cool as visualisation thingy. The transparent line in the middle should have been black... oh well... but I guess it's still ok, since this post is going to end up on a dark stripe

Yes, I asked for the source although the source is a bit larger than what I hoped for . Sorry for not having replied yet (I'm a bit busy these days), but as far as I could tell there's no main method in there so if you could add a little test case (preferrably with a test sound uploaded somewhere) that would help a lot given my current time constraints.

java-gaming.org is not responsible for the content posted by its members, including references to external websites,
and other references that may or may not have a relation with our primarily
gaming and game production oriented community.
inquiries and complaints can be sent via email to the info‑account of the
company managing the website of java‑gaming.org