APS Excellence in Physics Education Award
November 2019

Education Prize Logo
Science SPORE Prize
November 2011

NSF Logo
The Open Source Physics Project is supported by NSF DUE-0442581.

Introducing a periodic sound with no loop post and replies

Return to the Introducing a periodic sound with no loop thread
Login to post to this thread

Introducing a periodic sound with no loop
Léo Santos
10 Posts

Hello everyone,
I would like to introduce a sound that plays every specific moment of the simulation. For example, I have a rotating cylinder, and it would be nice to play a beep every 90 degrees, is that possible? I still do not understand how to do this. =/


Léo Rodrigues Macena dos Santos Departament of Physics - Faculdade de Ciências da Universidade do Porto.

Replies to Introducing a periodic sound with no loop

Re: Introducing a periodic sound with no loop -
lookang Avatar
lookang
245 Posts

you can check out

http://www.opensourcephysics.org/items/detail.cfm?ID=13368

link the audio URL to that mp3 file and add 

 

_view.audio.play(); //to control when to play

 


OSP@SG blog
OSP@SG Digital Library


Re: Re: Introducing a periodic sound with no loop -
Léo Santos
10 Posts

Thanks Lookang, worked well. :)


Léo Rodrigues Macena dos Santos Departament of Physics - Faculdade de Ciências da Universidade do Porto.


OSP Projects:
Open Source Physics - EJS Modeling
Tracker
Physlet Physics
Physlet Quantum Physics
STP Book