0
0

Hi,

does someone know how to call the Shoutcast dsp_sc.dll in any app?

I want my program to call the DLL for broadcasting instead of having to open winamp and my player.

The only exported function in dsp_sc.dll i could find is:
[code:oug3ab4j] winampDSPGetHeader2 @1[/code:oug3ab4j]

BTW i’m developing in C++

  • You must to post comments
0
0

Whahaha, OK i just red the topic [url:26ph9gae]http://www.fmod.org/forum/viewtopic.php?t=1477[/url:26ph9gae] where i’ve found the files and have them on my HD ๐Ÿ˜†

Thanx

Oh i did a search for: winamp vis plugin
Damn what a lot of topics so…

[size=150:26ph9gae]BRETT if you read this post please place the examples on your download page or in one sticky topic !!!!!!!!!!!!!!!!![/size:26ph9gae]

Tip! Some pages like:
VB sources
Delphi sources
VC sources
BCB sources
.NET sources
etc.

  • You must to post comments
0
0

Another error occured in BCB when i close my app it will stay in as a process due to a wrong winamp DSP closing.

This is the right closing structure:
[code:tchcw6ge] if (Shout != NULL) {
if (DSPModule != NULL) {
DSPModule->hwndParent = NULL;
DSPModule->hDllInstance = NULL;
DSPModule->Quit(DSPModule);
}
DSPGetHeader = NULL;
FreeLibrary(Shout);
Shout = NULL;
}[/code:tchcw6ge]

  • You must to post comments
0
0

I am interested in this as well.

I have already found the following information from winamp’s developer pages :
http://www.winamp.com/nsdn/winamp2x/dev … /dsp.jhtml

In the minisdk, you will find dsp.h, which actually gives you all the information you need to call any winamp dsp.

I don’t know very much about c++, but I think it works as follows if you want to call a dsp from within your application :

Add dsp.h, and declare a pointer to a winampDSPHeader
Load the dll of the dsp you want to use dynamically and call the function winampDSPGetHeaderType to fill the pointer.

Now you can get to the winampDSPModule with the getModule function in the winampDSPHeader structure.
With this winampDSPModule structure, you can now initialize and later quit the dsp.

In fmod, you also have to create a dsp, that will pass audio data to the dsp by calling ModifySamples with the data received from fmod.

I think that’s it. The only thing I don’t know exactly is how the dynamic loading and calling functions inside a structure works, so it would be very cool if someone could help me with that part.

  • You must to post comments
0
0

Hรฉ thanks now i can load it and use the winampDSPHeader ๐Ÿ˜€

I also figured out how to setup winampDSPModule ๐Ÿ˜€

I have the Shoutcast window in my app now WAY COOL !!!!!!!!

Now i only need to figure out how place the FMOD output stream into the Shoutcast plugin.
I’m not good in C++ so this should take a while….

I have a source of a DSP named “pacemaker” which edits the tempo and speed of RAW audio so maybe i can use that to ๐Ÿ˜†

  • You must to post comments
0
0

Oops forgot to give source btw FMOD is also free ๐Ÿ˜‰

In your .CPP file
[code:1sxmdqie]Shout = LoadLibrary("dsp_sc.dll");
if (Shout != NULL) {
DSPGetHeader = (pDSPGetHeader) GetProcAddress(Shout, MAKEINTRESOURCE(1));
DSPHeader = DSPGetHeader();
DSPModule = DSPHeader->getModule(0);
if (DSPModule != NULL) {
DSPModule->hwndParent = Application->Handle;
DSPModule->hDllInstance = Shout;
DSPModule->Init(DSPModule);
}
}[/code:1sxmdqie]
In your .H file
[code:1sxmdqie]#include “dsp.h”
typedef WINSHELLAPI winampDSPHeader * (WINAPI *pDSPGetHeader)();

HMODULE Shout;
pDSPGetHeader DSPGetHeader;
winampDSPHeader *DSPHeader;
winampDSPModule *DSPModule;[/code:1sxmdqie]

