Forum Settings
       
Reply To Thread

Simple Programming Challenge!Follow

#1 Jun 22 2004 at 4:21 PM Rating: Default
I need a windowed program to run a timer. 1 hour duration, executing a chosen sound file every minute. At the end of the hour, another string to play a different sound.

Can anyone whip it up for me? This is the break down.

Load program
Click the start button
Every 60 seconds alarm.wav to be played
After 60 cycles, done.wav to be played.
Program stops.

It would mean more to me than you know, I'm tired of looking at a clock during power hour.
#2 Jun 22 2004 at 5:10 PM Rating: Decent
uhm.... hmmm... :\ I could do something like this in php or javascript I'm sure (though I've never tried)... thing is I dunno if it would run locally on your drive or if you would need to access it via web. More than likely you would have to visit it via web.

EDIT:
What is Power Hour?

Edited, Tue Jun 22 18:11:23 2004 by ElvaanKrem
#3 Jun 22 2004 at 5:31 PM Rating: Good
Official Shrubbery Waterer
*****
14,659 posts
Quote:
Simple Programming Challenge!

Oxymoron.

Twiztid
____________________________
Jophiel wrote:
I managed to be both retarded and entertaining.

#4 Jun 22 2004 at 5:49 PM Rating: Excellent
Avatar
******
29,919 posts
Grab the following html files and put them somewhere in the same directory (i'll be removing them from my webhost eventually:

http://home.houston.rr.com/acep38/soundframe.htm

http://home.houston.rr.com/acep38/soundiframe.htm

http://home.houston.rr.com/acep38/endpage.htm

you cna change the sounds to different ones, I just did a quick search for file name matches.

I havn't fully tested it, at least the hour refresh part, mostly because i'm not goign to sit here for an hour listening to it ding.

And yes, what is power hour?

____________________________
Arch Duke Kaolian Drachensborn, lvl 95 Ranger, Unrest Server
Tech support forum | FAQ (Support) | Mobile Zam: http://m.zam.com (Premium only)
Forum Rules
#5 Jun 22 2004 at 6:04 PM Rating: Default
Everyone takes a 1.5 shot of "beer" on the minute for one hour. The steadiness is something else...

edit: GOT Em! Thanks a bizzillion kaolian! I'll try it out when I get home, thanks again.

Edited, Tue Jun 22 19:05:57 2004 by DeanoTyler
#6 Jun 22 2004 at 6:07 PM Rating: Decent
Lunatic
******
30,086 posts
ARe you sure you don't want to complicate it a little more? Maybe some sort of Rube Goldberg contraption involving a mouse, a steaming tea kettle and a bowling ball that keeps track for you?
____________________________
Disclaimer:

To make a long story short, I don't take any responsibility for anything I post here. It's not news, it's not truth, it's not serious. It's parody. It's satire. It's bitter. It's angsty. Your mother's a *****. You like to jack off dogs. That's right, you heard me. You like to grab that dog by the bone and rub it like a ski pole. Your dad? Gay. Your priest? Straight. **** off and let me post. It's not true, it's all in good fun. Now go away.

#7 Jun 22 2004 at 6:22 PM Rating: Default
Quote:
Hardly a day goes by without The New York Times, National Public Radio, The Wall Street Journal or some other major media invoking the name Rube Goldberg to describe a wildly complex program, system or set of rules such as our "Rube Goldberg-like tax system".


Yay, learned something new.

Quote:
involving a mouse, a steaming tea kettle and a bowling ball that keeps track for you?


Attribute this to the rando-smash factor?

PS Please someone tell me how to source quotes
#8 Jun 22 2004 at 6:25 PM Rating: Decent
Quote:
Everyone takes a 1.5 shot of "beer" on the minute for one hour. The steadiness is something else...


That sounds like fun, gotta try that this weekend.
#9 Jun 22 2004 at 6:51 PM Rating: Good
Tracer Bullet
*****
12,636 posts
You know you're a nerd when you start using computer programs to facilitate drinking games.

Just do the power hour like everyone else. Use an analog wall clock, and after 45 minutes or so everyone gets too drunk to keep track, and it gets really sloppy.
#10 Jun 22 2004 at 7:38 PM Rating: Good
Encyclopedia
******
35,568 posts
Bah. Windows... I would have just whipped up something easy like this:

#!/bin/ksh

my_player=/path/to/player/mpplayer

my_sounds=/path/to/mp3/dir/

my_alarm=${my_sounds}/alarm.wav
my_ding=${my_sounds)/ding.wav

n=0

while [ n -lt 60 ] ; do
n=$(($n+1))
${my_player} ${my_alarm} &
sleep 60
done

${my_player} ${my_ding} &

Edited, Tue Jun 22 20:39:31 2004 by gbaji
____________________________
King Nobby wrote:
More words please
#11 Jun 22 2004 at 7:44 PM Rating: Excellent
Avatar
******
29,919 posts
eh, that works too, but mine is platform independant. Doesn't get much quicker or dirtier than an iframe, a few meta refresh tags and an embed tag or two. I could write it as a program and compile it under unix or windows, but why bother?
____________________________
Arch Duke Kaolian Drachensborn, lvl 95 Ranger, Unrest Server
Tech support forum | FAQ (Support) | Mobile Zam: http://m.zam.com (Premium only)
Forum Rules
#12 Jun 22 2004 at 8:04 PM Rating: Default
Well Kaolian it works! Yay you solved my problem I've been having. See we play 45's while we do this, so now someone doesn't have to watch the clock, maybe we can fit in 2 games now. Sweet.

Trickybeck, HAhAEHHEH yur right 45 mins is the norm, BUT NOT ANYMORE MUHAHAHEH.

Powerhour is a great utility to loosen up people in the shortest time possible. Not to mention, if it's a chick and she's got her own car... well, no one likes to let someone drink and drive..
#13 Jun 22 2004 at 8:15 PM Rating: Excellent
Avatar
******
29,919 posts
Just for the record, if you drink yourself to death using that, it's not my fault.
____________________________
Arch Duke Kaolian Drachensborn, lvl 95 Ranger, Unrest Server
Tech support forum | FAQ (Support) | Mobile Zam: http://m.zam.com (Premium only)
Forum Rules
#14 Jun 22 2004 at 11:50 PM Rating: Default
Don't worry buddy.
#15 Jun 23 2004 at 3:27 AM Rating: Good
Official Shrubbery Waterer
*****
14,659 posts
Who said he was worried? Compassion and covering one's *** are two different things, sonny.

Twiztid
____________________________
Jophiel wrote:
I managed to be both retarded and entertaining.

#16 Jun 23 2004 at 4:49 PM Rating: Good
Encyclopedia
******
35,568 posts
Dread Lord Kaolian wrote:
eh, that works too, but mine is platform independant. Doesn't get much quicker or dirtier than an iframe, a few meta refresh tags and an embed tag or two. I could write it as a program and compile it under unix or windows, but why bother?


Just like to point out that "platform independant" isn't really accurate. The links you provided require plugins that don't exist for most flavors of *nix browsers.

Not that this matters for a drinking game of course! But it actually does drive my nuts how many people think that if it works on their windows or mac web browser that it's "platform independant". My shell script will actually run natively on more different OSes out there then your web app. Of course the half dozen that yours run on happen to be what 99.999% of all users will have on their desks at home, but that's a whole different issue...

____________________________
King Nobby wrote:
More words please
#17 Jun 23 2004 at 4:55 PM Rating: Decent
***
1,455 posts
DeanoTyler wrote:
PS Please someone tell me how to source quotes
I assume you mean the "DeanoTyler Wrote:" Thing.

Just do:
[quote=NameofQuotedPerson][/quote]
#18 Jun 23 2004 at 6:51 PM Rating: Excellent
Avatar
******
29,919 posts
gbaji wrote:


Just like to point out that "platform independant" isn't really accurate. The links you provided require plugins that don't exist for most flavors of *nix browsers.



Unix boxes won't play wav files? /boggle
#19 Jun 23 2004 at 7:26 PM Rating: Good
Encyclopedia
******
35,568 posts
Dread Lord Kaolian wrote:
gbaji wrote:


Just like to point out that "platform independant" isn't really accurate. The links you provided require plugins that don't exist for most flavors of *nix browsers.



Unix boxes won't play wav files? /boggle



Huh? Of course they do. But their browsers don't support whatever funkyness you put on those webpages. When I click the links, the all say something like: "Viewing this page requires a plugin you do not have. If you'd like to download the plugin click here". Clicking the link there brings you to a page that says that the plugin you need is not found.
____________________________
King Nobby wrote:
More words please
#20 Jun 23 2004 at 8:33 PM Rating: Excellent
Avatar
******
29,919 posts
it's just an iframe and 2 wav embed tags. Oh, and a meta refresh. Nothing that shouldn't be supported out of the box by any browser from the last three years. Very strange that your box asks for a plugin. I don't think the wav files use a nonstandard codec, though they could I suppose
____________________________
Arch Duke Kaolian Drachensborn, lvl 95 Ranger, Unrest Server
Tech support forum | FAQ (Support) | Mobile Zam: http://m.zam.com (Premium only)
Forum Rules
#21 Jun 23 2004 at 9:16 PM Rating: Good
Encyclopedia
******
35,568 posts
I did a bit of poking around. I actually think it's because the browsers are "new" instead of old. Older browsers used to have this feature where you could tell it manually which app to start up when it encountered a file of a particular type. I just noticed that the browser I'm using today has changed the way that's done. Now, everything is done via plugins. The only thing I can assume is that the plugin for audio/x-wave is not present by default.

Back in the old days, I could just add it in manually by referencing the type "audio/x-wave" to a binary on my local system (a wave player in this case). Can't do it now. Or at the very least, they've made it a lot harder to do then it used to be (I think I can add it in, but it would require a lot more goofing around with it).

It's kinda bizaare actually. I can do shockwave and flash and all that neato stuff, but can't just play a normal wav file. Go figure...


I've also noticed that that automated interaction with programs often don't work when using *nix (or macs in some cases) and accessing a file that was generated on a Windows based system. The cause ends up being the old "file extension versus file header" issue. Everyone in the world *except* microsoft embeds standard file headers into their stuff so that they know what sort of file something is. MS still uses the old concept of dos file extensions. What I've seen happen *alot* is that if you create a file of a particular type on a MS machine, it'll automatically stick a file extension on, but not put in a header. The result is that an MS machine will recognize it correctly (cause it's looking for the file extension) and do the right thing with the file. Any other platform will look at the file and have no idea what type it actually is and do nothing.


You see this all the time with .zip files. If the file was generated on a MS host, and I just click on the link, it'll open the binary in a window (which results in a lot of gibberish on the screen). The only way to get around it is to hold down the shift key while clicking. This tells the browser to just download whatever's on the other end of the link instead of the default behavior (opening in a window).


In this case, I don't think that's the issue since the browser does seem to know what kind of file is there. It just doesn't have anything configured to manage it by default. Which is strange, but then I didn't make the damn thing...
____________________________
King Nobby wrote:
More words please
Reply To Thread

Colors Smileys Quote OriginalQuote Checked Help

 

Recent Visitors: 251 All times are in CST
Anonymous Guests (251)