21 May '13 - 19:00 *
Welcome, Guest. Please login or register.
Did you miss your activation email?

Login with username, password and session length
 
   Home   Help Search Login Register  
Pages: [1]
  Reply  |  Print  
Author Topic: WinAmp Output Plug-In?  (Read 432 times)
ken
Posts: 630


« on: 19 Aug '12 - 13:35 »
Reply with quoteQuote

Hi,

Is there a WinAmp Output Plug-In for BASS? So I can use plugins like this: http://emilles.dyndns.org/software/out_apx.html

Logged
Ian @ un4seen
Administrator
Posts: 15259


« Reply #1 on: 20 Aug '12 - 14:49 »
Reply with quoteQuote

As far as I know, there aren't any ready-made add-ons for using Winamp output plugins, but I think it should be a fairly straightforward process. Basically, you would load and initialize the plugin, and then feed a BASS decoding channel to it. It might look something like this...

plugin=LoadLibrary(...); // load the Winamp output plugin
Out_Module *(WINAPI *winampGetOutModule)()=(Out_Module*(WINAPI*)())GetProcAddress(plugin, "winampGetOutModule"); // import the module exporting function
Out_Module *output=winampGetOutModule(); // get the module
output->Init(); // initialize the plugin

decoder=BASS_StreamCreateFile(FALSE, filename, 0, 0, BASS_STREAM_DECODE); // create a decoder for an audio file
BASS_CHANNELINFO ci;
BASS_ChannelGetInfo(decoder, &ci); // get sample format info
output->Open(ci.freq, ci.chans, 16, 500, 250); // open output with same format
while (BASS_ChannelIsActive(decoder)) { // decoder is still going
int c=output->CanWrite(); // check how much can be written to the output
if (c>0) {
BYTE buf[8192]; // decoding buffer
c=BASS_ChannelGetData(decoder, buf, min(c,sizeof(buf)); // decode some data
if (c>0) output->Write(buf, c); // send the data to the output
} else
Sleep(20); // wait a bit
}
while (output->IsPlaying()) Sleep(10); // wait for playback to finish
output->Close(); // close the output

output->Quit();
FreeLibrary(plugin); // unload the plugin

You will need the Winamp SDK for the OUT.H header that defines the "Out_Module" structure.
Logged
ken
Posts: 630


« Reply #2 on: 21 Aug '12 - 15:32 »
Reply with quoteQuote

Thanks Ian,

I figure it working something like that. Problem is I have to port this to C# and my C++ is not that god ;-(
Logged
Pages: [1]
  Reply  |  Print  
 
Jump to:  

Powered by SMF 1.1.18 | SMF © 2013, Simple Machines