Audio alarm: Difference between revisions

From Rosetta Code
Content added Content deleted
m (Removed manual categories)
(modifying it so JavaScript and HTML are both mentioned in the header)
Line 1: Line 1:
{{draft task}}
{{draft task}}
'''AudioAlarm''' is a program that asks the user to enter a certain number, representing a number of seconds. After the user enters the number, the program will ask the user to enter the name of an MP3 audio file (without the .mp3 file extension). The program will then display a (usually blank) page. After the time (indicated by the number) is up, a sound (indicated by the MP3 file) will go off. Useful for timers and alarm clocks. The app must be installed in its own folder, preferrably with a name like ''AudioAlarm''. To install a sound on the app, just copy the MP3 to the app folder you set up. Then, when the app asks you for the filename, you just type in the name without an extension.
'''AudioAlarm''' is a program that asks the user to enter a certain number, representing a number of seconds. After the user enters the number, the program will ask the user to enter the name of an MP3 audio file (without the .mp3 file extension). The program will then display a (usually blank) page. After the time (indicated by the number) is up, a sound (indicated by the MP3 file) will go off. Useful for timers and alarm clocks. The app must be installed in its own folder, preferrably with a name like ''AudioAlarm''. To install a sound on the app, just copy the MP3 to the app folder you set up. Then, when the app asks you for the filename, you just type in the name without an extension.
=={{header|JavaScript}}==
=={{header|JavaScript}}/{{header|HTML}}==
'''WARNING! THIS APP IS NOT PURE JAVASCRIPT. IT IS MOSTLY HTML, WITH JAVASCRIPT FRAGMENTS IN IT.'''
<lang JavaScript>
<lang JavaScript>
<title> AudioAlarm </title>
<title> AudioAlarm </title>
<script>
<script> var a=prompt("Enter a number of seconds", "");
var b=prompt("Enter the name of an MP3 file you have installed in the directory (without the .mp3 file extension)", "");
var a=prompt("Enter a number of seconds", "");
var b=prompt("Enter the name of an MP3 file you have installed in the directory (without extension)", "");
document.write("<meta http-equiv='refresh' content='"+a+";url="+b+".mp3'>") </script></lang>
document.write("<meta http-equiv='refresh' content='"+a+";url="+b+".mp3'>") </script>
</lang>

Revision as of 00:08, 26 July 2011

Audio alarm is a draft programming task. It is not yet considered ready to be promoted as a complete task, for reasons that should be found in its talk page.

AudioAlarm is a program that asks the user to enter a certain number, representing a number of seconds. After the user enters the number, the program will ask the user to enter the name of an MP3 audio file (without the .mp3 file extension). The program will then display a (usually blank) page. After the time (indicated by the number) is up, a sound (indicated by the MP3 file) will go off. Useful for timers and alarm clocks. The app must be installed in its own folder, preferrably with a name like AudioAlarm. To install a sound on the app, just copy the MP3 to the app folder you set up. Then, when the app asks you for the filename, you just type in the name without an extension.

JavaScript/HTML

<lang JavaScript> <title> AudioAlarm </title> <script> var a=prompt("Enter a number of seconds", ""); var b=prompt("Enter the name of an MP3 file you have installed in the directory (without extension)", ""); document.write("<meta http-equiv='refresh' content='"+a+";url="+b+".mp3'>") </script> </lang>