0
0

With FMOD is there a way to determine the number of input channels a sound card has? Looking at the examples (recording/recordtodisk) the exinfo.numchannels is hardcoded with a value. I have sound card that has 8 outputs and 2 inputs and another sound card w/ 8 outputs and 8 inputs and I need to know how to setup the exinfo using the values from the sound card.

Thanks!
Carlton

  • You must to post comments
0
0

I think the answer is no – fmod lets you create a mono or stereo record buffer usually.
Try looping through a bunch of createSound calls with record start being called on them (then stop and release), that might work to work out how may channels you can record to.

  • You must to post comments
0
0

Not the most elegant solution, but what you suggested works for now. This is what I came up with which seems to work (assuming a sound card has no more than 8 inputs).

[code:3damg16i] // Get the number of Physical Inputs for this device
FMOD.CREATESOUNDEXINFO exinfo = new FMOD.CREATESOUNDEXINFO();
FMOD.Sound sound = new FMOD.Sound();
_numberOfPhysicalInputs = 0;
for (int channels = 8; channels > 0 && _numberOfPhysicalInputs == 0; channels–)
{
exinfo.cbsize = Marshal.SizeOf(exinfo);
exinfo.numchannels = channels;
exinfo.format = _soundFormat;
exinfo.defaultfrequency = _controlpaneloutputrate;
exinfo.length = (uint)(exinfo.defaultfrequency * 2 * exinfo.numchannels * 5);

                    result = echoAudioSystem.System.createSound((string)null, (FMOD.MODE._2D | FMOD.MODE.SOFTWARE | FMOD.MODE.LOOP_NORMAL | FMOD.MODE.OPENUSER), ref exinfo, ref sound);
                    if (FMOD.RESULT.OK == result)
                    {
                        result = echoAudioSystem.System.recordStart(SoundCardID, sound, true);
                        if (FMOD.RESULT.OK == result)
                        {
                            _numberOfPhysicalInputs = channels;
                            _initialized = true;
                        }
                    }

                    echoAudioSystem.System.recordStop(SoundCardID);
                    sound.release();
                }[/code:3damg16i]

Thanks for your advise.

  • You must to post comments
Showing 2 results
Your Answer

Please first to submit.