Jump to content
  • Advertisement
Sign in to follow this  
Nychold

OpenAL / Ogg Vorbis questions

This topic is 4844 days old which is more than the 365 day threshold we allow for new replies. Please post a new topic.

If you intended to correct an error in the post then please contact us.

Recommended Posts

Okay, got some stupid questions here, so try not to flame me too bad. ;) First, I'm trying to write an audio core for a small game engine, and I'm using OpenAL and Ogg Vorbis libraries. The functions for the Ogg Vorbis library seem like they are intended for playing a specific file instead of playing a chunk of another file. Which is what I want to do: make container files to house all the audio/video/game logic/whatever and navigate through the container file for the right data. The problem is, I need to stream some of the music and sound. I think I found a solution though: Use ov_open_callbacks, where my "close" function doesn't close the file handle, and, for each sound I need to play, recording the actual position in the file where ov_read completes. That way, if I need to jump to another sound to stream that, I can always come right back to this sound, and continue the streaming. Feels like an ass-backward solution though...and I just know there's a simpler way. I just can't find it. :D So, I guess my questions are "Will this work?" and "Is there a better, simpler way?" Second problem. I'd like to implement an equalizer/amplifier into my audio core. I thought it would be as simple as say adding some value to each sample based on the frequency (my test added 1000 to every sample). Unfortunately, this proved not to work, and instead gave some pops and clicks. So, what am I doing wrong? How do I get an amplifier/equalizer to work? Sorry if these are extremely stupid and obvious. I've always been confused by audio programming. ;) Thanks!

Share this post


Link to post
Share on other sites
Advertisement
Well, I got the streaming audio working from my container file, so I can safely say that the only question I have left is how to create an equalizer. Anyone have any ideas? Thanks in advance. ^^

Share this post


Link to post
Share on other sites
I'm working on this stuff right now actually... though not equalising. It is worth while getting the openal source from cvs from openal.org, it has demo stuff in there that might manipulate audio the way you want it too.

Though if you want to alter the actual samples, you already have them in a buffer so surely there must be tutorials out there.

[edited for spelling]

[Edited by - paulecoyote on August 15, 2005 11:35:23 AM]

Share this post


Link to post
Share on other sites
OpenAL really isn't designed for the type of audio playing that is equalized, it's a spatial audio library and doesn't provide direct access to "equalizing" routines. It's of course possible to manipulate the audio data, but it's not so much an OpenAL problem as it is one of general audio manipulation. Perhaps you could look into equalizer techniques used in other audio players, and try to implement those on your OpenAL stream.

edit: What do you need your "equalizer" to do, perhaps you could simulate it using OpenAL's positional effects?

Share this post


Link to post
Share on other sites
Sign in to follow this  

  • Advertisement
×

Important Information

By using GameDev.net, you agree to our community Guidelines, Terms of Use, and Privacy Policy.

We are the game development community.

Whether you are an indie, hobbyist, AAA developer, or just trying to learn, GameDev.net is the place for you to learn, share, and connect with the games industry. Learn more About Us or sign up!

Sign me up!