Creates an audio node which can be used with UI commands such as soundControl or timeControl which support sound scrubbing and sound during playback.
Long name (short name) | Argument Types | Properties | |
---|---|---|---|
endTime (et) | time | ||
|
|||
file (f) | unicode | ||
|
|||
length (l) | bool | ||
|
|||
mute (m) | bool | ||
|
|||
name (n) | unicode | ||
|
|||
offset (o) | time | ||
|
|||
sourceEnd (se) | time | ||
|
|||
sourceStart (ss) | time | ||
|
Derived from mel command maya.cmds.sound
Example:
import pymel.core as pm
# Create an audio node for a sound file, and have it
# start at time 10. This command will return the name
# of the created node, something like "audio1".
#
pm.sound( offset=10, file='ohNo.aiff' )
# In order to have this sound displayed in a
# timeControl widget (like the timeSlider) use a
# command like this one, where the global MEL variable
# $gPlayBackSlider is the name of the widget to display
# the sound in.
#
import maya.mel
gPlayBackSlider = maya.mel.eval( '$tmpVar=$gPlayBackSlider' )
pm.timeControl( gPlayBackSlider, edit=True, sound='audio1' )