コード例 #1
0
// set the current device. device is from 0 to HAE_MaxCaptureDevices()
// NOTE:	This function needs to function before any other calls may have happened.
//			Also you will need to call HAE_ReleaseAudioCard then HAE_AquireAudioCard
//			in order for the change to take place.
void HAE_SetCaptureDeviceID(INT32 deviceID, void *deviceParameter)
{
    if (deviceID < HAE_MaxCaptureDevices())
	{
	    g_soundDeviceIndex = deviceID;
	}
}
コード例 #2
0
// get deviceID name
// NOTE:	This function needs to function before any other calls may have happened.
//			The names returned in this function are platform specific.
void HAE_GetCaptureDeviceName(INT32 deviceID, char *cName, UINT32 cNameLength) {
    WAVEINCAPS		caps;
    MMRESULT		theErr;

    if (deviceID < HAE_MaxCaptureDevices()) {
	    /* $$fb 2002-04-10: fix for 4514334: JavaSoundDemo Capture not works on Windows2000 with USB Port */
	    if (deviceID == 0) {
		deviceID = (INT32) WAVE_MAPPER;
	    } else {
		deviceID--;
	    }

	    theErr = waveInGetDevCaps((UINT)deviceID, &caps, sizeof(WAVEINCAPS));
	    if ((theErr == MMSYSERR_NOERROR) && cName && cNameLength) {
		    strncpy(cName, caps.szPname, cNameLength-1);
		    cName[cNameLength-1] = 0;
		}
	}
}
コード例 #3
0
// get deviceID name 
// NOTE:	This function needs to function before any other calls may have happened.
//			The names returned in this function are platform specific.
void HAE_GetCaptureDeviceName(INT32 deviceID, char *cName, UINT32 cNameLength) {
    char		*data;
    static char *names[] = {
#ifdef __linux__
	"LinuxOS,dev/audio,multi threaded",
#else
	"SolarisOS,dev/audio,multi threaded",
#endif
    };
    if (cName && cNameLength) {
	if (deviceID < HAE_MaxCaptureDevices()) {
	    // can't do string functions here, it might be bad to do.
	    data = names[deviceID];
	    while (*data && (cNameLength > 0)) {
		*cName = *data;
		cName++;
		data++;
		cNameLength--;
	    }
	    *cName = 0;
	}
    }
}
コード例 #4
0
// get deviceID name
// NOTE:	This function needs to function before any other calls may have happened.
//			The names returned in this function are platform specific.
void HAE_GetCaptureDeviceName(INT32 deviceID, char *cName, UINT32 cNameLength)
{
    char		*data;
    static char *names[] =
    {	"Linux,dev/dsp,multi threaded",
    };
    if (cName && cNameLength)
	{
	    if (deviceID < HAE_MaxCaptureDevices())
		{
		    // can't do string functions here, it might be bad to do.
		    data = names[deviceID];
		    while (*data && (cNameLength > 0))
			{
			    *cName = *data;
			    cName++;
			    data++;
			    cNameLength--;
			}
		    *cName = 0;
		}
	}
}