can i read audio files in opengl applications?

Started by
12 comments, last by vijaykiran 21 years, 9 months ago
hi guys, I have a problem and I am unaware of whether this has been discussed before. I have my C program written using OpenGL and I require some audio files to be played along with my application. Is there any function that reads the audio file and gives me the output? I appreciate anyone giving me helpful suggestions. Thanks, Vijay Kiran.
k. vijay kiran
Advertisement
Open GL is only a graphics API, try looking up some sound API's like Direct Sound. Try searching for one.

-J

[edited by - jason2jason on June 25, 2002 3:00:25 PM]
I''m not an OpenGL expert, but what i know is that OpenGL is for graphics, if u want to handle sounds then u need a sound API.

If u''r running windows then PlaySound() function should solve ur problem. For more documentation check MSDN.

Hope it helps
"...and we all know what "undefined" means: it means it works during development, it works during testing, and it blows up in your most important customers' faces."----------Scott Meyers, "Effective C++"
sdl? see www.libsdl.org
libraries to play wav''s ogg mp3 etc

http://uk.geocities.com/sloppyturds/gotterdammerung.html
You could use OpenAL, its syntax is very much like OpenGL so it shouldn''t have many problems learning it.

Henrym
Of course you can, because an OpenGL application is no different than any other application and any application should be able to read files, and audio files are not special files, just normal files.

So, yes, you can read audio files in OpenGL applications. Of course the audio will have ABSOLUTELY NOTHING to do with OpenGL, because OpenGL is strictly graphics.

In conclusion, this is not an OpenGL question.
AP''s right, but people normally get flamed for making that kind of observation.

Anyway, PlaySound is not gonna be something you''ll want to use in a game, and DirectSound (as of DX8.1) doesn''t support mp3 playback without additional support. For noncommercial projects, libraries such as Midas, FMOD, and BASS are free and very well-suited to your needs. OpenAL''s documentation is nebulous as it never (or hasn''t yet?) caught on. I hear that Creative Labs'' implementation is useable though.

Later,
ZE.

//email me.//zealouselixir software.//msdn.//n00biez.//
miscellaneous links

[twitter]warrenm[/twitter]

Hi,

you should use FMOD. It is easy to use, fast and free (if your program is free, too)

CU

Andreas

- - - - - - - - - - - - - -
Andreas Mähler

Wolf359 Interactive
Let the guy choose. I already suggested FMOD anyway.

[twitter]warrenm[/twitter]

quote:Original post by ZealousElixir
OpenAL's documentation is nebulous as it never (or hasn't yet?) caught on. I hear that Creative Labs' implementation is useable though.


I hope it has caught on, coz UT2003 uses OpenAL for its audio system

[edit: hehe, silly quote tags went mad]

[edited by - _the_phantom_ on June 26, 2002 8:26:16 PM]

This topic is closed to new replies.

Advertisement