Digital Workshop

Welcome to the Digital Workshop Message Boards
It is currently January 12th, 2025, 6:27 am

All times are UTC [ DST ]




Post new topic Reply to topic  [ 3 posts ] 
Author Message
 Post subject: Playing random sounds
PostPosted: April 17th, 2005, 8:05 am 
Offline

Joined: November 27th, 2004, 12:35 am
Posts: 19
Location: London and Cambridge UK
Opus: Opus pro 9
OS: Windows 7
I could do with some help on how to play a random sound on an action.

At the simplest level:
click on an object (or some other trigger)
play a short peice of music.
click again on the same object play a different peice of music

I can have random rewards by putting the rewards on different pages in another folder and using next random.
I was wondering if there was someway of doing it within one page.

The music could be a collection short wav or mp3 files held in a folder.


To make it a little clearer:
One of the mantras in trying to develop awareness of cause and effect with pupils who are working at the early stages of intentionality is to provide activities that have "repetition with small changes".
This allows them to learn in a familiar activity but prevents early familiarisation/boredom so keeps interest in the activity.
So you need to have the same kind of activity with slightly different reward sequence.

Opus is enabling me to create a range of software to develop access to the computer for our students,
so thanks for making and supporting it


and I know the answer (if there is one) will involve scripting...

Richard Walter


Top
 Profile  
 
 Post subject:
PostPosted: April 17th, 2005, 7:13 pm 
Offline

Joined: October 25th, 2004, 12:27 pm
Posts: 526
Location: Digital Workshop
Hi,

Thank you for your enquiry.

This can be achieved using script (i.e; populating an array with the names of the audio files, generating a random number based on the length of this array and issuing a PlaySound action which uses this random number as the array index).

However, it is also possible to use Opus' inbuilt Random function to generate this random number, then use a series of If statements to play different sound files based on this number.

Please find attached an example publication which demonstrates a non-scripted way of achieving this.

I hope this helps. Please do not hesitate to contact me if you have any further queries.

Kind regards,


You do not have the required permissions to view the files attached to this post.

_________________
Robin Garrett
Digital Workshop Technical Support


Top
 Profile Visit website  
 
 Post subject:
PostPosted: April 17th, 2005, 8:18 pm 
Offline

Joined: November 27th, 2004, 12:35 am
Posts: 19
Location: London and Cambridge UK
Opus: Opus pro 9
OS: Windows 7
Thanks Robin
That works well.

I've never understood scripts so the non scripting way is the way for me!


I'm happy that Opus has enough inbuilt functions for me to mostly avoid having to script.


Richard Walter


Top
 Profile  
 
Display posts from previous:  Sort by  
Post new topic Reply to topic  [ 3 posts ] 

All times are UTC [ DST ]


Who is online

Users browsing this forum: No registered users and 7 guests


You cannot post new topics in this forum
You cannot reply to topics in this forum
You cannot edit your posts in this forum
You cannot delete your posts in this forum
You cannot post attachments in this forum

Search for:
Jump to:  
cron
Powered by phpBB © 2000, 2002, 2005, 2007 phpBB Group