[ALL] Karaoke
2 Attachment(s)
Requirements
- clientprefs. This plugin saves players' volume and offset settings for their convenience. - setup. It’s going to take you quite a bit of time to get everything working. - web server with PHP. Songs are played through HTML MOTDs, so you’ll need to be able to serve the PHP pages. - file host. You need somewhere to put the songs, of course. This can be the same as the web server if you’d like. - MP3 files. This is the most common, lossy codec available, so we’re going with these. Small filesizes are better, so the bit rate should be at most 128 kbps. - LRC files. The plugin uses these for song information (title, artist, etc.) and, well, lyrics. Got these? Good. Now on to installation! Installation 1) You will need a public place to store the audio files (see "file host" above). You can use your webhost if you like. All music must be placed in one folder. Remember the URL of this folder for later steps. 2) You will need a web server with PHP. Upload the contents of Karaoke_www.zip and remember the URL for "play.php". You must edit this file! You need to specify the URL of the audio folder from step #1. The line which you should edit is clearly marked; be sure not to change anything else unless you know what you are doing. 3) Download the attached plugin (click "Get Plugin" for the .smx) and place it in addons\sourcemod\plugins 4) Create the following file: addons\sourcemod\data\karaoke.txt The first line should contain the URL for play.php from step #2. 5) Create the following folder: addons\sourcemod\data\karaoke\ In this folder should be .lrc files with names that match the .mp3 files on your server. For example, if you have a file called LonelyIsland_LikeABoss.lrc, the matching MP3 file should be called LonelyIsland_LikeABoss.mp3 or else it will not work. For more information on .lrc files, see below. 6) In-game and as an admin with the slay flag, type /k or /karaoke and a menu should pop up listing songs found in your karaoke folder. If a song is not there, check error logs, as there may be a problem with the .lrc file. Alternatively, you can type /kvote and up to six songs will be randomly chosen for you to choose. The song with the most votes after 20 seconds will be selected. 7) The announcer should count down from 20 seconds with an accompanying centertext explaining that you may change your volume with /vol #. While this happens, players may hear the song faintly in the background, as this is an attempt to preload the song so that it won't be too out of sync. Another command is /offset, which allows you to change how much later or earlier the music and lyrics will display. Type /offset for more instructions on how to use it. 8) The music should play, and if the .lrc file was written well, the centertext-ed lyrics should display with the music. The timing should not be too far off, as the lyrics are meant to display earlier than they occur in the music so that singers have time to prepare for the next line, but there still may be some cases of the music playing too late. I will see if there are any ways of fixing this. 9) That's it! Enjoy singing along while killing people! Commands
.lrc Files The beginning of a .lrc file should contain metadata for the song. These are in "tags", which are of the following format: [tag:information] Possible .lrc tags that can be used include:
Following this should be lines with timestamps and text, like so: [0:12.34]Hello, world! For the above line, 12.34 seconds after the song starts, "Hello, world!" will display on the screen. If there is a line after it, "Hello, world!" will stay on screen until the next line. If you do not want this to happen, you can just put nothing after a timestamp for a blank line. If you want to use newlines, you can use either \n or | as a newline delimiter. UTF-8 .lrc files are supported, as the plugin will remove the BOM (\xEF\xBB\xBF). However, I'm not sure what else will or won't work, so you will have to find out for yourself. For examples of .lrc files that work with Karaoke, you can see my works here. Changelog 19 September 2009 - 1.2 - The plugin actually works again. - Songs menu now lets you sort by artist, title, or album. - Fixed bug where the song would not be considered "finished" when it was. 17 September 2009 - 1.1 - No longer dependent on TF2. - Music offset limits changed to ±5.0 seconds. - Lyrics now play 0.5 seconds later than before. - /vol now changes volume mid-song at the cost of some desyncing. - Added two new commands: /kstop and /kvote. Both require the slay flag. - Fixed an error message when attempting to show lyrics after the song is over. - "of" tag changed to "offset"; now represents milliseconds to be subtracted from timestamps. --- Note: This is nowhere near as secure as SirLamer's Jukebox plugin. You have been warned. You claim responsibility by installing this plugin. If you'd like to contribute a patch for this (or anything), I'd be happy to include it. |
Re: [TF2] Karaoke
Haha, you're awesome!
I will certainly be testing this :) |
Re: [TF2] Karaoke
Yeah, I'll test it as soon as possible.
Lots of our players wanted a karaoke plugin. |
Re: [TF2] Karaoke
Hmm. A few more notes on stuff:
In .lrc parsing, newlines are denoted by either | or \n Lines are persistent (they will remain on screen until another line is displayed). Blank lyric lines will force it to go away. These two features mean you can make .lrc files like a boss: Code:
[ar:The Lonely Island] Volume and offsets only change before the song starts. Only /vol 0 has any immediate effects. I plan to implement mid-song volume changing soon. This stuff will probably be added to the OP if this plugin actually goes anywhere. |
Re: [TF2] Karaoke
If you Disable HTML MOTDs you won't be able to hear the music, but I think it's not fixable. Anyway it's not a big problem.
|
Re: [TF2] Karaoke
Couple of questions, but first of all thank you!!
1. Is there anyway to stop Karaoke once it has started? I think I screwed something up with my lrc file, and the music didn't start playing, but it keeps saying, "Please wait until the song is done", when I do /karaoke. 2. I keep the lrc files in the sourcemod/data/karaoke folder, where do I keep the music? Right now I have the play.php on a webserver, and I edited the php file to point to the same folder that it is in, where the MP3's are at. Am I doing this right? 3. This isn't specific to your plugin, but I figured I could stop karaoke if I do a sm plugins unload_all and then reload everything, but... anytime I do a sm plugins unload_all or any sm plugins * command, all it does is list the plugins I have installed. Any ideas? |
Re: [TF2] Karaoke
Quote:
Quote:
If the music doesn't play, then there's probably one of two problems. Either your have HTML MOTDs disabled (see above) or the mp3s aren't in the right place (see below). Quote:
In sourcemod/data/karaoke.txt (the text file) should be a line containing the URL to your play.php. For example, we'll use Code:
http://www.example.com/karaoke/play.php The source for that page should have that edited URL somewhere, which, for our example, will be Code:
http://www.filehost.com/andex/karaoke/ So here's a recap. If your sourcemod/data/karaoke/ folder has the following .lrcs
then your folder at http://www.filehost.com/andex/karaoke/ should contain:
Then you should be fine. For anyone who's wondering, I didn't use a cvar for the URL because Source has problems with putting URLs in cvars (at least for me). Quote:
Code:
sm plugins reload Karaoke |
Re: [TF2] Karaoke
Someone should make a pack of awesome songs :D
|
Re: [TF2] Karaoke
I don't mind making .lrc files as long as I'm not expected to make them immediately.
Perhaps someone could make a list and I can get started. |
Re: [TF2] Karaoke
I have uploaded the ones (lrc's) I have:
http://www.troubleshootcode.com/public On my server, some people hear the music some people don't.. I don't hear the music, but others do. I do not have disable MOTD on either. |
All times are GMT -4. The time now is 13:05. |
Powered by vBulletin®
Copyright ©2000 - 2024, vBulletin Solutions, Inc.