SA-MP Forums Archive
[Plugin] SA:MP Internet Radio Station - Printable Version

+- SA-MP Forums Archive (https://sampforum.blast.hk)
+-- Forum: SA-MP Scripting and Plugins (https://sampforum.blast.hk/forumdisplay.php?fid=8)
+--- Forum: Plugin Development (https://sampforum.blast.hk/forumdisplay.php?fid=18)
+--- Thread: [Plugin] SA:MP Internet Radio Station (/showthread.php?tid=324349)

Pages: 1 2 3


SA:MP Internet Radio Station - jhonyxakep - 09.03.2012

Server Broadcaster
Ver 1.6.0
Author: jhonyxakep
Mail:jhonyxakep@qip.ru
ICQ:354794596
Jabber:jhonyxakep@qip.ru

Description:

This plugin allows you to turn the server SA:MP in full online radio station


The plugin uses the BASS library (http://un4seen.com) to work with audio files.

Installation:

Put the files from the plugins in the plugins folder on the server.

Windows:
Files from system\win\ directory should be placed in the root directory of the server (the ones where the samp-server.exe), or the windows system directory

*nix:
Files from system\nix\ should be put in the folder /lib/, /usr/lib/, /usr/local/lib/.


Add the plug-in in plugins section in SA: MP config.

Include radio.inc to your script.


[B] For *nix you must install stdin/stdout encoder (Lame for mp3. Installing Lame for Debian/Ubuntu: apt-get install lame) [/ B]


Use:


Plugin functions:

PlaySoundFileToStream(file[]); - add file to stream
PlaySoundUrlToStream(file[]); - add Url to stream
IsServerActive(); - Is Server Active true/false
StopPlaying(); - delete current file from stream
SoundServerStart(commandline[],port[]); - Start the server
SoundServerStop(); - Stop the server

KickListener(listener[]); - kick listener and call OnListenerDisconnect
SetStationNameURL(name[],URL[]); - sets Station name, and site URL.

To start the server use SoundServerStart.
First argument - encoder command line. For MP3 cast use (44100 Hz, 128 kb/sec) "lame -r -s 44100 -b 128 –"

Second argument - the IP address and port number to accept client connections on... "xxx.xxx.xxx.xxxort",
or port only.
If you want start Server on 8000 port just use "8000".

After starting the server, the file must be added to the stream by function PlaySoundFileToStream/PlaySoundUrlToStream.
file - MP3, OGG, WAV, AIFF files, which will be played on the stream.

WARNING! You must call StopPlaying before add new file to stream

Функция SoundServerStop останавливает сервер.

Callbacks:

OnSoundFileEnd(); - Called when the reached the end of the current file, or can not play more

Changed:

OnListenerConnect(listener[],path[]); - on new listener connected. Listener contain ip : port of listener. Path - URL part after http://serverort/
OnListenerDisonnect(listener[]); - on listener disconnected



Attachment = Include + Example Script + linux and windows version of plugin + Source code

Download:

in attachment

Sorry for my bad English.

Original post: https://sampforum.blast.hk/showthread.php?pid=1720525#pid1720525


Re: SA:MP Internet Radio Station - iZN - 09.03.2012

Good work! Thanks..


Re: SA:MP Internet Radio Station - iPLEOMAX - 09.03.2012

I suffered a lot when I was trying to make such a plugin. But, really, a great help! Thanks!!


Re: SA:MP Internet Radio Station - Mark™ - 09.03.2012

So this plugin would turn a samp server into a shoutcast/icecast server ?


Re: SA:MP Internet Radio Station - jhonyxakep - 09.03.2012

Quote:

So this plugin would turn a samp server into a shoutcast/icecast server

Only insternet radio server

Just translate problems


Re: SA:MP Internet Radio Station - Mark™ - 09.03.2012

So the server owner would be able to broadcast music too like a shoutcast radio station does ?


Re: SA:MP Internet Radio Station - jhonyxakep - 09.03.2012

Yes. This is a standalone server


Re: SA:MP Internet Radio Station - wups - 09.03.2012

Why is this needed? What Pro's do you see holding a radio station on a sa-mp server?


Re: SA:MP Internet Radio Station - jhonyxakep - 09.03.2012

Quote:

Why is this needed? What Pro's do you see holding a radio station on a sa-mp server?

Why not? I think the use of this plug-in opens new possibilities for RP servers


Re: SA:MP Internet Radio Station - PawnFox - 09.03.2012

Awesome work, i will test this later Keep it up :P


Respuesta: SA:MP Internet Radio Station - [Nikk] - 09.03.2012

awesome work


Re: SA:MP Internet Radio Station - AirKite - 09.03.2012

Good work! See my comment in rus.


Re: SA:MP Internet Radio Station - wups - 09.03.2012

I think it would be better to connect and control an audio server as admin(if that is possible, i'm not really into radio stations).
Why not? SA-MP is for San Andreas, not some Radio stream. Plus, you lose efficiency, some resources(instead of using a standalone radio server), and you risk stability.


Re: SA:MP Internet Radio Station - jhonyxakep - 09.03.2012

Quote:

Plus, you lose efficiency, some resources(instead of using a standalone radio server), and you risk stability.

But it's easier and more convenient. Radio server uses more resources. Stability is not always higher.


Re: SA:MP Internet Radio Station - jhonyxakep - 11.03.2012

New Version uploaded.

Quote:

Add KickListener(listener[]) function
Add SetStationNameURL(name[],URL[]) function
Change OnListenerConnect callback




Re: SA:MP Internet Radio Station - Nicholas. - 11.03.2012

Sounds interesting.


Re: SA:MP Internet Radio Station - Niko_boy - 11.03.2012

omgf really a broadcaster in samp !!wow
this is epic


Re: SA:MP Internet Radio Station - AirKite - 11.03.2012

Thank you very much, for:
pawn Код:
KickListener(listener[]);
SetStationNameURL(name[],URL[]);

and path in OnListenerConnect(listener[],path[]);



AW: SA:MP Internet Radio Station - C0dy09 - 11.03.2012

wow very interesting and good work!


Re: SA:MP Internet Radio Station - QuaTTrO - 11.03.2012

Can you make a function to Pause sound ?