Announcements

Between mid-October and November, the content on AREA will be relocated to the Autodesk Community M&E Hub and the Autodesk Community Gallery. Learn more HERE.

Play a sound when done rendering?

Play a sound when done rendering?

daschund
Enthusiast Enthusiast
2,004 Views
12 Replies
Message 1 of 13

Play a sound when done rendering?

daschund
Enthusiast
Enthusiast

So I was trying to find a way to play a sound when done rendering so that I can figure out when is the computer done without having to check it every couple of minutes. Apparently there is no setting to do that, but it was suggested to me to add a post render MEL script. The script suggested was this:

 

sound -offset 1 -file "path_to_your_file"

 

So I tried that, pointing to a WAV file on my hard drive, but it doesn't work, nothing plays at the end of the render. Any ideas how to make it work? I'm definitely not versed in scripting at all, so any help is very welcome!

0 Likes
Accepted solutions (1)
2,005 Views
12 Replies
Replies (12)
Message 2 of 13

mspeer
Consultant
Consultant

Hi!

I recommend to use a system command to play any sound by the default audio application.

Windows example:

system("load PATH_TO_AUDIO_FILE");

 

0 Likes
Message 3 of 13

daschund
Enthusiast
Enthusiast

Does it need a different syntax in Mac (other than changing the path to the file)? I tried here and it didn't work... 😞

 

Screen Shot 2020-10-04 at 1.42.32 PM.png

0 Likes
Message 4 of 13

mspeer
Consultant
Consultant

Hi!

 

Yes other systems need other commands.

Try

system("open PATH_TO_AUDIO_FILE");

 

0 Likes
Message 5 of 13

daschund
Enthusiast
Enthusiast

I was able to make it play using this syntax:

 

system ("afplay PATH_TO_AUDIO_FILE");

 

But when I paste this on the Post Render MEL on the Render options it doesn't play it after the render. Do I need an extra syntax to make it work on the Post Render MEL?

 

Thanks in advance for the help!

0 Likes
Message 6 of 13

mspeer
Consultant
Consultant

Hi!

 

If it works when executed in Script Editor it should also work if added to the "Post render MEL".

0 Likes
Message 7 of 13

daschund
Enthusiast
Enthusiast

It's really weird. It plays at the most odd times, like when I change some setting on the Render Settings window, when I stop the rendering, but not when the rendering is done... LOL 

0 Likes
Message 8 of 13

mspeer
Consultant
Consultant

Hi!

 

How do you render?

What menu do you use?

0 Likes
Message 9 of 13

daschund
Enthusiast
Enthusiast

I use Arnold>Render

0 Likes
Message 10 of 13

mspeer
Consultant
Consultant
Accepted solution

Hi!

OK, that's the problem.

This does not work with Arnold Render View.

You need to use Maya Render View.

Message 11 of 13

daschund
Enthusiast
Enthusiast

I see, I'll start using the Maya Render from now on! 🙂 

 

Thanks!!!

0 Likes
Message 12 of 13

sflipse
Explorer
Explorer

this guy has a solution but it has to be retyped each time in the MEL. but it works great 🙂 https://www.jordsoundservices.com/

0 Likes
Message 13 of 13

daschund
Enthusiast
Enthusiast

Sounds interesting (no pun intended), thanks!

0 Likes