[Plugin] SA:MP Internet Radio Station
#1

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
Reply
#2

Good work! Thanks..
Reply
#3

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

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

Quote:

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

Only insternet radio server

Just translate problems
Reply
#6

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

Yes. This is a standalone server
Reply
#8

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

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
Reply
#10

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

awesome work
Reply
#12

Good work! See my comment in rus.
Reply
#13

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.
Reply
#14

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.
Reply
#15

New Version uploaded.

Quote:

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

Reply
#16

Sounds interesting.
Reply
#17

omgf really a broadcaster in samp !!wow
this is epic
Reply
#18

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

and path in OnListenerConnect(listener[],path[]);
Reply
#19

wow very interesting and good work!
Reply
#20

Can you make a function to Pause sound ?
Reply


Forum Jump:


Users browsing this thread: 1 Guest(s)