REXX: Sound.CMD --- simple sound player ! 
Author Message
 REXX: Sound.CMD --- simple sound player !

I write a small rexx program to play sound files in a specific directory.
I use mp123.exe for decoding mpx files ....
Since I do not use much OS/2 system functions and the program is so small
you can change this code to your platform (Linux or else) for playing sound
files ! Just remember send me a mail !

------------------------------- cut here  ----------------------------------
/* Simple Sound Player 1.02                                                */
/* 04/05/1998                                                              */
/* Copyright 1998 Waily Yang                                               */

/*                                                                         */
/* Needs :                                                                 */
/*         MMOS2 installed (include play.cmd file)                         */
/*         mp123.exe                                                       */
/*                                                                         */
/* Usage :                                                                 */
/*         Sound.cmd type dir                                              */
/*            type --- play specific type of sound files, this can be one  */
/*                     of the following :                                  */
/*                       MP2  or MP3 or MPx  - Mpeg Layer 2, 3 audio files */
/*                       MIDI or MID         - MIDI files                  */
/*                       AU   or WAV or WAVE - Wave files                  */
/*                     Default type is "ALL"                               */
/*            dir  --- the directory where sound files located.            */
/*                     Default path is in E:\SAVE\MUSIC                    */
/*                                                                         */
/*                                                                         */

call RxFuncAdd "SysFileTree", "RexxUtil", "SysFileTree"

parse upper arg type dir

if type = "" then type = "ALL"
if dir = "" then dir = "E:\SAVE\MUSIC\"
type = translate(type)
dir  = translate(dir)

call SysFileTree dir, 'file', 'F'
do i=1 to file.0
  parse upper var file.i f_date f_time f_size f_att f_name
  filename = '"' || strip(f_name) || '"'
  f_ext = translate(substr(f_name, lastpos('.', f_name) + 1))
  select
    when ((f_ext="MP2" | f_ext= "MP3" | f_ext= "MPX" ) & ( (type="ALL") | (type="MP2") | (type= "MP3") | type= "MPX" ))
      then do
        say " [1;33mPlaying " filename || ' [0m'
        call plaympx filename
      end
    when ((f_ext="MID" | f_ext="MIDI")                 & ( (type="ALL") | (type="MID") | (type="MIDI") ))
      then do
        say " [1;33mPlaying " filename || ' [0m'
        call playmid filename
      end
    when ((f_ext= "AU" | f_ext= "WAV" | f_ext= "WAVE") & ( (type="ALL") | (type= "AU") | (type= "WAV") | type= "WAVE"))
      then do
        say " [1;33mPlaying " filename || ' [0m'
        call playwav filename
      end
    otherwise
      nothingtodo = 1
  end
end

exit

plaympx:
  parse arg f

return

playmid:
  parse arg f

return

playwav:
  parse arg f

return

------------------------------- cut here  ----------------------------------

-- Waily Yang -------------------------------------

| Homepage   http://www.*-*-*.com/ ~Waily/      |
| Location   Taipei, Taiwan, R.O.C.               |
| Club       Team OS/2 & Power User Group         |

---------------------------------------------------



Wed, 04 Oct 2000 03:00:00 GMT  
 
 [ 1 post ] 

 Relevant Pages 

1. clipper dos sound to windows sound card

2. Execute simultaneous MP3 players which are dedicated to each their sound cards on the computer

3. Sound through the sound card for MSWLogo?

4. No sound with Cosmo Player V2.1

5. Cosmo Player - Sound problems...

6. sound WAVE sound

7. SOUND-a-SOUND

8. snack sound and multiple sound cards

9. simple stuff: text, sound, scripting

10. Simple sound comparison with audioop.find*

11. How do you use your sound card and sound VI to get sound levels off a microphone.

12. Recording sound using object rexx

 

 
Powered by phpBB® Forum Software