IC Python API:RLPy RIAudioObject

From Reallusion Wiki!
Revision as of 01:02, 1 April 2019 by Chuck (RL) (Talk | contribs) (Created page with "{{TOC}} {{Parent|IC_Python_API:RL_Python_Modules|Modules}} ==Detailed Description== This class represents the sound object in the scene. The developer can load or save audio f...")

(diff) ← Older revision | Latest revision (diff) | Newer revision → (diff)
Jump to: navigation, search
Main article: Modules.

Detailed Description

This class represents the sound object in the scene. The developer can load or save audio file through the method Load() or Save(). Only support WAV audio file in PCM format, can be one of the following: 8KHz mono 16bits, 11KHz mono 16bits, 22KHz mono 16bits, 44KHz mono 16bits, 16KHz mono 16bits, 48KHz mono 16bits, 8KHz stereo 16bits, 11KHz stereo 16bits, 22KHz stereo 16bits, 44KHz stereo 16bits, 16KHz stereo

16bits and 48KHz mono 16bits.
# load wav file
wav_path = "C:\\sample.wav"
self.audio_object = RLPy.RAudio.CreateAudioObject()
self.audio_object.Load(wav_path)
print(self.audio_object.HasData()) # True

# save to file
save_path = "E:\\sample\\save.wav"
self.audio_object.Save(save_path)

Member Functions

HasData

RLPy.RIAudioObject.HasData ( self )

Provides a way to determine if an element currently has any audio source.

Returns

True or Not - bool

Load

RLPy.RIAudioObject.Load ( self, strPath )

Load Audio Source from wave file.

Parameters

strPath [IN] file path - string

Return Values

RLPy.RStatus.Success Success

RLPy.RStatus.Failure Fail


Save

RLPy.RIAudioObject.Save ( self, strPath )

Save an Audio Source to wave file.

Parameters

strPath [IN] save file path - string

Return Values

RLPy.RStatus.Success Success

RLPy.RStatus.Failure Fail