Author |
|
Guests Guest User
Joined: October 01 2003 Posts: -184
|
Posted: January 31 2005 at 3:14pm | IP Logged
|
|
|
hi, Randal,
thanks to your info, now everythign is ok, the application is running fine.
Now we are adding the Equiry Local Host Capability functionality to the application.
We can use GetNumDigitalAudioInputDevices() to get the device numbers, but when we call the GetDigitalAudioInputDevice and GetDigitalAudioOutputDevice, we keep getting errors.
Could you please tell me how to set up the ZeroBasedDeviceIndex parameter, the documents are not enough. We set it to 0, but does not work.
thanks,
will
|
Back to Top |
|
|
support Administrator
Joined: January 26 2005 Location: United States Posts: 1666
|
Posted: January 31 2005 at 3:15pm | IP Logged
|
|
|
Will,
you>>>
Now we are adding the Equiry Local Host Capability functionality to the
application.
Hmm. I do not know what you mean here. Please be more specific. What is
"Equiry Local Host Capability functionality"?
you>>>
Could you please tell me how to set up the ZeroBasedDeviceIndex parameter,
the documents are not enough. We set it to 0, but does not work.
The VOIP Media Engine internally uses the standard Windows multimedia
interface API. Please see the "Windows Multimedia Platform SDK" for
additional/complete information. Specifically look at the Mmsystem.h
header file and the Winmm.lib documentation you have from Microsoft.
On a Windows machine, all available audio hardware is split into
audio input devices and output devices regardless if in and out are
on the same physical piece of hardware. Each audio in is assigned a
zero based device ID number. A similar Id number is assigned to
each audio out.
The VOIP Media Engine can automatically manage audio in/out only if they
are on the same physical hardware device. If your in/out are on different
devices, there are ways to do that too.
To inspect the system for available audio inputs and outputs the media engine
can use, you can to use the 4 followin APIs:
GetNumDigitalAudioOutputDevices()
GetDigitalAudioOutputDevice()
GetNumDigitalAudioInputDevices()
GetDigitalAudioInputDevice()
Assuming you are using C++ as your development language,
do something like:
////////////////////////////// /////////////////////////////////
//
// This next block of code can be used to inspect the multimedia
// capabilities of the host machine.
//
////////////////////////////// /////////////////////////////////
int NumDigitalAudioOutputDevices = 0;
int NumDigitalAudioInputDevices = 0;
int AudioOutIndex = -1;
int AudioInIndex = -1;
WAVEOUTCAPS WaveOutCaps;
WAVEINCAPS WaveInCaps;
int CurCnt;
int MyZeroBasedAudioDeviceId;
// these next two values may be the same name. it depends on your
// audio hardware.
char *pNameOfMyAudioOutDeviice = "My Audio Out Hardware";
char *pNameOfMyAudioInDeviice = "My Audio In Hardware";
NumDigitalAudioOutputDevices = GetNumDigitalAudioOutputDevices();
for(CurCnt=0;CurCnt<NumDigi talAudioOutputDevices;CurCnt++)
{
if(GetDigitalAudioOutputDevice(CurCnt,&WaveOutCaps))
{
// do something like look at the name of the
// hardware device.
if(strcmp(WaveOutCaps.szPname, pNameOfMyAudioOutDeviice) == 0)
{
// save the zero based index
AudioOutIndex = CurCnt;
}
}
}
NumDigitalAudioInputDevices = GetNumDigitalAudioInputDevices();
for(CurCnt=0;CurCnt<NumDigi talAudioInputDevices;CurCnt++)
{
if(GetDigitalAudioInputDevice(CurCnt,&WaveInCaps))
{
// do something like look at the name of the
// hardware device.
if(strcmp(WaveInCaps.szPname,p NameOfMyAudioInDeviice) == 0)
{
// save the zero based index
AudioInIndex = CurCnt;
}
}
}
// make sure audio device supports both in and out using the same
// index.
if((AudioOutIndex != -1) &&
(AudioInIndex != -1) &&
(AudioOutIndex == AudioInIndex))
{
// save your zero based index. this value can be specified in the
// ZeroBasedAudioDeviceId member of the START_SIP_TELEPHONY_PARAMS
// structure passed to the StartSipTelephony() API procedure.
MyZeroBasedAudioDeviceId = AudioInIndex;
}
else
{
// handle the error.
//
// Note: Your app will have to manage the audio
// hardware itself using the raw Windows wave APIs
//
}
Look at the WaveOutCaps and WaveInCaps structure variables. they will contain
the info for your multimedia hardware. Keep track of the zero beaced index
for the multimedia device you want to use and specify that value in the
ZeroBasedAudioDeviceId member of the START_SIP_TELEPHONY_PARAMS structure.
If the LanScape documentation is not adequate, we ask that you please
take the time to forward us your comments. This way we will be able to
improve the product for you and others.
Best regards,
Randal
|
Back to Top |
|
|
|
|