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

**URL:** <https://qa.fmod.com/t/how-to-output-a-sine-wave-to-a-specific-sound-card-channel/22536>\
**Category:** FMOD Engine\
**Created:** [January 23, 2025, 4:35pm UTC](https://qa.fmod.com/t/how-to-output-a-sine-wave-to-a-specific-sound-card-channel/22536 "2025-01-23T16:35:37Z")\
**Posts on this page:** 3\
**Page:** 1

<div class="post-metadata">

**Author:** ![martin\_4711](https://yyz2.discourse-cdn.com/flex036/user_avatar/qa.fmod.com/martin_4711/32/7871_2.png) [@martin\_4711](https://qa.fmod.com/u/martin_4711)\
**Post date:** [January 23, 2025, 4:35pm UTC](https://qa.fmod.com/t/how-to-output-a-sine-wave-to-a-specific-sound-card-channel/22536/1 "2025-01-23T16:35:37Z")

</div>

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):

```auto
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

---

<div class="post-metadata">

**Author:** ![martin\_4711](https://yyz2.discourse-cdn.com/flex036/user_avatar/qa.fmod.com/martin_4711/32/7871_2.png) [@martin\_4711](https://qa.fmod.com/u/martin_4711)\
**Post date:** [January 23, 2025, 5:08pm UTC](https://qa.fmod.com/t/how-to-output-a-sine-wave-to-a-specific-sound-card-channel/22536/2 "2025-01-23T17:08:05Z")

</div>

```auto
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?

---

<div class="post-metadata">

**Author:** ![Leah\_FMOD](https://yyz2.discourse-cdn.com/flex036/user_avatar/qa.fmod.com/leah_fmod/32/3685_2.png) [@Leah\_FMOD](https://qa.fmod.com/u/Leah_FMOD)\
**Post date:** [January 28, 2025, 3:18am UTC](https://qa.fmod.com/t/how-to-output-a-sine-wave-to-a-specific-sound-card-channel/22536/3 "2025-01-28T03:18:39Z")

</div>

> [@martin\_4711](#):
>
> 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](https://www.fmod.com/docs/2.02/api/effects-reference.html#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.
