1stPlay Copyright 1995 by Mark Herring All Rights Reserved What is 1stPlay? ÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄ 1stPlay is a DOS utility that will play .VOC,.WAV,.CMF and .MID files from the command line. 1stPlay can also accept wildcard filenames as well. Besides being a "one shot" player 1stPlay also has the capability of installing itself as a TSR and allowing other programs to play MME files through a sound card. 1STPLAY.CFG ÄÄÄÄÄÄÄÄÄÄÄ This file is a text file that contains up to 6 directory paths that 1stPlay will search to locate the sound file. If the file you specify does not exist in the current subdirectory then 1stPlay will scan these 6 subdirectories to locate the file. Command line switches ÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄ /TSR Installs 1stPlay as a TSR. Calling 1stPlay again without any arguments will uninstall the TSR. See "Calling 1stPlay" for info on how to write to it. Note: 1stPlay requires a valid 1ST.KEY be present in the same subdirectory as 1stPlay in order to work in TSR mode. /U Uninstalls 1stPlay as a TSR. /MIDI:ON Routes any MIDI output from the sound card to a Roland MPU401 compatible device. /MAX: 1stPlay will allocate a segment of K in size in order to load .CMF and .MID files. When running as a TSR you can save memory by lowering this value to the size of the largest .CMF or .MID file you intend to play. You can specify /MAX:0 to save as much memory as possible. .VOC and .WAV files do not rely upon this setting. Note: This value is always in KBytes. The default value is 64k. /STOP Stops a .MID or .CMF file that is playing in the background. /LOADED: If set to ON then 1stPlay will not install itself as a TSR. /TIME:xx Number of seconds to play sound file. The default value is to play the ENTIRE file. If you install 1stPlay as a TSR you can use 1STPLAY.EXE to play sound files through the TSR module. 1stPlay will display (TSR) besides the filenames when using the TSR module. Press any key to stop playback. Calling 1stPlay ÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄ When 1stPlay is installed as a TSR it hooks into DOS interrupt 63h. You can call this interrupt from your program and have 1stPlay seamlessly play sound files for you. Calls to Interrupt 63h ÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄ Note: Whenever you must pass a filename to 1stPlay you must pass the filename as an 'ASCIIZ' string (null terminated). PLAY_FILE: AX = FF01h CX = 0000h (FFFFh if you wish to use a MPU401 device) DX = Segment of filespec buffer DI = Offset of filespec buffer Call Interrupt 63h. Returns FFFFh in AX if the file was played. Note: You can pass "/PAUSE" or "/PAUSE:xx" as a filename with this call. If /PAUSE is used then 1stPlay will pause until the user presses any key. /PAUSE:xx will pause "xx" seconds or until the user presses a key. /HOLD works much like /PAUSE except it will exit as soon as a .MID or .CMF file is finished playing in the background. FILE_PLAYING: This call lets you find out if a sound file that is playing in the background is still playing. AX = FF02h Call Interrupt 63h IF AX = 0000h then the .MID or .CMF file has stopped playing. Non-zero value means the file is still playing. STOP_PLAYING: This call lets you terminate playback of a file in the background. AX = FF03h Call Interrupt 63h Filenames can contain wildcards. Also certain commands can be appended to the filenames that change the way that 1stPlay operates. These commands are: ,MIDI Forces 1stPlay to play a .MID file through a Roland MPU401 compatible device. ,BACK Plays any .MID or .CMF file in the background. Control returns back to your calling program. 1stPlay supplies two interrupt calls that you can use to control playing the music. ,LOOP 1stPlay will automatically "loop" a .MID or .CMF continously in the background until you shut playback by using the STOP_PLAY interrupt call. For example, you could pass "STARTREK.MID,MIDI,LOOP" to 1stPlay and the tune would play through the MPU401 interface and loop until you shutdown the sequence. After you load 1stPlay as a TSR you can use "1STPLAY STARTREK.MID,MIDI,LOOP" to play the file from the DOS command prompt. "1STPLAY /STOP" will stop the playback. While a .MID or .CMF file is playing in the background you can still pass .VOC or .WAV files to 1stPlay. Also, 1stPlay can play .VOC or .WAV files through your PC speaker if you do not have a sound card installed. 1stPlay will load the file into the buffer you reserved using the /MAX:xxK command switch. NOTE! Both ",BACK" and ",LOOP" may cause your system to lockup. I have done extensive testing here on my 486 system but be careful when trying it with your own setup. My guess would be as long as you do not seriously play with the timer or extremely active disk I/O everything will be ok. That's it!