Sounds in Algodoo
6 posts • Page 1 of 1
Sounds in Algodoo
Hello everyone, I wrote a program to play sounds in Algodoo.
Step 1
Download program with sounds samples and unzip to %USERPROFILE%/Documents/Algodoo
Step 2
Run snd.exe together with Algodoo.
Step 3
Put the sound files that you want to use in %USERPROFILE%/Documents/Algodoo/sounds (or subfolders).
Step 4
Use script
For example, open the console with "~" and enter
or create a box and in the field onCollide= write
File location relative to the directory %USERPROFILE%/Documents/Algodoo/sounds
Note 1
After the file extension must be one or more spaces.
Note 2
Modifiers:
Play sound if not playing System.WriteToFile("snd.file","glass2.wav ")
Stop sound if playing System.WriteToFile("snd.file","-glass2.wav ")
Stop and play sound System.WriteToFile("snd.file","*glass2.wav ")
Stop all playing sounds System.WriteToFile("snd.file","stop ")
Note 3
It is better to create a separate folder in the sounds/ for audio files from each scene
Note 4
In console You can initialize function
//sorry for my bad English
Step 1
Download program with sounds samples and unzip to %USERPROFILE%/Documents/Algodoo
Step 2
Run snd.exe together with Algodoo.
Step 3
Put the sound files that you want to use in %USERPROFILE%/Documents/Algodoo/sounds (or subfolders).
Step 4
Use script
- Code: Select all
System.WriteToFile("snd.file","<file location>/<file name>.<file extension> ");
For example, open the console with "~" and enter
- Code: Select all
System.WriteToFile("snd.file","glass2.wav ");
or create a box and in the field onCollide= write
- Code: Select all
(e)=>{System.WriteToFile("snd.file", "materials/wood.wav ")}
File location relative to the directory %USERPROFILE%/Documents/Algodoo/sounds
Note 1
After the file extension must be one or more spaces.
Note 2
Modifiers:
Play sound if not playing System.WriteToFile("snd.file","glass2.wav ")
Stop sound if playing System.WriteToFile("snd.file","-glass2.wav ")
Stop and play sound System.WriteToFile("snd.file","*glass2.wav ")
Stop all playing sounds System.WriteToFile("snd.file","stop ")
Note 3
It is better to create a separate folder in the sounds/ for audio files from each scene
Note 4
In console You can initialize function
- Code: Select all
scene.my.PlaySound:=(name)=>{System.WriteToFile("snd.file","materials/"+name+" ")}
- Code: Select all
Scene.my.PlaySound("glass1.wav");
//sorry for my bad English
Last edited by uCriterion on Sat Jan 26, 2013 2:07 pm, edited 2 times in total.
- uCriterion
- Posts: 3
- Joined: Fri Jan 25, 2013 9:57 pm
Re: Sounds in Algodoo
hi,you're back.Does the script is safe and usable? i'm not sure!
waiting for semester break to come...
-
faytree - Posts: 947
- Joined: Mon Nov 05, 2012 1:37 pm
- Location: Selangor, Malaysia
Re: Sounds in Algodoo
well,nice suggestion.But can the script will make it simplified like :
for example.
- Code: Select all
vel>7.90?{System.WriteToFile("snd.file", "materials/wood.wav ")}:{}
for example.
waiting for semester break to come...
-
faytree - Posts: 947
- Joined: Mon Nov 05, 2012 1:37 pm
- Location: Selangor, Malaysia
Re: Sounds in Algodoo
1.
Completely. Script System.WriteToFile writes the title of sound to "snd.file", where it reads and plays my program. No more.
2. Yeap. You can use this script.
faytree wrote:Does the script is safe and usable?
Completely. Script System.WriteToFile writes the title of sound to "snd.file", where it reads and plays my program. No more.
2. Yeap. You can use this script.
- uCriterion
- Posts: 3
- Joined: Fri Jan 25, 2013 9:57 pm
Re: Sounds in Algodoo
in what kind of programming language is wroten this program? Visual Basic or Visual C++?
- Luezma
- Posts: 14
- Joined: Thu Dec 13, 2012 7:19 pm
- Location: Argentina
6 posts • Page 1 of 1
Who is online
Users browsing this forum: No registered users and 13 guests