I want to play an audio file using fmod, and at the same time send it to a ShoutCast server. On a remote client, I want to get the stream from the ShoutCast server. Pretty straightforward, but I’m not clear on the mechanics.
On my host, I have a ShoutCast server running. I also have the audio file playing via the fmod APIs:
_stream = FSOUND_Stream_Open(“c:\boing.mp3”, FSOUND_HW2D, 0, 0);
_channel = FSOUND_Stream_Play(FSOUND_FREE, _stream);
I want to send this same audio file to my ShoutCast server that is running on the same machine that the file is playing on. I’m not clear on the syntax for sending this stream to the ShoutCast server.
Then, on a remote system, I want to receive the audio stream from the ShoutCast server. I’m not clear on the syntax for opening this stream on the remote client.
On both the host system and on the remote client I will be able to know the IP address and port for the ShoutCast server.
Can someone help me with the mechanics of this operation? Please?
Thanks in advance. This is an adventure.
- prince asked 14 years ago
Brett had suggested this approach for getting me from point A to point B. So, assuming that there is a way to get it “to” the ShoutCast server, do you have the other end syntax for me for receiving a stream from a ShoutCast server? It really is 2 problems so solving this one is half of my battle. Thanks lorien.
Read the “netstream” example – it shows how to receive a stream from a SHOUTcast, Icecast or HTTP server. To get your stream TO the server you may want to use a winamp plugin – check out the one KarLKoX wrote:
Try to be patient with the newbie…
You mention a “netstream” example. Where can I find this example. I searched the fmod 3.7 documentation and this forum and can’t find it.
Also, the posting by KarlKoX provides a file called Winamp-FMOD.rar. I don’t really know what an “rar” file is, or how to plug it in to FMOD. I’m running this on WIindows right now, but later I’ll be porting it to Linux.
Thanks for all the help so far. I need a little more…
I downloaded the plugin stuff from KarlKoX, but there is no documentation and all of the code is in Basic and Delphi (which looks like Pascal). I haven’t written in these so I can’t read it well enough to figure out what it is doing.
Has anyone plugged this in using Visual C++? I have an application that plays audio using fmod, and I want to send the same audio to a shoutcast server running on the same machine. Can someone walk me through this? I’ve never worked with plugins before. I’m also not clear on why this is called a “winamp” plugin. Like, does this connect fmod to winamp, which then connects to a shoutcast server? Or does it just use a dll with the winamp name to connect fmod to a shoutcast server?
KarLKoX’s stuff allows you to use winamp plugins in your FMOD program. This means that you should be able to use the SHOUTcast winamp plugin to send data to a SHOUTcast server from your FMOD program. I’ve never used KarLKoX’s stuff before but I’m sure it works just fine from C/C++.
I suggest you check out [url:3rmvtph6]http://www.shoutcast.com[/url:3rmvtph6], use google to search for stuff relating to winamp plugins and keep studying KarLKoX’s code.
I don’t need them to necessarily “start” at the same time, I just need them to be playing at the same point in the audio file at the same time. or close anyway. So, listener at the transmitter (A) will hear really close to the same point in the audio file as the receiver (B). In general, I just need the receiver (B) to be able to “tune in” at any time. So, if A isn’t sending anything, B tunes into nothing. As soon as A starts playing the audio file and transmitting, B begins hearing what A hears.
So, the ShoutCast paradigm seems like it will work, right?
So, what I’m missing is the mechanics of:
1) sending an audio file from A to the ShoutCast server running on A from a C application. From this C application, I’m currently playing a file like “c:\thingy.mp3” using FMOD. I want to also send this same audio file to the ShoutCast server when I start playing in using FMOD.
2) tuning into the ShoutCast stream (presumably with FMOD) from the C application running on B. In the netstream example, it uses the following to open an audio file:
stream = FSOUND_Stream_Open(argv, FSOUND_NORMAL | FSOUND_NONBLOCKING, 0, 0);
where argv is shown in the syntax for the example as being the string:
I don’t see how the above string relates to whatever is playing on a ShoutCast server at any given time. I would think that it have to be something like:
I have no idea on how the ShoutCast server presents its interface, but there must be some way to have the receiver just say “gimme what you’re playing”, right?
Hopefully the above will shed some light on what I’m trying to do and also on the depth and breadth of my ignorance… 😕
Use KarLKoX’s dll
Go to [url:35s50qc8]http://www.shoutcast.com[/url:35s50qc8] and learn how SHOUTcast servers work and you’ll see that you’ll need to pass a URL to a SHOUTcast stream that will go something like “http://184.108.40.206/mystream.mp3”. That is what you pass to FSOUND_Stream_Open, just like in the netstream example.
Set up a SHOUTcast server, compile the netstream example and point it at your SHOUTcast server and you’ll hear it play. It’s that simple. Just try it.
Please login first to submit.