AlliedModders

AlliedModders (https://forums.alliedmods.net/index.php)
-   Plugins (https://forums.alliedmods.net/forumdisplay.php?f=108)
-   -   [ALL] Karaoke (https://forums.alliedmods.net/showthread.php?t=102670)

Theme97 09-04-2009 21:55

[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
  • /k or /karaoke will pop up a menu that will allow you to choose a sorting method (title, artist, or album), which will then allow you to choose an individual song. Requires SLAY admin flag.
  • /kstop will prematurely end the current song. Lyrics and music should stop playing, and you should be able to pick a new song immediately.
  • /kvote picks 6 random songs and sends a vote to all players. After 20 seconds, the votes are collected and the winning song is played. Requires SLAY admin flag.
  • /offset changes how early or late the song or lyrics will play. This is on a per-client basis and only has effect before a song is chosen. Type /offset for more information.
  • /vol changes the volume of the songs. This is per-client and can be changed mid-song at the cost of possible desyncing.

.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:
  • ti: Song title. This is required.
  • ar: Artist. Also required.
  • al: Album.
  • offset: Offset in milliseconds. The music will be delayed by this much when it is played (e.g. [offset:2000] will display lyrics two seconds earlier). Can be negative.
  • by: .lrc author identification. Not really "supported" since all other tags are ignored, but credit is always nice to have.

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.

Jindo 09-05-2009 03:27

Re: [TF2] Karaoke
 
Haha, you're awesome!

I will certainly be testing this :)

Flyflo 09-05-2009 04:56

Re: [TF2] Karaoke
 
Yeah, I'll test it as soon as possible.
Lots of our players wanted a karaoke plugin.

Theme97 09-05-2009 06:31

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]
[ti:Like a Boss]
[cr:EnigmatiK]
[00:00.46]Mr. Samberg, thanks for coming to your performance review.\n
[00:02.86]\nNo problem.
[00:03.66]So you're in charge around here, is that fair to say?\n
[00:06.06]\nAbsolutely. I'm the boss.
[00:07.86]Okay, so take us through a day in the life of \'The Boss\'.\n
[00:11.06]\nWell the first thing I do is
[00:12.46]Talk to Corporate\n
[00:13.26]Talk to Corporate\nLIKE A BOSS
[00:13.86]Approve memos\n
[00:14.86]Approve memos\nLIKE A BOSS
[00:15.66]Lead a workshop\n
[00:16.46]Lead a workshop\nLIKE A BOSS
[00:17.06]Remember birthdays\n
[00:18.06]Remember birthdays\nLIKE A BOSS
[00:18.66]Direct work flow\n
[00:19.66]Direct work flow\nLIKE A BOSS
[00:20.26]My own bathroom\n
[00:21.26]My own bathroom\nLIKE A BOSS
[00:22.06]Micromanage\n
[00:22.86]Micromanage\nLIKE A BOSS
[00:23.46]Promote synergy\n
[00:24.46]Promote synergy\nLIKE A BOSS
[00:25.26]Hit on Deborah\n
[00:26.06]Hit on Deborah\nLIKE A BOSS
[00:26.86]Get rejected\n
[00:27.66]Get rejected\nLIKE A BOSS
[00:28.46]Swallow sadness\n
[00:29.26]Swallow sadness\nLIKE A BOSS
[00:30.06]Send some faxes\n
[00:30.86]Send some faxes\nLIKE A BOSS
[00:31.66]Call a sex line\n
[00:32.46]Call a sex line\nLIKE A BOSS
[00:33.28]Cry deeply \n
[00:34.06]Cry deeply \nLIKE A BOSS
[00:34.66]Demand a refund\n
[00:35.66]Demand a refund\nLIKE A BOSS
[00:36.46]Eat a bagel\n
[00:37.26]Eat a bagel\nLIKE A BOSS
[00:37.86]Harassment lawsuit\n
[00:38.86]Harassment lawsuit\nLIKE A BOSS
[00:39.66]No promotion\n
[00:40.46]No promotion\nLIKE A BOSS
[00:41.26]Fifth of vodka\n
[00:42.06]Fifth of vodka\nLIKE A BOSS
[00:42.76]Shit on Deborah's desk\n
[00:43.66]Shit on Deborah's desk\nLIKE A BOSS
[00:44.46]Buy a gun  \n
[00:45.26]Buy a gun  \nLIKE A BOSS
[00:46.06]In my mouth\n
[00:46.86]In my mouth\nLIKE A BOSS
[00:47.46]Oh, fuck man, I can't fucking do it, shit!
[00:50.68]Pussy out  \n
[00:51.68]Pussy out  \nLIKE A BOSS
[00:52.48]Puke on Deborah's desk\n
[00:53.28]Puke on Deborah's desk\nLIKE A BOSS
[00:53.88]Jump out the window\n
[00:54.88]Jump out the window\nLIKE A BOSS
[00:55.48]Suck a dude's dick\n
[00:56.48]Suck a dude's dick\nLIKE A BOSS
[00:57.28]Score some coke\n
[00:58.08]Score some coke\nLIKE A BOSS
[00:58.88]Crash my car\n
[00:59.68]Crash my car\nLIKE A BOSS
[01:00.48]Suck my own dick\n
[01:01.28]Suck my own dick\nLIKE A BOSS
[01:02.08]Eat some chicken strips\n
[01:02.88]Eat some chicken strips\nLIKE A BOSS
[01:03.68]Chop my balls off\n
[01:04.48]Chop my balls off\nLIKE A BOSS
[01:05.28]Black out in the sewer\n
[01:06.08]Black out in the sewer\nLIKE A BOSS
[01:06.88]Meet a giant fish\n
[01:07.68]Meet a giant fish\nLIKE A BOSS
[01:08.48]Fuck his brains out\n
[01:09.28]Fuck his brains out\nLIKE A BOSS
[01:10.08]Turn into a jet\n
[01:10.88]Turn into a jet\nLIKE A BOSS
[01:11.68]Bomb the Russians\n
[01:12.48]Bomb the Russians\nLIKE A BOSS
[01:13.28]Crash into the sun\n
[01:14.08]Crash into the sun\nLIKE A BOSS
[01:14.88]Now I'm dead\n
[01:15.68]Now I'm dead\nLIKE A BOSS
[01:16.88]Uh-huh. So, that's an average day for you, then?\n
[01:20.28]\nNo doubt.
[01:21.48]You chopped your balls off and died.\n
[01:23.28]\nHell yeah!
[01:24.68]And I think at, uh, one point there, you said something about sucking your own dick?\n
[01:28.48]\nNope.
[01:29.28]Actually, I'm pretty sure you did.\n
[01:31.08]\nNah, that ain't me.
[01:32.88]Okay, well, this has been eye opening for me.\n
[01:35.48]\nI'm the boss.
[01:36.48]Yeah, no, I got that. You said it about 400 times.\n
[01:39.08]\nI'm the boss.
[01:40.08]Yeah, yeah, I got it.\n
[01:40.88]\nI'm the boss.
[01:41.68]No, I heard you. See you later!\n
[01:44.48]LIKE A BOSS

The song cannot be changed until 5 seconds after the last line. For quick testing, just reload the plugin and restart the song.
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.

Flyflo 09-05-2009 13:25

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.

andex 09-05-2009 13:44

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?

Theme97 09-05-2009 15:46

Re: [TF2] Karaoke
 
Quote:

Originally Posted by Flyflo (Post 923880)
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.

Ah, I'd forgotten about that. I started writing this before that option came out anyway. Oh well, it's better than having to download a whole library of songs upon joining a server.

Quote:

Originally Posted by andex (Post 923904)
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.

Not yet, other than reloading the plugin.

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:

Originally Posted by andex (Post 923904)
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?

Sounds right, but I'll go over it with an example just to make sure.

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
Once that line is saved to the sourcemod/data/karaoke.txt file, Karaoke should be using that URL (though I only added this method after my last chance to test, so I'm not sure if there are any problems with this).

The source for that page should have that edited URL somewhere, which, for our example, will be

Code:

http://www.filehost.com/andex/karaoke/
In this folder should be .mp3 files with names that match your .lrc files.

So here's a recap. If your sourcemod/data/karaoke/ folder has the following .lrcs
  • LonelyIsland_LikeABoss.lrc
  • Portal_StillAlive.lrc
  • RickAstley_NeverGonnaGiveYouUp.lrc

then your folder at http://www.filehost.com/andex/karaoke/ should contain:
  • LonelyIsland_LikeABoss.mp3
  • Portal_StillAlive.mp3
  • RickAstley_NeverGonnaGiveYouUp.mp3

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:

Originally Posted by andex (Post 923904)
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?

I'm not sure why that's happening, but the easiest way to do reload it is simply
Code:

sm plugins reload Karaoke

noodleboy347 09-05-2009 17:52

Re: [TF2] Karaoke
 
Someone should make a pack of awesome songs :D

Theme97 09-05-2009 22:36

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.

andex 09-05-2009 22:48

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.

Theme97 09-05-2009 23:14

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.

willy1234x1 09-07-2009 02:37

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.

Theme97 09-07-2009 23:54

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.

Sexual Harassment Panda 09-08-2009 03:25

Re: [TF2] Karaoke
 
I'm definetely going to try this out in the next couple days.

haet 09-08-2009 16:00

Re: [TF2] Karaoke
 
Works great. I have it running on the server... Karaoke Fridays here we go.

Billiam 09-10-2009 03:33

Re: [TF2] Karaoke
 
Seems great, but... Is the php file + backgroundMOTD really the only way to play a sound?

Jindo 09-10-2009 11:50

Re: [TF2] Karaoke
 
Quote:

Originally Posted by Billiam (Post 928529)
Seems great, but... Is the php file + backgroundMOTD really the only way to play a sound?

Without the player having to download the desired song before playing the next map, yes.

Billiam 09-10-2009 20:50

Re: [TF2] Karaoke
 
Quote:

Originally Posted by Jindo (Post 928809)
Without the player having to download the desired song before playing the next map, yes.

Ahh, got it. Thanks :)

Billiam 09-11-2009 15:27

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.

Theme97 09-12-2009 00:18

Re: [TF2] Karaoke
 
Quote:

Originally Posted by Billiam (Post 930047)
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.

Ah, yeah, leftover code. I tried various methods of precaching, such as muting and v=0, but v=5 seemed to work the best. Maybe I'm just doing it wrong, I dunno.

Quote:

Originally Posted by Billiam (Post 930047)
Does the mod respect the [offset] tag in lrc files?

I'm not sure what the [offset] tag is, but the plugin will read [of:0.5] and, if I remember correctly, delay the lyrics by 0.5 seconds.

Quote:

Originally Posted by Billiam (Post 930047)
What about the
[02:28][01:21][01:15]Some repeating line
format?

Not yet. Maybe if regular expressions start working or if SM gets better string handling, or perhaps if someone submits a patch.

Billiam 09-12-2009 16:14

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)
L 09/12/2009 - 12:32:14: [SM] Displaying call stack trace for plugin "Karaoke.smx":
L 09/12/2009 - 12:32:14: [SM]  [0]  Line 308, Karaoke.sp::timer_displayline()
L 09/12/2009 - 12:32:14: [SM] Native "GetArrayString" reported: Invalid index 74 (count: 0)
L 09/12/2009 - 12:32:14: [SM] Displaying call stack trace for plugin "Karaoke.smx":
L 09/12/2009 - 12:32:14: [SM]  [0]  Line 308, Karaoke.sp::timer_displayline()
L 09/12/2009 - 12:32:15: [SM] Native "GetArrayString" reported: Invalid index 80 (count: 0)
L 09/12/2009 - 12:32:15: [SM] Displaying call stack trace for plugin "Karaoke.smx":
L 09/12/2009 - 12:32:15: [SM]  [0]  Line 308, Karaoke.sp::timer_displayline()
L 09/12/2009 - 12:32:15: [SM] Native "GetArrayString" reported: Invalid index 80 (count: 0)
L 09/12/2009 - 12:32:15: [SM] Displaying call stack trace for plugin "Karaoke.smx":
L 09/12/2009 - 12:32:15: [SM]  [0]  Line 308, Karaoke.sp::timer_displayline()
L 09/12/2009 - 12:32:18: [SM] Native "GetArrayString" reported: Invalid index 81 (count: 0)
L 09/12/2009 - 12:32:18: [SM] Displaying call stack trace for plugin "Karaoke.smx":
L 09/12/2009 - 12:32:18: [SM]  [0]  Line 308, Karaoke.sp::timer_displayline()
L 09/12/2009 - 12:32:18: [SM] Native "GetArrayString" reported: Invalid index 81 (count: 0)
L 09/12/2009 - 12:32:18: [SM] Displaying call stack trace for plugin "Karaoke.smx":
L 09/12/2009 - 12:32:18: [SM]  [0]  Line 308, Karaoke.sp::timer_displayline()


dotISO 09-12-2009 18:19

Re: [TF2] Karaoke
 
Are those lyrics from Touhou?

Theme97 09-13-2009 02:34

Re: [TF2] Karaoke
 
Quote:

Originally Posted by Billiam (Post 930910)
Seem to be getting this sometimes
Code:

L 09/12/2009 - 12:32:14: [SM] Native "GetArrayString" reported: Invalid index 74 (count: 0)
L 09/12/2009 - 12:32:14: [SM] Displaying call stack trace for plugin "Karaoke.smx":
L 09/12/2009 - 12:32:14: [SM]  [0]  Line 308, Karaoke.sp::timer_displayline()


Thanks; I think this happens if the offset is > 5 seconds.

It isn't a major error, so I'm saving the fix for the next update.

Quote:

Originally Posted by dotISO (Post 931039)
Are those lyrics from Touhou?

Quote:

Originally Posted by Wikipedia
IOSYS (イオシス, ioshisu?) are a Japanese musical ensemble and dōjin circle from Sapporo, Japan. The group primarily produces remixes of music from the Touhou Project series of dōjin games.


guh 09-14-2009 19:10

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

Frus 09-14-2009 19:34

Re: [TF2] Karaoke
 
Quote:

Originally Posted by guh (Post 933054)
I am having trouble getting the mod to work. When I run sm_slay /karaoke it says [SM] No matching client was found.

You don't actually use the sm_slay command, it just checks that you have the admin flag allowing you to slay. just type the commands in chat i.e. /karaoke

guh 09-14-2009 21:06

Re: [TF2] Karaoke
 
Quote:

Originally Posted by Frus (Post 933092)
You don't actually use the sm_slay command, it just checks that you have the admin flag allowing you to slay. just type the commands in chat i.e. /karaoke

Thanks that worked. Which leads me to another problem but I think that's mostly due to me being a tard. Scrolling works but I don't get any music.

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

Theme97 09-14-2009 22:04

Re: [TF2] Karaoke
 
Quote:

Originally Posted by guh (Post 933228)
Scrolling works but I don't get any music.

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

First of all, have you edited play.php? There should be a URL in there, which you should replace with the URL of the folder for your songs.

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/
in play.php and change it to:
Code:

http://myip/karaoke/
I will update the default play.php to make this clearer when I get the updated Karaoke tested.

guh 09-14-2009 23:28

Re: [TF2] Karaoke
 
Quote:

Originally Posted by Theme97 (Post 933265)
First of all, have you edited play.php? There should be a URL in there, which you should replace with the URL of the folder for your songs.

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/
in play.php and change it to:
Code:

http://myip/karaoke/
I will update the default play.php to make this clearer when I get the updated Karaoke tested.


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

Billiam 09-15-2009 01:12

Re: [TF2] Karaoke
 
Quote:

Originally Posted by Theme97 (Post 931315)
Thanks; I think this happens if the offset is > 5 seconds.

It might, I'm not sure. I know it's happening with offsets less than that, too (like, 0 sec).

sirmoe 09-15-2009 09:15

Re: [TF2] Karaoke
 
It needs a stop button

guh 09-15-2009 19:15

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?

Theme97 09-15-2009 22:17

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:

Originally Posted by guh (Post 933311)
Stupid question I suppose theres no easy way to generate the .lrc besides doing it all by hand?

There are probably programs out there to help with timing the .lrc files but I've been doing them by hand.

Quote:

Originally Posted by Billiam (Post 933345)
It might, I'm not sure. I know it's happening with offsets less than that, too (like, 0 sec).

Oh well, the error should not be in the new version.

Quote:

Originally Posted by sirmoe (Post 933577)
It needs a stop button

/kstop is in the next update.

Quote:

Originally Posted by guh (Post 934130)
For some reason I can only get one song working. I made sure the .lrc and mp3 are titled the same. Any ideas?

What exactly is the problem? Is there only one song in the menu or are other songs choosable but only one of them actually plays sound?

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>
in Internet Explorer and seeing if the song plays.

guh 09-16-2009 06:36

Re: [TF2] Karaoke
 
Quote:

What exactly is the problem? Is there only one song in the menu or are other songs choosable but only one of them actually plays sound?

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>
in Internet Explorer and seeing if the song plays.
There are other songs choosable in the menu but only one plays sound. I browsed to the web directory like you asked and behold it only list the one song that plays. But when I browse to that same directory through using terminal on the apache server it list the other songs. I guess this is an apache problem I have to figure out.

guh 09-16-2009 15:15

Re: [TF2] Karaoke
 
Quote:

Originally Posted by guh (Post 934500)
There are other songs choosable in the menu but only one plays sound. I browsed to the web directory like you asked and behold it only list the one song that plays. But when I browse to that same directory through using terminal on the apache server it list the other songs. I guess this is an apache problem I have to figure out.


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

Billiam 09-16-2009 16:34

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

Theme97 09-16-2009 20:43

Re: [TF2] Karaoke
 
Quote:

Originally Posted by guh (Post 934500)
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.

Glad to hear that.

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:

Originally Posted by Billiam (Post 935169)
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.

I'm probably going to keep the current method of announcing at 20 and 10, since there isn't really a problem with it and it is editable anyway.

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.

Billiam 09-17-2009 00:55

Re: [TF2] Karaoke
 
Quote:

Originally Posted by Theme97 (Post 935387)
Glad to hear that.
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.

Fair enough. It seemed to me the overall sync was a little better with that .75, I'm not recommending it for inclusion.

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

Theme97 09-17-2009 21:58

Re: [TF2] Karaoke
 
Quote:

Originally Posted by Billiam (Post 935472)
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

Yeah, I checked Wiki too, but the wording was rather vague.

[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.

Theme97 09-17-2009 23:27

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.

Theme97 09-20-2009 02:19

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.