Script Request - Play only begining and end of tracks

Download and get help for different MediaMonkey Addons.

Moderators: Peke, Gurus

TommyF

Script Request - Play only begining and end of tracks

Post by TommyF » Tue Apr 15, 2008 9:07 am

I was hoping that some one might help me put together a script that would let me play only the first twenty and last twenty seconds of each track on a CD.

I know it sounds like an odd request, but I just took a job working with quality control from a company that manufactures compact discs and DVDs and part of my job is to check each track off of any of our first run discs for the first 20 and last 20 seconds of the track. This becomes very tedious work when you have to babysit the playhead and after looking through different media players, it seems that Media Monkey's support of scripts is probably the best bet for me.

If anyone has the time to make this on their own that would be fantastic! If not, I would also be very pleased to get some guidence. I have not worked with VB, but I can do a decent job with Action Script 3.0, so I might just need to be pointed at a resource that can compair the two languages and for someone to tell me the variables that I will need to work with.

Thank you very much for any help you might offer. Just consider this the exact opposite of crossfading, I wanna get rid of the middle and keep the ends.

onenonymous
Posts: 374
Joined: Sat Feb 02, 2008 1:09 pm
Location: Texas

Post by onenonymous » Tue Apr 15, 2008 10:00 am

check out SongPreviewer: Song previewing mode for MediaMonkey
http://www.mediamonkey.com/forum/viewtopic.php?t=10146
I expect it could do the job with some tweaks...

TommyF
Posts: 8
Joined: Tue Apr 15, 2008 9:19 am

Post by TommyF » Tue Apr 15, 2008 10:30 am

Hey, that certainly is a step in the right direction. I will look at the script a bit deeper later on, but this certainly would make half of the job easier. If i can figure out how to make it have two starts and ends for each track, and for the second one to get it's start point compaired to the end rather then the begining, I will be all set.

Thank you very much for the quick help.

Peke
Posts: 12368
Joined: Tue Jun 10, 2003 7:21 pm
Location: Serbia
Contact:

Post by Peke » Tue Apr 15, 2008 11:24 am

I think that Can be Done with Timers and Suffixes also you can use Winamp Compatible Messages to gether Info From MM faster and without connecting to MM COM Service (Automatization server).

Basically what you need and how I understand you need to have this info:
- Track library ID
- Time Frame that you will need to use for gather info (20 seconds from beginning and end)
- General Winamp plugin Hook to get all info about Playback Change (I can help you with that and give you some pointers)
Best regards,
Pavle
MediaMonkey Team lead QA/Tech Support guru
Admin of Free MediaMonkey addon Site HappyMonkeying
Image
Image
How to add SCREENSHOTS to forum

onenonymous
Posts: 374
Joined: Sat Feb 02, 2008 1:09 pm
Location: Texas

Post by onenonymous » Tue Apr 15, 2008 11:42 am

I'm just guessing - and this might not work (I'm at work so can't test it) -

in the code for the script I pointed you to, change this procedure:

Code: Select all

Sub StartNextSong(Timer)
    UnregisterTimer
    Call WriteToLog("Timer event handling unregistered in StartNextSong")
    SDB.Player.Next
End Sub
to look like this:

Code: Select all

Sub StartNextSong(Timer)
    UnregisterTimer
    SDB.Player.PlaybackTime = SDB.Player.CurrentSongLength - 20 * 1000
    Call WriteToLog("Timer event handling unregistered in StartNextSong")
End Sub
then when you run it, set the options to start at 0 and end after 20 seconds. I think it will play the first 20 (or whatever you set at runtime), then play the last 20, then go to the next song. This is a just a hack though, so good luck...

EDIT: I tried this last night and it appeared to work. Good luck and welcome to the Monkey!

TommyF
Posts: 8
Joined: Tue Apr 15, 2008 9:19 am

Post by TommyF » Wed Apr 16, 2008 11:20 am

Thank you so much for the help you have offered, this is why I love open source communities. I couldn't have possibly gotten any sort of results by going to microsoft and asking them if they could put in a feature that possibly only I would every use into windows media player, but you were willing to take the time to help me.

I might have a little bit of a lul at work today, so I am going to try and implement it then, I will let you all know how it goes.

Onenonymous, thank you as well for posting in the script's thread and asking the author if he had any input. He hasn't contacted me, and hopefully he won't have to, but putting forth that little extra effort is fantastic.

People need to understand that if they are polite and explain as specifically as possible what they need, they can often get great results. If I would have posted "I want someone to make it so I can only play parts of songs" I probably would not have gotten much of a response.

Thanks

TommyF
Posts: 8
Joined: Tue Apr 15, 2008 9:19 am

Post by TommyF » Wed Apr 16, 2008 11:53 am

Fan-freaking tastic. That script is doing just what I want it to. I cannot thank you enough.

I am running into a problem, though, that media monkey seems to abruptly go to the next track about 5 seconds befor the track ends. This is without having the script enabled as well as with it. I have crossfade disabled and am looking around to see if I can find a setting that will fix this.

Any thoughts?


EDIT: OK, I figured that part out, I had to go into an option in the output plugin and disable "Remove silence at beginning/end of track"

Now i am having a little trouble when the next track starts up. It will start playing, then jump back after a split second and start playing again. Thoughts?

onenonymous
Posts: 374
Joined: Sat Feb 02, 2008 1:09 pm
Location: Texas

Post by onenonymous » Wed Apr 16, 2008 1:33 pm

TommyF wrote:Now i am having a little trouble when the next track starts up. It will start playing, then jump back after a split second and start playing again. Thoughts?
try commenting out (or deleting) two lines in the StartPlaying procedure:

Code: Select all

SDB.Player.PlaybackTime = StartTime
This will hard code your script to always start at the beginning of the song (I think), which shouldn't be a problem for you since that's what you wanted.

If you have any other questions about that script, I suggest you ask them in that scripts forum thread.

TommyF
Posts: 8
Joined: Tue Apr 15, 2008 9:19 am

Post by TommyF » Thu Apr 17, 2008 6:31 am

Worked just dandy! :D

Post Reply