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.

Sound? post and replies

Return to the Sound? thread
Login to post to this thread

Sound in EJSS?
kyle forinash
1 Posts

Is there a way to make a sine wave play audibly in EJSS?

Replies to Sound in EJSS?

Re: Sound in EJSS? -
Francisco Esquembre
228 Posts

Hi Kyle,

Yes! We just added tow new media-oriented HTMView elements. On the Interface panel, look for Audio and Video.

You need the brand official new release of EjsS: http://fem.um.es/EjsWiki/uploads/Download/EJS_5.01_141119.zip

Attached are is the source code for a JS example that uses a sound.


Attached File: ejss_src_AudioExample.zip

Re: Re: Sound in EJSS? -
lookang Avatar
222 Posts

dear paco, this is awesome.

it is NOW possible to create a sound when impact on floor using say.


if (vy < 0){

_view.audio.play(); // a simple code inserted in the event handler when the ball bounce of the floor.

//Toolkit.getDefaultToolkit().beep(); // EJS way



great work everyone in your team.

my files are here. enjoy everyone.


http://weelookang.blogspot.sg/2014/09/ejss-projectile-customized-after.html https://dl.dropboxusercontent.com/u/44365627/lookangEJSworkspace/export/ejss_model_projectile/projectile_Simulation.xhtml source: https://dl.dropboxusercontent.com/u/44365627/lookangEJSworkspace/export/ejss_src_projectile.zip authors: lookang author of EJS 5: Paco.

Post edited November 20, 2014 at 3:39 AM EST.

Post edited November 20, 2014 at 3:39 AM EST.

OSP@SG blog
OSP@SG Digital Library

Re: Re: Re: Sound in EJSS? -
Francisco Esquembre
228 Posts

Yes. We thought it would be nice to have sound!


Re: Sound in EJSS? -
146 Posts

Here is an example of how embed a video into a JavaScript EjsS model. http://www.compadre.org/osp/items/detail.cfm?ID=13367

Post edited November 19, 2014 at 7:31 PM EST.

Re: Sound in EJSS? -
146 Posts

Yes.  EjsS version 5.1 can now play sound files.  See the following example:


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