Delphi and multiple sound cards

510dcef185cefec1a968890f418431dc
0
GazzaPax 101 Feb 15, 2010 at 13:44

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

6 Replies

Please log in or register to post a reply.

B7568a7d781a2ebebe3fa176215ae667
0
Wernaeh 101 Feb 15, 2010 at 14:55

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

510dcef185cefec1a968890f418431dc
0
GazzaPax 101 Feb 15, 2010 at 16:34

thanks,
will look into it….

510dcef185cefec1a968890f418431dc
0
GazzaPax 101 Feb 15, 2010 at 20:21

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

B7568a7d781a2ebebe3fa176215ae667
0
Wernaeh 101 Feb 16, 2010 at 12:46

See if this helps…

In the downloads section of that site, there also are import units for OpenAL available.

510dcef185cefec1a968890f418431dc
0
GazzaPax 101 Feb 19, 2010 at 15:39

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

46407cc1bdfbd2db4f6e8876d74f990a
0
Kenneth_Gorking 101 Feb 19, 2010 at 17:52

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.creativelabs.com/openal/Documentation/OpenAL_Programmers_Guide.pdf under the ‘Standard Extensions to OpenAL’