Raised This Month: $ Target: $400
 0% 

[Very hard] How to modify FragRadio for your own music


Post New Thread Reply   
 
Thread Tools Display Modes
Author Message
Celty
Junior Member
Join Date: Jun 2015
Old 06-25-2015 , 19:43   [Very hard] How to modify FragRadio for your own music
Reply With Quote #1

Note:
This tutorial is by no means easy, it can take time for people not homed with linux and can be frustrating when doing it. Message me and i can help out, if you want me to do it for you message me about that.

I am also sorry about the sheer mass of this tutorial, im going to attempt to make a script to do it auto-magic-ly sometime this week.

Things needed:
Preferably a linux server (This can be a cheap vps, in the tutorial i use debain 7 for my distro)
A copy of the FragRadio Plugin (Found here: http://fragradio.com/plugins)

Optional:
Notepad++
youtube-dl (you can apt-get this)


Step 1, Installing MPD:

Here is a run down:
apt-get update
apt-get install mpd


Here is the installation process on the wiki in case you run into issues: http://mpd.wikia.com/wiki/Install

Step 2, Editing MPD:
Open /etc/mpd.conf with your favorite text editor (i use nano)
nano /etc/mpd.conf

Next find the line containing "An example of a shout output (for streaming to Icecast):" it should be at or around line 221 in the configuration file.

Comment any lines in a un-commented audio_output block:


Next uncomment the audio_output block for icecast:


change "hackme" with your password you want to use the rest should be fine to leave as is.
save the file (control + o) with nano

Step2, Installing IceCast2:
You should be able to use apt-get to download/install it (apt-get install icecast2)
After doing so open the config file located at: /etc/icecast2/icecast.xml

In the file find the authentication block:


Make sure you change at LEAST your passwords. Save them for later aswell.
That should be it with icecast


Step3, Installing PitchFork:
PitchFork will be used for controlling what music is playing at what volume, the playlists you have etc.
Install prerequisites: apt-get install apache2 mysql-server libapache2-mod-php5 php5 php5-mysql php5-gd php5-pear

Next Download PitchFork itself from: http://sourceforge.net/projects/pitchforkmpd/
After unpacking the file make sure you place it in your web directory (/var/www/ for debain/ubuntu distros)

Make sure to give the correct permissions to your PitchFork interface:
chown -R apache:apache /var/www
chmod -R 777 /var/www/config


Replace "apache:apache" with whatever your http servers username is (I.E. if your apaches username was: www-data, you would replace apache:apache with www-data:www-data)

Then restart apache, mpd and icecast2: /etc/init.d/apache2 restart & /etc/init.d/mpd restart & /etc/init.d/icecast2 restart

then goto your PitchFork in your browser, mine was in the main directory.
After that find and click "Configure" in the top right corner.

Then check to make sure everything is connected.

By Default your mpd port should be 6600 so don't change anything you may not know about.
You can also create a password for PitchFork by navigating back to the configure page and finding "Login Password (optional)", then entering your password and pressing save at the bottom of the page.

Step 4, We are ALMOST done.
Now we want to add some music, songs go into the directory: /var/lib/mpd/music
Remember youtube-dl? well if you installed it then you can download youtube videos straight to your server and they will be converted to sound only, use this command to do so: youtube-dl https://www.youtube.com/watch?v=O5_LSaVB8So -x --audio-format wav

if you replace the youtube video link with a playlist it should download and convert the whole playlist.

It should save the youtube as a .wav into the directory your in, so do it in the music folder.

We are now going to go back to pitchfork, in the index of pitchfork you should see a folder icon on the left of the screen, click it something like this should show up:


press "Update DB", this will grab the songs from that music folder, then click "Filesystem".
It should now look like this:


Make sure the volume bar is all the way up then double click a song and make sure its running on the top of the page.




As it is running goto your icecast web-page this should be located at:
YOURSERVERIP:8000 (ie 1.1.1.1:8000)
Just open this in your browser.
You should now see this:


Right click the "m3u" hyperlink and copy the link location from it.
It should be similar to this: http://127.0.0.1:8000/mpd.ogg.m3u

Now we gotta go get the player itself, head over to https://www.muses.org/setup
for the "Stream url enter in http://127.0.0.1:8000/mpd.ogg" See how the ".m3u" extension was removed? good...

Select the audio codec as "OGG", then use any skin you like. and put a random Stream name, remember to select "Auto Play" and to select "I want to host the player and skin files on my server" under Installation Method.



press generate code and copy the code that appears on the bottom of the screen.


Save that in a text editor for now, we will need it in a bit.

At the bottom of the same page you should see:


Download and upload this to your apache server on the machine. unpack it and just stick it in some random folder in the www directory. (or just put it in the main www directory like i did)

Next download that little green block that says you NEED to download the skin, because you need to download it obviously..


Just right click the zip file, save the link and curl it up onto your server.
put it in the same directory as your muses player.

Ok, go back to the code you saved in notepad, we are going to change 2 values, locate "volume=100", and replace 100 with: <?php echo $_GET['vol'] ?>
It should look something like: "volume=<?php echo $_GET['vol'] ?>"
There will be 2 occurrences of "volume=100" replace both!

Save this newly create file as "music.php" or something, i dont care.. just make sure its in the same directory as the player and the skin.

Next, make sure a song is playing in pitchfork, if so. Visit http://127.0.0.1/fuck.php?vol=40
Change the value of the "vol" varible around (1-100) to make sure its working.

OK WE ARE SO CLOSE TO BEING DONE AND MY FINGERS ARE HURTING. I need to smoke so let me go do that.

OK open fragradio.sp and find and change these lines:
g_hCvarStreamHost = CreateConVar("fr_stream_host"
where you see the server ip replace it with yours.


Also change this line:
g_hCvarWebPlayerScript = CreateConVar("fr_webplayer_script"
replace it with the path to your music player's php file.

Step something, YOU DID IT
Compile the plugin with compile.sh or some other compiler, make sure you have the files for frag radio already installed in sourcemod before you do this.

just replace the compiled fragradio.smx with the old one and BAM. its done,
use !radio to tune in C:
Celty is offline
asherkin
SourceMod Developer
Join Date: Aug 2009
Location: OnGameFrame()
Old 06-26-2015 , 10:23   Re: [Very hard] How to modify FragRadio for your own music
Reply With Quote #2

It doesn't look like there is any reason to edit the FragRadio plugin - just change those cvars in a config file.
Editing the default value for a cvar is not a reliable way to change it for normal use, as it won't cause it to be recreated if the plugin is already loaded.
__________________

Last edited by asherkin; 06-26-2015 at 10:23.
asherkin is offline
Celty
Junior Member
Join Date: Jun 2015
Old 06-26-2015 , 10:35   Re: [Very hard] How to modify FragRadio for your own music
Reply With Quote #3

Quote:
Originally Posted by asherkin View Post
It doesn't look like there is any reason to edit the FragRadio plugin - just change those cvars in a config file.
Editing the default value for a cvar is not a reliable way to change it for normal use, as it won't cause it to be recreated if the plugin is already loaded.
Well when i tried to do that it would not work.
Celty is offline
Celty
Junior Member
Join Date: Jun 2015
Old 06-26-2015 , 10:39   Re: [Very hard] How to modify FragRadio for your own music
Reply With Quote #4

But then again i barely know anything about the source mod scripting language, i have not really read into it enough yet.
Celty is offline
DJ Data
SourceMod Donor
Join Date: Dec 2012
Location: Switzerland
Old 06-28-2015 , 18:35   Re: [Very hard] How to modify FragRadio for your own music
Reply With Quote #5

Very nice tutorial.
Thanks for putting so much hard work into figuring this out!
__________________
SourcePawn Coding Level: Novice
DJ Data is offline
Reply



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

Forum Jump


All times are GMT -4. The time now is 18:36.


Powered by vBulletin®
Copyright ©2000 - 2024, vBulletin Solutions, Inc.
Theme made by Freecode