Help - Search - Members - Calendar
Full Version: Changing the natural way to run an audio file
Hydrogenaudio Forums > Hydrogenaudio Forum > General Audio
kinderino2
Hellow everyone!
Can someone help me to find a way to get an audio file run in a random location each time I open it?

Thanks for helpers. biggrin.gif
Canar
Could you please rephrase the question? I'm not sure exactly what you're asking.
kinderino2
QUOTE(kinderino2 @ Jul 1 2008, 01:43) *

Hellow everyone!
Can someone help me to find a way to get an audio file run in a random location each time I open it?

Thanks for helpers. biggrin.gif


Haha! They told me that on the other forum, too. biggrin.gif

Well let's see....

I need to change an audio file to run in a random spot each time I run it, for example:

If I'll run it now, it'll open in 2:55.
Next time it'll do on 3:67 of somthing like that.

I besically want to reprogram my audio file so it won't run on 0:00 seconds anymore, but to just open in a random spot inside the file!
DVDdoug
I don't think you're going to find any software to do that. I would be an easy feature for a programmer to add to his/her program, but you may be the only person who wants that feature...
pdq
QUOTE(kinderino2 @ Jun 30 2008, 16:35) *

Next time it'll do on 3:67 of somthing like that.

Three minutes and sixty seven seconds?
fracai
What operating system are you running on?

I'd approach this, on a Linux like OS, by: writing a script which retrieves the length of the audio, calculates a random position between 0 and the end of the file (minus some minimum play time), and invokes mplayer with the given initial offset. Making this script clickable is easy.

I'm sure you could do something similar in Windows with a .bat script and an audio player which includes command line support.
kinderino2
QUOTE(DVDdoug @ Jul 1 2008, 02:27) *

I don't think you're going to find any software to do that. I would be an easy feature for a programmer to add to his/her program, but you may be the only person who wants that feature...


I was kinda searching for the code. tongue.gif
They told me it's an easy job for a JavaScript programmer, so I figured I give it a try.
Do you mean, noone wants that? A shame, it's very...useful thing, duh.

QUOTE(pdq @ Jul 1 2008, 02:27) *

QUOTE(kinderino2 @ Jun 30 2008, 16:35) *

Next time it'll do on 3:67 of somthing like that.

Three minutes and sixty seven seconds?


That's an example of a random spot, yes, it could just open in 3:67 instead of 0:00 and in 7:55, if he just feels like it.


fracai, I need the script, I don't know how to write it, and I think I'll need some explanation on how to implement it. ><"
I'm running a shitty windows vista.

The length of the file is 4:50:35.
DVDdoug
QUOTE
yes, it could just open in 3:67 instead of 0:00 and in
wink.gif You missed the joke... pdq was teasing you... 3 minutes, 67 seconds is more commonly written as 4 minutes, 7 seconds! wink.gif

In order to use a script that controls an existing program, you'd first need a music-player program that allows you to open and start in the middle of a file, from the command line.

I didn't think of using a script... I was thinking along the lines of a programmer modifying his existing audio-player program (i.e the Foobar 2000 guys could add this feature), or a programer could modify modifying an open-source audio player.

kinderino2
QUOTE(DVDdoug @ Jul 1 2008, 04:22) *

QUOTE
yes, it could just open in 3:67 instead of 0:00 and in
wink.gif You missed the joke... pdq was teasing you... 3 minutes, 67 seconds is more commonly written as 4 minutes, 7 seconds! wink.gif

In order to use a script that controls an existing program, you'd first need a music-player program that allows you to open and start in the middle of a file, from the command line.

I didn't think of using a script... I was thinking along the lines of a programmer modifying his existing audio-player program (i.e the Foobar 2000 guys could add this feature), or a programer could modify modifying an open-source audio player.


Oooo.. right! laugh.gif I feel so teased right now...arrr.
Wait, about the program you spoke of, I need the file to change, I mean...if the audio-player can change the file so other audio players would start it in the same way (random or watever) this would be good.
What I don't need is a program who just happens to have the option of starting the file randomly, because I'll need to use this file later on an ouside MP3....

I've tried seraching for such a method. IT DOESN"T EXIST XD. So, the only option left is to use an open source audio program to change the file (was that making sense?).
Axon
Yeah, I've had the urge to implement this too on occasion.

You could use the scripting access to QuickTime to do it. I forget if it's through OLE or AppleScript, but it's plausible that you could write a script to open up a file in QT and seek to a random position.
sbooth
You're likely using Windows, but here is an (extremely basic) AppleScript that works on OS X 10.5 with QuickTime Player:

CODE
set f to choose file of type {"public.audio"} without invisibles
tell application "QuickTime Player"
    open f
    set d to duration of document 0
    set r to random number (d)
    set current time of document 0 to r
end tell

collector
QUOTE(pdq @ Jun 30 2008, 12:57) *

QUOTE(kinderino2 @ Jun 30 2008, 16:35) *

Next time it'll do on 3:67 of somthing like that.

Three minutes and sixty seven seconds?

Three seconds and 67 frames.. biggrin.gif It's random.
This is a "lo-fi" version of our main content. To view the full version with more information, formatting and images, please click here.
Invision Power Board © 2001-2008 Invision Power Services, Inc.