Bluish Coder

Programming Languages, Martials Arts and Computers. The Weblog of Chris Double.


2007-03-19

Ogg Vorbis support for Factor

I've implemented Ogg Vorbis playback in Factor. The library is in the module 'libs/vorbis' and supports playing Vorbis encoded audio from .ogg files and streams:

"test.ogg" play-vorbis-file
"http://www.bluishcoder.co.nz/test.ogg" http-get* [
    play-vorbis-stream
] keep stream-close

The audio is played back using the OpenAL wrapper I wrote last month.

Some example Ogg Vorbis files are available at the Vorbis site.

I've been testing the library against a test.ogg file which contains Vorbis audio and Theora video. Currently the Factor library only plays back the Vorbis audio stream but I plan to get to Theora playback eventually. I converted test.ogg from the original Windows Media format file of James Hill playing Allegro con brio on the Ukulele.

You'll need libraries for Ogg and Vorbis installed. I've packed precompiled DLLs for Windows in oggdlls.zip

The playback yields timeslices while decoding and playing to allow other Factor threads to run. I'm able to play music, streamed from the Factor httpd server, while playing Factor Space Invaders all from the same Factor instance quite nicely.

Tags


This site is accessable over tor as hidden service mh7mkfvezts5j6yu.onion, or Freenet using key:
USK@1ORdIvjL2H1bZblJcP8hu2LjjKtVB-rVzp8mLty~5N4,8hL85otZBbq0geDsSKkBK4sKESL2SrNVecFZz9NxGVQ,AQACAAE/bluishcoder/-44/


Tags

Archives
Links