0
0

I would like a DSP callback that inputs 8 channels of audio, modifies it, then sends it back to the system in 2 channels. how do I change the number of input channels and output channels?

what I’ve tried so far is setting speaker mode to FMOD_SPEAKERMODE_7POINT1, and FMOD_DSP_DESCRIPTION.channels to 2. but if i do that, both input and output channels show up as 2.

  • You must to post comments
0
0

You’d probably be better off using the low level API of FMOD Studio.

You would specify FMOD_DSP_DESCRIPTION::numchannels as 8 so that whatever goes into it comes in as 8 channels, then you can write to outbuffer as 2 channels and change *outchannels to 2.
The difference here is that you can change outchannels in fmod studio low level api (its pretty similar to fmod ex api) but you can’t change the outchannels in fmod ex callback.

  • You must to post comments
0
0

thanks, trying it now. if i were to compile that into a .dll for other programmers to link to dynamically, would they need to be using the same API or would they be able to use it regardless of which FMOD API they would be using?

  • You must to post comments
0
0

ok i downloaded the FMOD studio low level API. im using the Dspcustom example to try this. i just tried changing FMOD_DSP_DESCRIPTION2.channels to 8 but the callback is still showing only 2 inchannels.

  • You must to post comments
0
0

Hm ok,
I do notice though that *outchannels is 8 though. It seems like the setting is for how many channels the dsp will output, but you still have to process whatever comes in?

One thing I can think of is if you put 2 dsp units in a row, one outputs 8 (and does some upscale logic), then you process your next DSP as 8, use description->numchannels = 0 at this point, and set *outchannels = 2?
regards,
Brett

  • You must to post comments
0
0

hang on this got me thinking – you want to input 8 channels of audio, from where? Is it an 8 channel sound? If it was you would naturally get 8 coming into the dsp callback.

Are you expecting a mono 3d sound to scale up to 8 channels or something? (I could see this would be useful for hrtf type downmixing), but you could achieve the same thing by just doing the whole speaker mode as 7.1 then letting fmod upmix to 7.1 as it normally does, then you process the input to write it to 2 channels out. You could do *outchannels = 2 in fmod studio for this, but to be honest you could just write to FL and FR for the 7.1 mix even in fmod ex for that.

  • You must to post comments
0
0

[quote="brett":26c4e44o]hang on this got me thinking – you want to input 8 channels of audio, from where? Is it an 8 channel sound? If it was you would naturally get 8 coming into the dsp callback.

Are you expecting a mono 3d sound to scale up to 8 channels or something? (I could see this would be useful for hrtf type downmixing), but you could achieve the same thing by just doing the whole speaker mode as 7.1 then letting fmod upmix to 7.1 as it normally does, then you process the input to write it to 2 channels out. You could do *outchannels = 2 in fmod studio for this, but to be honest you could just write to FL and FR for the 7.1 mix even in fmod ex for that.[/quote:26c4e44o]

thats what I was hoping to do. i set the speakermode to 7.1 in fmod ex initially, but the number of inchannels and outchannels always show as 2 each. im just using an onboard mac soundcard which has less than 8 channels.

should it be showing the in and outchannels as 8 each after setting the speakermode to 7.1? am i maybe just calling things in the wrong order?

  • You must to post comments
0
0

ok so i am now getting 8 channels in and 8 channels out. all i do is setspeakermode to 7.1 and leave dspdesc.channels as 0. if i change the number to 8 then when the dsp callback is activated, although the number of ins and outs are 8, i get no audio, so i assume its error’d somewhere. what does dspdesc.channels actually do in this case? I would have thought it is used to limit the amount of ins and keep the number of outs as whatever the speakermode says, and I would have thought setting it as 8 would be the same as setting it as 0.

  • You must to post comments
0
0

in FMOD Ex, the numchannels descriptor is only for ‘generators’ ie things that go on the leaf nodes of the dsp tree, ie something you’d play with System::playDSP.

In FMOD Studio, numchannels will change the outchannel count in the dsp callback to be the value that you set.

  • You must to post comments
Showing 8 results
Your Answer

Please first to submit.