Sound Engine for Red

    Simple Sound Engine for Windows users
                    new improved version added  10/05/2017
At the moment Red  has no sound, so for some Apps in my Red Apps section I had to improvise ....
I called the Rebol interpreter from within my Red exe to handle sound effects etc ....

This was not an ideal way to do it and though it worked ok, it was a bit messy .... 
So I needed to think of an easier and simpler way to handle the sound until Red gets its own 
There's been talk of bindings, but I personally have not found one that works yet ....

By using 'Call' from your Red program there are a few ways to do it ....  Calling Powershell(Media.Soundplayer) .... Or calling a VBS script .... but all are a bit of a wrangle to use .... For example, You call powershell that runs soundplayer that plays a .wav file and then you need to kill powershell, so taskKill.exe is needed .... 
so not ideal ....

'newEngine062.exe' is my way of adding sound to Red exe's with the least fuss ....
Nothing fancy here, a crude and very simple way to play .mp3  and/or .wav files .... 

Now it plays .wav  and/or  .mp3   - be  sure you use the latest  'Red'  build ....

Play music and sound effects together ....

Red [ title: "Test Sound Engine" Author: "Alan Brack" needs: 'view ]
view/options [ title "Sound Effect Engine"
       below
       text font-color red "Buttons to Play two Sound Effects"       
       button "Play Sound Effect 1" [write %effect.dat "1" call "start newEngine062" write %flag.dat "cheer.wav" ]
       button "Play Sound Effect 2" [write %effect.dat "1" call "start newEngine062" write %flag.dat "whistle.wav" ]
;;;;;;;;;;
       text font-color red "Buttons to Play Music and Stop Music"
       across
       button "Play Sound" [call "start newEngine062" write %flag.dat "trap1.mp3"]
       button "Stop Sound" [write %flag.dat "stop"]      
     ] [actors: object [on-close: func [face event][write %flag.dat "stop"]]]  ;;;;<- kill sound if a title bar quit is executed
                      

Note
In the above example, I use both  .mp3  and  .wav  files.


Get my 'newEngine062.exe' and demo's from my 'Red' Apps page .... 
There's also a 'Red' mp3 player included in the zip file.  



Demo.

my Engine


DISCLAIMER: My programs are supplied 'as is' with no guarantee of them working in all situations .... 
There are no expressed or implied warranties of any kind regarding these programs. 'Use at your own risk'