Advertisement

Ogg Vorbis Playback

Started by January 03, 2002 04:49 PM
5 comments, last by Fresh 22 years, 10 months ago
I''ve got the ogg vorbis sdk now, but my tired brain cannot figure out how to playback vorbis files. I''m sure there''s drag ''n drop code somewhere in the sdk, but I can''t find it - I must be even lazier than I thought. Does anybody have, or know where to find drag and drop vorbis playback for win32 ? r. "The mere thought hadn''t even begun to speculate about the slightest possibility of traversing the eternal wasteland that is my mind..."
If you''re using the VorbisFile part of the API, look at this page.

[Resist Windows XP''s Invasive Production Activation Technology!]
Advertisement
But how do you then get that to play under directsound, say ?
I actually have a .dll designed for the loading/streaming playback of .wav/.ogg/.mp3. You are welcome to download the
.dll here:

Wavecast DLL

This should give you the idea in how to stream the playback through dsound, cause that is the method it uses for playback. It''s just a DLL with no example, but all you need to do is call:

wcInit(HWND w);

then call:

wcStream(LPSTR FileName);

and you should be fine. The rest you can figure out. (btw the upload of the .zip won''t be done until about 10 am EST)

Ranger

What''s the license like on that ?
Could you sell a game with the wavecast dll ?
I can''t seem to find it anywhere else...

I''m still wondering how to take what the vorbis decoder puts in the pcm buffer and put that in a dsound streaming buffer for example, or any other way to play it...
I don''t know how to do it with DirectSound. However, with OpenAL you use a single sound source and queue multiple buffers to it. I run a loop in another thread that adds another buffer everytime only 1 buffer is left in the queue. When it reaches EOF the thread kills itself. I wrapped all of that into a nice class so that I don''t have to worry about it anymore .

[Resist Windows XP''s Invasive Production Activation Technology!]
Advertisement
Fresh- I wrote and maintain the wavecast.dll it''s part of my upcoming raycast API. However, the code in it is under the lGPL, so your free todo as you please with it. Just email with some info- if you do use it for something. I like to keep tabs =)

Ranger

This topic is closed to new replies.

Advertisement