View Full Version : Multichannel Output from DSP plugin?
voxtreet
11th March 2004, 01:14
Hi all,
OK, I've figured out how to write a simple passthrough DSP plugin. My next goal is to write a DSP plugin that will process two incoming signals and produce 5-ch output. (Could be as simple as copying the L and R inputs into the SL and SR channels, and summing them into the C).
How can I do this? In the DSP plugin, the modify_samples (or equivalent) API function gets called by Winamp, and I am passed the array of input samples, as well as the number of channels. But I don't see any way to CHANGE the number of channels, and I would also need to increase the size of the sample buffer to hold the new channels...
As a DSP plugin, how do I tell Winamp that I have more channels to output than I got in, and where do I put those channels?
I found a similar question to this by searching the forums, but it was never answered...
Thanks in advance for your help!!!
javajunky
15th March 2004, 07:03
Have you tried using the audio drivers provided by the kx project : http://kxproject.lugosoft.com/index.php?skip=1
I use them to get 5:1 up-mixed music outside of winamp :)
voxtreet
15th March 2004, 17:56
The kx project sounds very interesting, I will have to check them out. Thanks for the pointer, javajunky.
But it doesn't solve my problem, I am still hoping to be able to do this within a Winamp DSP plugin.
I was looking through the source code for the WinampAC3 project, since it is able to send the multichannel output to the Winamp output plugin stage. It looks like they either send directly to DirectSound output, or use what they call a Winamp "Sink"...Does anyone know if this "sink" is part of the Winamp SDK, or something the WinampAC3 project just wrote themselves?
By the way, the WinampAC3 project website forum is equally bereft of useful information...
Where is everybody? Surely someone here must know the answer? Is there some other forum where people are talking about this? Or are Winamp plugins just not that popular?
laeaug
1st February 2005, 09:46
Hi,
I would like to also be able to increase the number of channel in output for a DSP.
you would have found a solution?
thanks
TubeLiar
27th September 2005, 14:31
I'm not sure, but i think it's impossible for a DSP plugin to alter the format of the stream. All you get to do is modify the samples. You also get some control over the length (you can output anywhere between half to double the length of your input), but as far as i know you get no control over the number of channels.
One workaround i'm using in a plugin i'm writing now is to write an output plugin that behaves as a DSP plugin. What you do is, you make an output plugin that loads another one so that you don't have to care about the actual output itself. You let the other plugin handle that. In your Open function, winamp reports the format of the source to your plugin, but here you can report anything you like to the other plugin. Then, when your Write function is called, you reserve some memory for your own format, write to it in any way you want (this is where you get to mix and process all you like!) and then pass your newly created buffer to the other plugin. Don't forget to get rid of it afterwards! Also, CanWrite reports the number of bytes a plugin can handle, so if you say, double the output, you should halve the value you get from the other plugin and report that in your own.
All the other functions should just call the equivalents in the plugin you load (unless you want to process something there as well).
Also, don't forget that to the other plugin, it looks as if your plugin is winamp! So anything that is "filled in by winamp" should now be filled in (or simply passed through) by you!
Hope that helps :-)
vBulletin® v3.8.6, Copyright ©2000-2013, Jelsoft Enterprises Ltd.