Report as inappropriate.

No_avatar_thumb

tintaton presents ...

2010/1/8

WavePlayer

This scenario demonstrates the use of a WavPlayer class
that I wrote to allow a user to easily play and loop background
music in a scenario.

To run the demo, load a sound file with the blue botton.
click the green button to play, and the red button to stop.

A video tutorial is available on my website showing how I
intended for my class to be used. I hope this helps some
people out. Let me know if you have questions or
improvements.

01/21/2009
I updated the WavPlayer class so that it will now loop correctly in an applet. The old version set a mark at the beginning of the stream, and reset it when playback was finished. This did not work for applets, however. The new version instead, reloads the file when playback is complete.

1418 views / 7 in the last 7 days

1 vote | 0 in the last 7 days

Tags: music demo with-source wav player background loop

open in greenfoot
Your browser is ignoring the <APPLET> tag.
A new version of this scenario was uploaded on Thu Jan 21 23:35:08 UTC 2010
Avatar-1940Builderboy2005

2010/1/22

This is great! For a long while Greenfooters have been requesting a way to play/loop/stop sounds, and so far greenfoot has not supported this. Great Job!

Want to leave a comment? You must first log in.

Who likes this?

Avatar-1940_thumb