SA-MP Forums

Go Back   SA-MP Forums > SA-MP Scripting and Plugins > Plugin Development

Reply
 
Thread Tools Display Modes
Old 09/03/2012, 08:13 AM   #1
jhonyxakep
Gangsta
 
jhonyxakep's Avatar
 
Join Date: May 2011
Location: Russia, Vladivostok
Posts: 777
Reputation: 43
Thumbs up SA:MP Internet Radio Station

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: http://forum.sa-mp.com/showthread.php?p=1720525
Attached Files
File Type: zip RadioRelease.zip (827.7 KB, 673 views)

Last edited by jhonyxakep; 11/03/2012 at 02:48 AM.
jhonyxakep is offline   Reply With Quote
Old 09/03/2012, 08:19 AM   #2
iZN
High-roller
 
iZN's Avatar
 
Join Date: Jun 2010
Location: Japan
Posts: 2,092
Reputation: 351
Default Re: SA:MP Internet Radio Station

Good work! Thanks..
iZN is offline   Reply With Quote
Old 09/03/2012, 08:27 AM   #3
iPLEOMAX
High-roller
 
iPLEOMAX's Avatar
 
Join Date: Mar 2011
Location: Al Ain, UAE. Homeland: Bangladesh.
Posts: 1,312
Reputation: 709
Default Re: SA:MP Internet Radio Station

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

Last edited by iPLEOMAX; 09/03/2012 at 09:13 AM.
iPLEOMAX is offline   Reply With Quote
Old 09/03/2012, 08:37 AM   #4
Markô
High-roller
 
Markô's Avatar
 
Join Date: Apr 2011
Location: Ile-de-France
Posts: 1,792
Reputation: 431
Default Re: SA:MP Internet Radio Station

So this plugin would turn a samp server into a shoutcast/icecast server ?
__________________
Markô is offline   Reply With Quote
Old 09/03/2012, 08:53 AM   #5
jhonyxakep
Gangsta
 
jhonyxakep's Avatar
 
Join Date: May 2011
Location: Russia, Vladivostok
Posts: 777
Reputation: 43
Default Re: SA:MP Internet Radio Station

Quote:
So this plugin would turn a samp server into a shoutcast/icecast server
Only insternet radio server

Just translate problems
jhonyxakep is offline   Reply With Quote
Old 09/03/2012, 09:35 AM   #6
Markô
High-roller
 
Markô's Avatar
 
Join Date: Apr 2011
Location: Ile-de-France
Posts: 1,792
Reputation: 431
Default Re: SA:MP Internet Radio Station

So the server owner would be able to broadcast music too like a shoutcast radio station does ?
__________________
Markô is offline   Reply With Quote
Old 09/03/2012, 09:53 AM   #7
jhonyxakep
Gangsta
 
jhonyxakep's Avatar
 
Join Date: May 2011
Location: Russia, Vladivostok
Posts: 777
Reputation: 43
Default Re: SA:MP Internet Radio Station

Yes. This is a standalone server
jhonyxakep is offline   Reply With Quote
Old 09/03/2012, 12:12 PM   #8
wups
High-roller
 
wups's Avatar
 
Join Date: Apr 2010
Location: Lithuania
Posts: 1,369
Reputation: 132
Default Re: SA:MP Internet Radio Station

Why is this needed? What Pro's do you see holding a radio station on a sa-mp server?
wups is offline   Reply With Quote
Old 09/03/2012, 01:01 PM   #9
jhonyxakep
Gangsta
 
jhonyxakep's Avatar
 
Join Date: May 2011
Location: Russia, Vladivostok
Posts: 777
Reputation: 43
Default Re: SA:MP Internet Radio Station

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
jhonyxakep is offline   Reply With Quote
Old 09/03/2012, 01:15 PM   #10
PawnFox
Huge Clucker
 
PawnFox's Avatar
 
Join Date: Feb 2012
Location: Europe/Romania
Posts: 245
Reputation: 12
Default Re: SA:MP Internet Radio Station

Awesome work, i will test this later Keep it up :P
__________________
PawnFox is offline   Reply With Quote
Reply

Thread Tools
Display Modes

Posting Rules
You may not post new threads
You may not post replies
You may not post attachments
You may not edit your posts

BB code is On
Smilies are On
[IMG] code is On
HTML code is Off


Similar Threads
Thread Thread Starter Forum Replies Last Post
San Andreas Radio Station audio not working Diego_Martinz Client Support 4 13/06/2012 01:55 PM
How do i play this radio station? emokidx Scripting Help 3 19/02/2012 01:27 PM
Create connection to radio station vection Help Archive 0 31/08/2010 11:47 AM
[HELP PL0X] Radio station. tehroxor Client Support 7 11/02/2010 04:44 PM


All times are GMT. The time now is 02:15 PM.


Powered by vBulletin® Version 3.8.6
Copyright ©2000 - 2014, Jelsoft Enterprises Ltd.