Advertisement

Playing MP3s in OpenGL

Started by December 08, 2003 03:55 PM
11 comments, last by PhenixDarkPhire 21 years, 2 months ago
I''m writing an app for comp-sci that, in its completed state, should be able to play an MP3. That''s it. Avoiding MFC if possible. I realize that there are a plethora or resources out there, but I just spent 30 minutes wading through the internet and found nothing but a bunch of badly written VB programs. This program also hopefully will include a visualization of some kind, so I''d rather stay away from buttons and prompts as well (ie Visual Basic-esque). Input is appreciated.
openGL is for graphics. It cannot be used to play mp3''s. What you want is openAL or fmod or directX.
Lucas Henekswww.ionforge.com
Advertisement
In Windows, DirectShow (a DirectX interface) - look for a sample within the DX SDK (available at M$ homepage).

>> lucinpub: What you want is openAL...

Ignore that - OpenAL doesn''t support streamable media interfaces. FMod or Bass are two libraries to look into, though.





"Literally, it means that Bob is everything you can think of, but not dead; i.e., Bob is a purple-spotted, yellow-striped bumblebee/dragon/pterodactyl hybrid with a voracious addiction to Twix candy bars, but not dead."- kSquared
quote:
Original post by Crispy
Ignore that - OpenAL doesn''t support streamable media interfaces. FMod or Bass are two libraries to look into, though.

You can stream audio with OpenAL in at least three ways (the standard buffer queueing method, the Loki callback extension, or one of the server-side decoding extensions).

quote:
Original post by Null and Void
quote:
Original post by Crispy
Ignore that - OpenAL doesn''t support streamable media interfaces. FMod or Bass are two libraries to look into, though.

You can stream audio with OpenAL in at least three ways (the standard buffer queueing method, the Loki callback extension, or one of the server-side decoding extensions).




Hmm - since what version? Last I remeber (a while ago now), OpenAL was pretty limited at, but not by, 3D sound.

My apologies to lucinpub if I was mistaken.





"Literally, it means that Bob is everything you can think of, but not dead; i.e., Bob is a purple-spotted, yellow-striped bumblebee/dragon/pterodactyl hybrid with a voracious addiction to Twix candy bars, but not dead."- kSquared
You can stream audio with OpenAL using the source queue, here''s a good tutorial for playing an ogg vorbis sound file.

http://www.devmaster.net/articles/openal-tutorials/lesson8.php

Ogg vorbis is royalty free unlike mp3 so in my opinion it''s a better choice.
Advertisement
That´s all nice, but i don´t have a ogg converter .

Does anyone know a free wav->ogg converter (windows)?
- growl -
quote:
Original post by Living Monstrosity
That´s all nice, but i don´t have a ogg converter .

Does anyone know a free wav->ogg converter (windows)?

For third party encoders see this page (the only one of those I''ve used before is OggDrop; I normally just use the official command line encoder oggenc).

BTW: Ogg is a container format (like AVI) that supports many types of multimedia data. Vorbis is a compressed audio format. When people talk about Ogg Vorbis, they mean Vorbis contained in an Ogg container. Vorbis data can be found in other types of container files and different types of data can be found in Ogg files.

Ok, thanks a lot.
- growl -
In windows there is API you can call that all you have to do is send the mp3 or a number of other formates to and it will play the mp3 for you. The problem is thats only for win. OpenGL is portable and its nice to keep it that way. I would go with OpenAL or OpenML.
--------------------------Nukemmsn: nukem996@hotmail.comaim: nukem996open source open mind

This topic is closed to new replies.

Advertisement