Delphi and multiple sound cards

6 replies to this topic

#1GazzaPax

New Member

• Members
• 4 posts

Posted 15 February 2010 - 01:44 PM

Hi, I'm a newbie (my first post!), and interested in writing a desktop app (prob in Delphi 6) which can play sounds to multiple sound cards. Reason is I'm trying to create a 3D surround sound effect.

I have a USB Creative external 5.1 soundblaster device, and although their proprietary .exe can individually pan left and right, front and rear, I can find no way to write my own app to do this (using TMediaPlayer and mciSendCommand). I cannot individually address each pair - unfortunately all four pan together.

I'm creating an Open Source app, so can't purchase a component. I'd be very happy to go out and buy a number of USB soundcards if I knew how to address each of them individually in my Delphi app.

Anyone have any experience with this ? The outcome will be used in the area of Assistive Technology (assisting people with disabilities). many thanks, Gazza

#2Wernaeh

Senior Member

• Members
• 368 posts

Posted 15 February 2010 - 02:55 PM

Not per se Delphi-related, but perhaps you should check out OpenAL, the Open Audio Library (google is your friend, we even have a tutorial series here on devmaster). I've made very good experiences using it.

Afaik, there is a OpenAL bind for Delphi as well.
I'm not sure about licensing, though.

Cheers,
- Wernaeh
Some call me mathematician, some just call me computer guy. Yet, I prefer the term professional weirdo :)

#3GazzaPax

New Member

• Members
• 4 posts

Posted 15 February 2010 - 04:34 PM

thanks,
will look into it....

#4GazzaPax

New Member

• Members
• 4 posts

Posted 15 February 2010 - 08:21 PM

Hi again, any Delphi people here ?

I note that the tutorials at this site do not included Delphi, and I'm having trouble getting Open AL installed. I downloaded and ran oalinst.exe which place a couple of dlls into the Windows directory but any example code I'm finding around the net fails with various .dcus not found. (al.dcu, altype.dcu, etc).

I'm prob doing something very basically wrong but google not helping much this time. Any advice much appreciated. Gazza

#5Wernaeh

Senior Member

• Members
• 368 posts

Posted 16 February 2010 - 12:46 PM

See if this helps...

In the downloads section of that site, there also are import units for OpenAL available.
Some call me mathematician, some just call me computer guy. Yet, I prefer the term professional weirdo :)

#6GazzaPax

New Member

• Members
• 4 posts

Posted 19 February 2010 - 03:39 PM

Hi, that was great thanks ! OpenAL now works fine for me!

I have an external (USB) Live! 24bit Soundblaster card (which supports 2 pairs of speakers, Front/Rear, Left/Right) and OpenAL has now allowed me to move a source around to any of these - fab stuff ! Your tutorials are v.helpful, thanks.

But my project needs to take this further, and its now back to my original question.... I am currently using those 4 speakers, and this allows me to move thru X and Z dimensions (SourcePos[0] and [2]).

But I need to create a true 3D aural field that has height, but inreoducing a second, identical soundcard (another 4 speakers) and control these via the Y dimension (SourecePos[1]).

Is it poss to identify which soundcards are attached to my system and send the sound to the appropriate soundcard? And secondly, if I am playing to both soundcards at once, is there a danger of the wav files being slightly out of phase? Or is it so fast that this will not occur. Many thanks, Gazza

#7Kenneth Gorking

Senior Member

• Members
• 939 posts

Posted 19 February 2010 - 05:52 PM

If your soundcard supports the ALC_ENUMERATION_EXT extension, then you can enumerate all the endpoints on your system.

Something like this (not tested):

if (alcIsExtensionPresent(0, "ALC_ENUMERATION_EXT") == AL_TRUE)

{

const char *devices = alcGetString(0, ALC_DEVICE_SPECIFIER);

puts("Available devices:\n");

if(devices != 0)

{

while(*devices != 0)

{

puts(devices);

devices += strlen(devices)+1;

}

}

}


You can read more at http://connect.creat...mmers_Guide.pdf under the 'Standard Extensions to OpenAL'
"Stupid bug! You go squish now!!" - Homer Simpson

1 user(s) are reading this topic

0 members, 1 guests, 0 anonymous users