Chris P. [MVP]
2006-04-18 15:29:05 UTC
I beg your pardon if the question is too simple for the group.
I try to enumerate audio devices to find my device and to check its
properties.
devNum = waveInGetNumDevs();
mRes=waveInGetDevCaps(devNum, &WIC, sizeof(WAVEINCAPS));
return correct number of devices and my device's devNum and MID/PID.
waveInGetDevCaps() is pretty much useless. It doesn't list any of theI try to enumerate audio devices to find my device and to check its
properties.
devNum = waveInGetNumDevs();
mRes=waveInGetDevCaps(devNum, &WIC, sizeof(WAVEINCAPS));
return correct number of devices and my device's devNum and MID/PID.
extended formats and only returns the capabilities of the KMixer in most
cases.
Now I want to query device capabilities to know how many pins, nodes,
channels, bps etc
it support. (I have 64-channel 24bps 16ksps PCM audio recording device)
m_stWFEX.Format.cbSize=sizeof(WAVEFORMATEXTENSIBLE);
MMRESULT mRes=waveInOpen(&m_hWaveIn, devNum, (WAVEFORMATEX *)&m_stWFEX,
(DWORD_PTR)NULL, (DWORD_PTR)NULL, CALLBACK_NULL);
always return WAVEERR_BADFORMAT.
But this is exactly I'd like to - to know the format . Any format (if
the device supports any).
Where I'm wrong? How to open wave device if I do not know format it
supports?
It won't tell you, you have to guess or enumerate through the commonchannels, bps etc
it support. (I have 64-channel 24bps 16ksps PCM audio recording device)
m_stWFEX.Format.cbSize=sizeof(WAVEFORMATEXTENSIBLE);
MMRESULT mRes=waveInOpen(&m_hWaveIn, devNum, (WAVEFORMATEX *)&m_stWFEX,
(DWORD_PTR)NULL, (DWORD_PTR)NULL, CALLBACK_NULL);
always return WAVEERR_BADFORMAT.
But this is exactly I'd like to - to know the format . Any format (if
the device supports any).
Where I'm wrong? How to open wave device if I do not know format it
supports?
formats. Fully populate the WAVEFORMATEXTENSIBLE structure and call
waveInOpen(), if the format is supported it will succeed, otherwise it will
fail. You can add the WAVE_FORMAT_QUERY if you don't wish the device to
actually open.
Is there a way to ask the driver to fill WAVEFORMATEXTENSIBLE structure
for particular device so that after then to use it for device opening.
No. If you can locate the actual driver pins you should be able tofor particular device so that after then to use it for device opening.
enumerate the driver supported formats, it's not something I have much
experience with.
--
http://www.chrisnet.net/code.htm
http://www.avdevforum.com/AV
http://www.chrisnet.net/code.htm
http://www.avdevforum.com/AV