[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. |
Re: [TF2] Karaoke
Could be because Windows Media Player isn't installed or was muted or ... something.
When I tested this back when Crabmod was still pretty cool, the only issue was timing, so I'm not sure what's going wrong. |
Re: [TF2] Karaoke
Can't this technically work with any game? I mean you can replace the announcer voices with something else or not include it.
|
Re: [TF2] Karaoke
Yes, it can. I'm planning on having it detect if it's TF2 before playing sounds so it can be more mod-independent.
This, along with a /kvote command that allows an admin to start a vote with 6 random songs, will be added when I can get around to updating it. Seems like there aren't any problems so far so I don't think there are any bugs I need to squash. Maybe I can add /kstop and a (somewhat buggy) mid-song /vol changer too. |
Re: [TF2] Karaoke
I'm definetely going to try this out in the next couple days.
|
Re: [TF2] Karaoke
Works great. I have it running on the server... Karaoke Fridays here we go.
|
Re: [TF2] Karaoke
Seems great, but... Is the php file + backgroundMOTD really the only way to play a sound?
|
Re: [TF2] Karaoke
Quote:
|
Re: [TF2] Karaoke
Quote:
|
Re: [TF2] Karaoke
Questions:
Is the preload=1 argument used in the mod? I see it in play.php, but the mod seems to use <mp3>?v=5 for precaching. Does the mod respect the [offset] tag in lrc files? What about the [02:28][01:21][01:15]Some repeating line format? Minilyrics (nagware) seems to be good for finding/editing/syncing .lrc files, btw. |
Re: [TF2] Karaoke
Quote:
Quote:
Quote:
|
Re: [TF2] Karaoke
Seem to be getting this sometimes
Code:
L 09/12/2009 - 12:32:14: [SM] Native "GetArrayString" reported: Invalid index 74 (count: 0) |
Re: [TF2] Karaoke
Are those lyrics from Touhou?
|
Re: [TF2] Karaoke
Quote:
It isn't a major error, so I'm saving the fix for the next update. Quote:
Quote:
|
Re: [TF2] Karaoke
I am having trouble getting the mod to work. When I run sm_slay /karaoke it says [SM] No matching client was found.
[01] SourceMod (1.2.2-dev) by AlliedModders LLC [02] TF2 Tools (1.2.2-dev) by AlliedModders LLC [03] BinTools (1.2.2-dev) by AlliedModders LLC [04] SDK Tools (1.2.2-dev) by AlliedModders LLC My plugins "Admin File Reader" (1.2.2-dev) by AlliedModders LLC "Admin Help" (1.2.2-dev) by AlliedModders LLC "Admin Menu" (1.2.2-dev) by AlliedModders LLC "Anti-Flood" (1.2.2-dev) by AlliedModders LLC "Basic Ban Commands" (1.2.2-dev) by AlliedModders LLC "Basic Chat" (1.2.2-dev) by AlliedModders LLC "Basic Comm Control" (1.2.2-dev) by AlliedModders LLC "Basic Commands" (1.2.2-dev) by AlliedModders LLC "Basic Info Triggers" (1.2.2-dev) by AlliedModders LLC "Basic Votes" (1.2.2-dev) by AlliedModders LLC "Fun Commands" (1.2.2-dev) by AlliedModders LLC "Fun Votes" (1.2.2-dev) by AlliedModders LLC "Karaoke" (1.0) by EnigmatiK "MapChooser" (1.2.2-dev) by AlliedModders LLC "Nextmap" (1.2.2-dev) by AlliedModders LLC "Map Nominations" (1.2.2-dev) by AlliedModders LLC "Player Commands" (1.2.2-dev) by AlliedModders LLC "Reserved Slots" (1.2.2-dev) by AlliedModders LLC "Rock The Vote" (1.2.2-dev) by AlliedModders LLC "Sound Commands" (1.2.2-dev) by AlliedModders LLC |
Re: [TF2] Karaoke
Quote:
|
Re: [TF2] Karaoke
Quote:
I placed the play.php and songs into /var/www/html/karaoke would that be correct? My karaoke.txt points to http://myip/karaoke/play.php Do you have any ideas? Sorry if I am a bit noobish. Thanks -guh |
Re: [TF2] Karaoke
Quote:
Based on your example, I assume the .mp3 files are in the same directory as play.php. If this is true, then look for Code:
http://your.mp3.host/karaoke/ Code:
http://myip/karaoke/ |
Re: [TF2] Karaoke
Quote:
Thanks I got it working now!! Stupid question I suppose theres no easy way to generate the .lrc besides doing it all by hand? Thanks again -guh |
Re: [TF2] Karaoke
Quote:
|
Re: [TF2] Karaoke
It needs a stop button
|
Re: [TF2] Karaoke
For some reason I can only get one song working. I made sure the .lrc and mp3 are titled the same. Any ideas?
|
Re: [TF2] Karaoke
Trying to get someone to test some of the stuff I've added to Karaoke but if I can't find anyone by tomorrow then I'll just post it here for testing before changing the OP.
Quote:
Quote:
Quote:
Quote:
For the former, check error logs for problems with reading the .lrc. For the latter, try manually going to Code:
http://myip/karaoke/play.php?v=100&s=<song filename without .mp3> |
Re: [TF2] Karaoke
Quote:
|
Re: [TF2] Karaoke
Quote:
I think I got it I changed file permissions and turned off selinux. I noticed one thing once I got the songs playing. When I excute /karaoke command I hear the song very faintly playing in the background as the timer counts down from 20. Once the timer hits 0 the song restarts and plays with lyrics. -guh |
Re: [TF2] Karaoke
Don't know enough about pawn scripting to do a good job, but thought I'd post the changes I'm currently using.
Disabled the 20 and 10 second time messages, turned the pre-karaoke volume down to 1, and changed the format for the offset tag from [of:seconds] to [offset:milliseconds] to match .lrc files I've downloaded. http://pastebin.com/pastebin.php?diff=m6fb87fc8 |
Re: [TF2] Karaoke
Quote:
Hearing it before the countdown is over is just a side-effect of my precache method. Billiam's edits below have made it less audible. Quote:
I will keep your precache volume, since it may have just been a placebo effect. The new offset algorithm confuses me. It makes more sense for the offset to be added to all the times instead of subtracted, and I have no idea where the 0.75 comes from. The lyrics are supposed to display a little earlier than they occur in the song so that people can better prepare for the next line, so you should not be compensating for that. Going to add precache volume and millisecond offsets as well as mid-song /vol changing tonight. |
Re: [TF2] Karaoke
Quote:
The offset thing, though, I am. Not because it makes more sense for the mod, but because that format for the offset seems to be the standard way to handle an offset in an .lrc file. http://en.wikipedia.org/wiki/LRC_%28file_format%29 |
Re: [TF2] Karaoke
Quote:
[offset:+/- Overall timestamp adjustment in milliseconds, + shifts time up, - shifts down] To me, time is simply a numeric value, so shifting time "up" means adding to it. This way, you'll end up adjusting the timestamps by what you put and not the reverse of what you put; that is, you'd adjust by -500ms because you put [offset:-500] instead of [offset:500]. However, after many failed attempts to get a working .lrc player from Wiki's links, I got MiniLyrics to successfully load a test song and can verify that offset is indeed subtracted, so I will incorporate this and make note of it in the OP. Thanks for bringing this to my attention. I'll also add an extra 0.5 to the lyrics and see what the responses (if any) are. Currently working on sorting by album, artist, and title for people with massive song libraries, so this update is taking a little longer than I thought. |
Re: [ALL] Karaoke
Update posted so that you guys won't have to wait while I struggle with sorting the songs.
Got someone to test most of it, but there have been quite a few changes since that test so I'll need help debugging once again. play.php were updated as well, so you'll need to get a new copy of that too. |
Re: [ALL] Karaoke
Fixed a gigantic bug where Karaoke wouldn't play songs, so I'm sorry to the dozen that downloaded it. Was hoping at least one of you would mention it here.
Also added sorting, but I'm pretty sure that's broken as well and needs testing. Oh well, at least Karaoke actually works now. |
All times are GMT -4. The time now is 22:30. |
Powered by vBulletin®
Copyright ©2000 - 2024, vBulletin Solutions, Inc.