playing a sound in squeak

Previous Topic Next Topic
 
classic Classic list List threaded Threaded
4 messages Options
Reply | Threaded
Open this post in threaded view
|

playing a sound in squeak

FrankBz
Hi, I was wondering, what's an easy and quick way to load and play a sound file, say a wav, in a squeak program?
If you have experience with any other format (midi, mp3, etc.) feel free to share it.
What I'm really interested in is how sound works in squeak.

Regards
Reply | Threaded
Open this post in threaded view
|

Re: playing a sound in squeak

trudny
FrankBz <kyotosong <at> libero.it> writes:

>
>
> Hi, I was wondering, what's an easy and quick way to load and play a sound
> file, say a wav, in a squeak program?
> If you have experience with any other format (midi, mp3, etc.) feel free to
> share it.
> What I'm really interested in is how sound works in squeak.
>
> Regards
>

Hi Frank,

    Here is a basic load/play....

    thewavfile:= SampledSound fromWaveFileNamed: '(path)\filename.wav'

    (AbstractSound soundNamed:'thewavfile') play

Regards

Nicholas Tocadelius



_______________________________________________
Beginners mailing list
[hidden email]
http://lists.squeakfoundation.org/mailman/listinfo/beginners
Reply | Threaded
Open this post in threaded view
|

Re: playing a sound in squeak

FrankBz
hi, I get a Dictionary error when trying to execute the above code.
Perhaps I need to store the loaded sound in a sound dictionary of the environment?

thanks in advance
Reply | Threaded
Open this post in threaded view
|

Re: playing a sound in squeak

trudny
Hm. Try replacing the second line with

(thewavfile asSampledSound)  play

Regards,
Nicholas