IC Python API:RLPy RAudio

From Reallusion Wiki!
Jump to: navigation, search
Main article: Modules.

Detailed Description

This is a utility class providing methods to manipulate audio files.

( Experimental Class )
# load audio by path
selection_list = RLPy.RScene.GetAvatars()
avatar = selection_list[0]
wav_file = "C://SpecialDay.wav"
print(RLPy.RAudio.LoadAudioToObject(avatar, wav_file, RLPy.RTime(600)))

# load audio by audio object
selection_list = RLPy.RScene.GetAvatars()
avatar = selection_list[0]

wav_file = "C://SpecialDay.wav"
empty_object = RLPy.RAudio.CreateAudioObject()
empty_object.Load(wav_file)

print(RLPy.RAudio.LoadAudioToObject(avatar, empty_object, RLPy.RTime(600)))

Member Functions

CreateAudioObject

RLPy.RAudio.CreateAudioObject ( )

Returns the audio instance.

Returns

RIAudioObject - RLPy.RIAudioObject

LoadAudioToObject

RLPy.RAudio.LoadAudioToObject ( args )

Load audio to the target object and return audio length according to audio object.

Parameters

spObject [IN] load to which object (object can be avatar, prop) - RLPy.RIObject

pAudioObject [IN] audio object store wave - RLPy.RIAudioObject

kStartTime [IN] the audio start time in the application in sec - RLPy.RTime

nLoopCount [IN] audio loop count, default is 1 - int

kFadeIn [IN] fade-in in sec, default is 0 - RLPy.RTime

kFadeOut [IN] fade-out in sec, default is 0 - RLPy.RTime

kCutLength [IN] cut-length in sec, default is 0 - RLPy.RTime

Returns

Audio length. If loaded failed return 0.0f - float