EXT_vorbis on OSX

Member
Posts: 257
Joined: 2004.06
Post: #16
Skorche Wrote:After a bit of fiddling, I came up with a quick solution using SDL timers to implement the devmaster code. All you need to do is call ogg_stream_play() and ogg_stream_stop(), the updating is handled automatically. I set the buffer size to 100ms and the timer to update every 30ms.

download link

I'm trying to use this in my project; however, it's all C++ so the code, as is, fails to link. I tried a couple different ways of using extern "C" {} to get it to link but none of which have been successful. Anyone have any ideas on getting it to work?

Edit: Whoops, I should point out, the project is all C++ while Skorche's ogg code is in C.

The brains and fingers behind Malarkey Software (plus caretaker of the world's two brattiest felines).
Quote this message in a reply
Sage
Posts: 1,482
Joined: 2002.09
Post: #17
Malarkey Wrote:Edit: Whoops, I should point out, the project is all C++ while Skorche's ogg code is in C.

Just get the original code from the site, I had to convert it from C++. Wacko All I did is make an SDL timer that calls the 'update' function, and fiddle with the buffer size and wait times. It shouldn't be too hard to follow.

Also, I'd like to point out that you should fiddle with them more. It streams the music from a file, which will sometimes take longer that 1/10 of a second. Or convert it to use the custom ogg streaming functions. Also, the stop/restart code isn't very thorough, and fails to stay buffered sometimes.
Quote this message in a reply
Post Reply