alice-teacher Using an audio file based on a condition

Nalini Ujre nalinir54 at gmail.com
Thu Jan 1 02:35:16 EST 2015


Thank you Leonel,

The problem I found was Alice does not allow us to treat the sound file as
a data type but as a resource.
Your suggestion about having different objects from different classes looks
interesting. I will give it a try.
Please let me know if you have any success on your end.

Thanks,
Nalini

On Wed, Dec 31, 2014 at 11:14 PM, Leonel Morales <litomd at gmail.com> wrote:

> Hi,
>
> I have a preliminary version in which I explored different options.
> None of them worked other than the nested if, which I tried to avoid
> as much as possible.
>
> You can download it here:
>
> http://ingenieriasimple.com/alice/LetArray.a3p
>
> I found no way to put different sound files into an array.
>
> But there is an option... You can insert 5, or as many as needed,
> different objects of different classes, into the scene, made them
> invisible, build a PlaySound method for each different class, put them
> all in an array and call them as needed.
>
> I personally haven't tried this solution as it looks complicated. What
> I am trying to do now is to export the same class into different class
> files and then edit the files to change the type. No success yet.
>
> As soon  as I have a new version I will let you know.
>
> CC you directly because list moderation these days could be slow :)
>
> All the best for 2015!
>
> Leonel
>
> 2014-12-28 23:35 GMT-06:00, Nalini Ujre <nalinir54 at gmail.com>:
> > Hello all,
> >
> > I have a project where the audio needs to be played depending on certain
> > conditions. For example, if the "c" key is pressed, it should play a
> > certain sound. I want to know if there is a way to store the names of the
> > audio files in an array and then use it as required instead of using the
> if
> > conditional statement each time. There are about 15 audio files that are
> > required in this project.
> >
> > I am using Alice 3.1
> >
> > Thank you
> > Nalini
> >
>
-------------- next part --------------
An HTML attachment was scrubbed...
URL: http://lists.andrew.cmu.edu/pipermail/alice-teachers/attachments/20150101/a119ce57/attachment.html 


More information about the alice-teachers mailing list