PDA

View Full Version : How do you put sound files in an 'if' statement?


facelaunch
04-26-2006, 11:45 AM
I have six sound files that I only want one to be played if certain statements are true.

How do I go about importing them and only calling them one at a time in the MEL script ?

I'm a bit lost because I think they must all be in the time line but all of them may not need to be executed according to the IF-statement.

For instance,

If distance.x >10 then
play sound file1
else play sound file2

if distance.y >10 then
play sound file3
else play sound file4

If distance.z >10 then
play sound file5
else play sound file6

nessus
04-28-2006, 09:35 AM
First of all, i have to say i have never done audio files in this way. after a little research, i dug out that the there are at least 3 ways importing audio in maya:
1. file->import and choose the audio file
2. in trax editor, file-> import audio which is simliar to 1.
3. directly drag your audio files into maya's time slider.

maya is very picky about imported audio. in its doc it stays it only supports .aiff audio format in window plateform. u can google it for conversion to this format. i think iTune can do it?

once they are all imported, u then can use your if statements to tell maya which file to play under a certain condition.

CGTalk Moderation
04-28-2006, 09:35 AM
This thread has been automatically closed as it remained inactive for 12 months. If you wish to continue the discussion, please create a new thread in the appropriate forum.