AlgoSound

Overview:

AlgoSound adds sound capability to Algodoo scenes. It does this by using either a vbSript or a Python program to read and play sound requests sent to text files from an Algodoo scene. Each text file represents a channel of sound, allowing multiple sounds to play concurrently. In operation, the vbSript or a Python program runs at the same time as the scene that uses AlgoSound.


Installation:

Notes:


Windows:



Other operating systems:



Adding sound to your own scene:

Code:

scene.my.playSound := (sParams, chan)=>{
            sXFile := "snd" + chan + ".txt";
            system.ReadWholeFile(sXFile) == ";" ? {
               System.WriteToFile(sXFile, sParams)
            } : {}
         }


Code:

scene.my.playSound("speak,Hello world.", 1)



AlgoSound Features and Benefits:

vbAlgoSound:

Pros:


Cons:


pyAlgoSound:

Pros:


Cons:



Developer SDK:

AlgoSound requires the following function in the Algodoo scene:

Code:

scene.my.playSound := (sParams, chan)=>{
         sXFile := "snd" + chan + ".txt";
         system.ReadWholeFile(sXFile) == ";" ? {
            System.WriteToFile(sXFile, sParams)
         } : {}
      }


Usage: scene.my.playSound("Item1,Item2,Item3,... ",channel)

If Item1 = someSoundFile(.wav,.mp3,.mid) Then

scene.my.playSound("filename,[numberOfPlays],[volume]",channel)


If Item1 = "tone" Then

scene.my.playSound("tone,leftFrequency,rightFrequency,duration,[volume]",channel)


If Item1 = "midi" Then

scene.my.playSound("midi,midiNoteNum,duration,[volume],[instrument]",channel)


If Item1 = "speak" Then

scene.my.playSound("speak,text to be spoken,[voice],[volume]",channel)


How it works:


Notes:


Change Log: