How to output a sine wave to a specific sound card channel?

Hi,

I want to write a small application, where the user can select a sound card (FMOD driver) and a channel of this sound card (e.g. from 1 to 8, if the sound card is 7.1). The application shall then play a sine wave on this sound card channel.

I am stuck in the relation between DSPs and sound card channels. What I have so far (with the C# wrapper):

Factory.System_Create(out var fmodSystem);
fmodSystem.setSoftwareFormat(48000, SPEAKERMODE.RAW, 8); // TODO use values from driver
fmodSystem.setDSPBufferSize(2048, 2);
fmodSystem.init(1024, INITFLAGS.NORMAL, IntPtr.Zero);

fmodSystem.createDSPByType(DSP_TYPE.OSCILLATOR, out var dsp);
dsp.setParameterFloat((int)DSP_OSCILLATOR.RATE, 220);
dsp.setParameterInt((int)DSP_OSCILLATOR.TYPE, 0);

fmodSystem.createChannelGroup("group1", out var channelGroup);
fmodSystem.playDSP(dsp, channelGroup, false, out var channel1);

This plays the tone on the first speaker. How can I change the sound card channel?

Has it something to do with “DSPConnection::setMixMatrix”? If so: How do I get this connection object from what I have above?

Regards,
Martin

channel1.setMixMatrix([0f, 0f, 0f, 0f, 1f, 1f, 0f, 0f], 8, 1)

changes the output from the first speaker to the 5th and 6th speaker.

Can somebody confirm, that I am on the correct way?

Using setMixMatrix() is one way of solving this problem, yes.

Another option would be to create a Channel Mix DSP, and use that to route the signal to specific channels instead, but your situation is simple enough that setMixMatrix() is probably better.