Sorry your browser is not supported!

You are using an outdated browser that does not support modern web technologies, in order to use this site please update to a new browser.

Browsers supported include Chrome, FireFox, Safari, Opera, Internet Explorer 10+ or Microsoft Edge.

Work in Progress / DarkAL - OpenAL plugin for DBPro

Author
Message
Syncaidius
19
Years of Service
User Offline
Joined: 22nd Mar 2005
Location: United Kingdom
Posted: 18th Sep 2010 00:55 Edited at: 1st Oct 2010 22:25
This is a WIP wrapper of OpenAL (Open Audio Library) I'm working on. At the moment, you can do most of the core tasks you'd expect from every sound engine, such as loading sound files, positioning them in 3D space, etc. On top of that, you can set a variety of different properties for each sound source. Eventually you'll even be able to apply the much loved EAX effects and the new EFX effects/filters to sound sources too, thanks to OpenAL.

The OpenAL Redistributable is required for this plugin to work. Without it you will mostly likely get an error saying that openAL32.dll is missing. Link: http://connect.creativelabs.com/openal/Downloads/oalinst.zip

Updated 1st October 2010
Current Version: 0.3
Theres around 147 functions in the plugin now and its not even close to done. Heres a list of all the commands so far:


As mentioned, this is an early WIP so I don't expect it to be stable just yet... but I thought bugs would be spotted earlier/quicker if it has more eyes and hands on it.

The plugin, help files and a few examples are attached to this post.

Feature list so far:
Multi-threaded - allowing for extremely fast performance, without interrupting or halting your DBPro program.
.WAV and .OGG loading
Creation of sounds from memory - Allows the loading of raw audio data stored in memory (e.g. memblocks) to be turned into a sound
Error system - A simple but useful system for detecting anything that goes wrong when calling DarkAL functions, without stopping your program
3D Environmental audio and doppler - simulates the bahaviour of sound in a 3D environment as if it was the real thing.
Audio Capture support - Allows you to capture audio from a microphone, line-in and any other capture devices that OpenAL supports

A few things to come:
Loading of .MP3 and any other formats I can add later
Saving of audio files as any of the formats they can be loaded in
Direct editing of sounds in memory, while they are active - This might open the path for some funky realtime generated sound effects, who knows
Legacy EAX effect support via OpenAL (the old EAX features that microsoft killed after removing DirectSound)
X-RAM Support - Currently only 2 cards support this, the X-Fi Fatal1ty FPS and the X-Fi Elite Pro sound cards, which both have 64MB of on-board X-RAM (sound RAM) for loading audio files directly onto the sound card
Whatever else i think of when the time comes

Changes in V0.3:
Added error handling example
Added AL HAS DEFAULT AUDIO DEVICE - returns 1 if a default audio device was found
Added AL HAS DEFAULT CAPTURE DEVICE - returns 1 if a default capture device was found
Renamed AL GET CAPTURING to AL CAPTURING - to fit in with the function style (and for lazy fingers)
Added AL SET DISTANCE MODEL and AL GET DISTANCE MODEL - Changes how openAL calculates the volume of a sound while performing doppler
Cleaned up some code from the previous version
Added AL VERSION$ - returns the current version of the system's OpenAL runtime installation
Added AL RENDERER$ - returns the name of the renderer (the drivers/software that converts the sound data into whatever the device understands)
Added AL VENDOR$ - returns the vendor (aka developer) of the currently installed OpenAL version (e.g. Nividia or Creative Labs Inc.)
Added Effects availability functions
Added Filter availability functions
Added Example demonstrating new availability functions

Functions for setting up, configuring and applying EAX and EFX effects/filters is next on the list.

You're free to use this in your commercial or free programs. If anyone finds any other bugs, please post them here, along with any questions, comments or criticism you may have.

Attachments

Login to view attachments
Hockeykid
DBPro Tool Maker
16
Years of Service
User Offline
Joined: 26th Sep 2007
Location:
Posted: 19th Sep 2010 08:06
Hi,
I went to go try one of the examples and when I tried running it I got an error. It was something like "Could not start because the OpenAL32.dll is missing from your computer".

Syncaidius
19
Years of Service
User Offline
Joined: 22nd Mar 2005
Location: United Kingdom
Posted: 19th Sep 2010 12:00 Edited at: 19th Sep 2010 12:02
That usually happens if the OpenAL redistributable isn't installed. The link for it is near the top of the OP.

Syncaidius
19
Years of Service
User Offline
Joined: 22nd Mar 2005
Location: United Kingdom
Posted: 22nd Sep 2010 23:18 Edited at: 22nd Sep 2010 23:20
I've just finished adding audio capturing support to the plugin. It should work with line-in, microphone and any other capture devices that OpenAL supports. I've also included a new example and help pages for the audio capture functions.

The updated version attached to OP.

EDIT:
Also, remember that you need the OpenAL redistributable installed for this plugin to work properly.

thenerd
15
Years of Service
User Offline
Joined: 9th Mar 2009
Location: Boston, USA
Posted: 23rd Sep 2010 00:30
Just wondering, will this support 3d occlusion? What I mean by that is, you can add materials to level geometry which then muffles sound travelling through it, and can also create echos and the like.

Syncaidius
19
Years of Service
User Offline
Joined: 22nd Mar 2005
Location: United Kingdom
Posted: 23rd Sep 2010 12:10
Yes, it will. When I can find more time, I'm going to finish off the effect and filter functions, which would allow you to perform occlusion manually. I'll probably add a few helper functions for obstruction, occlusion and exclusion now that you've brought that topic up though.

