09.03.2012, 07:13
(
Last edited by jhonyxakep; 11/03/2012 at 01:48 AM.
)
Server Broadcaster
Ver 1.6.0Author: 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.xxx

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://server

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