NOTE: GetProcAddress(Shout, “winampDSPGetHeader2@1”) returned NULL that’s why i used MAKEINTRESOURCE(1)
Application->Handle is the Handle of the parent window in Borland C++ Builder offcourse you can set a other windowhandle.

NOTE 2 (April 22): Found solution for MAKEINTRESOURCE(1) GetProcAddress(Shout, “winampDSPGetHeader2”) thanks to blackshard :)

  • You must to post comments
0
0

Hey,
Thanks a lot for your code, I actually got shoutcast completely working!
The only thing I had to change was the definition in the header to
[code:2ojkntwu]typedef winampDSPHeader* (*pDSPGetHeader)();[/code:2ojkntwu]
To get it working in Visual C++ 6.

Using it is actually fairly easy. Here is the complete callback function, simply use the FSOUND_DSP_Create and FSOUND_DSP_SetActive functions to get it working.

[code:2ojkntwu]
void *dsp_shoutcast_callback(void *originalbuffer, void *newbuffer, int length, int param)
{
int mixertype = FSOUND_GetMixer();
int count;

if (mixertype == FSOUND_MIXER_QUALITY_FPU)
{
    float *src = (float *)newbuffer;
    signed short smp_l=0;
    signed short smp_r=0;

    for (count=0; count < length; count++)
    {
        smp_l = (signed short)src[count << 1];
        smp_r = (signed short)src[(count << 1)+1];

        waWAVBuffer[waBufferPos++] = smp_l;
        waWAVBuffer[waBufferPos++] = smp_r;

        if (waBufferPos >= 1024*2)
        {
            //we now have a full buffer, pass it to the dsp
            wa_dspModule->ModifySamples(wa_dspModule, waWAVBuffer, 1024, 16, 2, 44100);
            waBufferPos = 0;
        }
    }
}
else
{
    signed short *src = (signed short *)newbuffer;
    wa_dspModule->ModifySamples(wa_dspModule, src, 1024, 16, 2, 44100);
}

return newbuffer;

}
[/code:2ojkntwu]
waBufferPos is just an integer, waBuffer is an array with size 2*1024 of signed short’s.
The reason I use the buffer when the mixer quality is FPU is because that is a floating point buffer, and the winamp dsp expects signed integers.
To make it even better, you might create a buffer that is the same number of samples as fmod’s buffersize, but that doesn’t really matter I think.

Edit:
Is it possible that GetProcAddress(Shout, “winampDSPGetHeader2@1”) returned null because you should simply use “winampDSPGetHeader2” and that windows automatically finds the @1?
I haven’t tested it myself, but maybe it works like that.

  • You must to post comments
0
0

Thanks 2 u 2 !!!

Now i go on to the next step: the in_* and vis_* plugins of winamp ๐Ÿ˜›

hehehe

  • You must to post comments
0
0

For vis you may check out my player sourcecode at http://web.tiscali.it/sababros/Download … ta6src.zip

It’s VB source code.
KarLKoX (maximum respect! :)) made a C library with my code and posted the link somewhere in the forums, but I can’t find the thread…

  • You must to post comments
0
0

Ehm blackshard i get:

[b:3u5o1zmg]Forbidden[/b:3u5o1zmg]
You don’t have permission to access /sababros/Download/fPlayer105_beta6src.zip on this server.

Ah found it: right click and “Save target as…”

  • You must to post comments
0
0

Just to be complete, if you need it download also the binaries with the setup: http://web.tiscali.it/sababros/Download … _beta6.exe

  • You must to post comments
0
0

You can use vis/dsp (including shoutcast, i hope) with the master blackshard’s vb code injected into a C dll :

http://starnetasso.free.fr/Upload/VisWinampTest.rar

The sourcecode of the dll can be found here :

http://starnetasso.free.fr/Upload/fmodW … insSrc.rar

Hope it ll help you ๐Ÿ˜›

  • You must to post comments
Showing 11 results
Your Answer

Please first to submit.