revenant chaos
Valued Member
17
Years of Service
User Offline
Joined: 21st Mar 2007
Location: Robbinsdale, MN
Posted: 25th Sep 2010 07:20 Edited at: 25th Sep 2010 07:22
Hi Syncaidius, Nice work so far. I downloaded and tested the examples, but found a few problems. I had to modify the first demo's initialization code to:
, Otherwise nothing would play. While I was testing the second demo I decided to test a few of the commands and found AL SET SOUND STRENGTH to be broken. Here is a Modified version of the second demo which displays the bug:



Other than that, great work so far. This couldn't have come at a better time since I am starting work on some sound systems for an outdoor environment, and I am somewhat unhappy with DBpro's buggy native 3D sounds.
Syncaidius
19
Years of Service
User Offline
Joined: 22nd Mar 2005
Location: United Kingdom
Posted: 25th Sep 2010 18:50
I'll check out the AL START function later, obviously somethings not right there. Your example works fine for me, which is odd. I'll give it a look when I can find some time though.

revenant chaos
Valued Member
17
Years of Service
User Offline
Joined: 21st Mar 2007
Location: Robbinsdale, MN
Posted: 29th Sep 2010 05:27
Hi again, I am pretty sure that my problems are caused by my sound card. I have an integrated RealTek AC97 sound card, which apparently does not support all of OpenAL 2.0's features.

If I tell your plugin to use software mode, then AL SET SOUND STRENGTH works fine for me to.
Syncaidius
19
Years of Service
User Offline
Joined: 22nd Mar 2005
Location: United Kingdom
Posted: 1st Oct 2010 22:24 Edited at: 1st Oct 2010 22:28
Quite a chunky update above. Check the OP for details and updated attachment. Most of it is preperation for the rest of the EAX and EFX effects/filters system, which will take a while to finish because it there is alot to wrap up, especially for managing effects and their properties.

@Revenant Chaos
I wasn't able to fix your problem revenant. I'ved tried a lot of different ways to break it, but failed so far. I'll keep trying when I find more time.

revenant chaos
Valued Member
17
Years of Service
User Offline
Joined: 21st Mar 2007
Location: Robbinsdale, MN
Posted: 2nd Oct 2010 04:01
Quote: "I wasn't able to fix your problem revenant. I'ved tried a lot of different ways to break it, but failed so far. I'll keep trying when I find more time."

Like I said, I dont think my problems were your fault. I am pretty sure that it is my sound card which doesn't support OpenAL properly.
Perhaps you could detect sound cards like mine and force software mode?
Syncaidius
19
Years of Service
User Offline
Joined: 22nd Mar 2005
Location: United Kingdom
Posted: 2nd Oct 2010 12:59 Edited at: 2nd Oct 2010 13:00
Well, by default OpenAL is supposed to use the "Generic Software" device on older sound cards. I'll see what I can do though.

Syncaidius
19
Years of Service
User Offline
Joined: 22nd Mar 2005
Location: United Kingdom
Posted: 4th Oct 2010 14:51 Edited at: 4th Oct 2010 22:40
I've been reading up on the DirectX XAudio2 Engine for the last day or so after a friend mentioned it being a lot easier to work with and I have to admit it looks much saner to use than OpenAL, not to mention larger amount of features available. So... I am seriously considering switching the plugin over from OpenAL to XAudio2.

So far, the benefits of switching outweigh the bad points greatly:
Programmable DSP (digital signal processing) system - works under the same principal as pixel shaders do for graphics, except for sounds instead
No extra redistributable needs to be installed on top of DirectX, unlike OpenAL
If your sound card works under Windows, it'll work fine in your game too (unlike OpenAL, again)
Compatible with XACT 3.0 (Cross-platform audio creation tool) which included with DirectX SDK and allows you to create banks of sounds, cues, music playlists, etc, which you can load straight into your game.
Built in Occlusion and Obstruction system. In OpenAL I'd have to create one myself if the plugin stays with it.

No support for X-RAM on creative Soundblaster X-Fi cards.
Only supports .WAV and .XWMA, including the compressed versions of both.

revenant chaos
Valued Member
17
Years of Service
User Offline
Joined: 21st Mar 2007
Location: Robbinsdale, MN
Posted: 6th Oct 2010 08:15
That does sound pretty good, especially if it is easier for you to work with.

One thing I noticed in the current version was the lack of a "copy sound" or "clone sound" command. Aside from that this is already an upgrade to DBpro's native system (which produces staticy sounds when the listener is moving).
Mistrel
Retired Moderator
18
Years of Service
User Offline
Joined: 9th Nov 2005
Location:
Posted: 18th Oct 2010 00:25
Thanks for this. Would you be willing to post the source code for your wrapper as well? This would be a great tool for DarkGDK and for use with other non-TGC products.

Red Eye
15
Years of Service
User Offline
Joined: 15th Oct 2008
Location:
Posted: 19th Oct 2010 18:26
DarkGDK maybe?

Nice plugin mate.

dark coder
21
Years of Service
User Offline
Joined: 6th Oct 2002
Location: Japan
Posted: 20th Oct 2010 06:28
You can just use OpenAL directly if you're using GDK, however I find it rather annoying to use so I instead use a wrapper for it called freeSL(scroll down).

Login to post a reply

Server time is: 2024-03-29 07:39:18
Your offset time is: 2024-03-29 07:39:18