1

I have a .spx file (an Ogg file with Speex-encoded audio). I would like to use Java to pull the Speex-encoded bytes out of the Ogg container.

The problem is, it seems all of the Java libraries I can find (JSpeex, JOrbis) are written with the assumption that I would also like to decode the audio into raw pcm, which I do not.

Is there a generic Ogg format reader library out there for Java? On the other hand, is it possible to use parts of JSpeex or JOrbis to do what I want?

Beso
  • 1,176
  • 5
  • 12
  • 26
paleozogt
  • 6,393
  • 11
  • 51
  • 94

2 Answers2

1

I could not find an Ogg library in Java after some shallow searching.

But if you are willing to implement Ogg parsing from scratch, the words straight from the horse's mouth are readily available:

(Top page: https://www.xiph.org/vorbis/doc/)

Nayuki
  • 17,911
  • 6
  • 53
  • 80
0

I have not worked with Ogg file with Speex-encoded audio but once I have worked on a use case where I wanted to extract opus packets from ogg opus file, without being decoded to pcm audio. You can find that solution in this answer

https://stackoverflow.com/a/65320789/10110652

This piece of code also works for ogg file with vorbis encoding, so may be this might help with speex encoding as well. Do let me know if this works for you.

Happy Coding!!!❤

Krunal Patil
  • 41
  • 1
  • 8