IC Python API:RLPy RAudioRecorder

From Reallusion Wiki!
Revision as of 18:09, 31 March 2019 by Chuck (RL) (Talk | contribs) (Created page with "{{TOC}} {{Parent|IC_Python_API:RL_Python_Modules|Modules}} ==Detailed Description== This class is used for the recording of audio. The functions GetAvailableDevices() can get...")

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

Detailed Description

This class is used for the recording of audio.

The functions GetAvailableDevices() can get a list of all available audio devices. Developer can use SetInputDevice() and GetInputDevice() to set/get current recording device.
audio_recorder = RLPy.RAudioRecorder()
# If you want to select your recording devices.
all_device = audio_recorder.GetAvailableDevices()
audio_recorder.SetInputDevice(all_device[0])
audio_recorder.Start()
#Recording is now started
#...
audio_recorder.Stop()
recorded_audio = audio_recorder.GetAudio() # RIAudioObject

Member Functions

GetAudio

RLPy.RAudioRecorder.GetAudio ( self )

Returns the recorded audio.

Returns

RIAudioObject - RLPy.RIAudioObject

GetAvailableDevices

RLPy.RAudioRecorder.GetAvailableDevices ( self )

Returns a list of audio devices.

Returns

Available device name list - string

GetInputDevice

RLPy.RAudioRecorder.GetInputDevice ( self )

Returns current audio input device.

Returns

Current input device name - string

GetTimeLimit

RLPy.RAudioRecorder.GetTimeLimit ( self )

Get current limit time of Audio Recorder.

Returns

Limit of time in millisecond. The default value is 9000000 millisecond( 15 minutes ) - int

RegisterCallback

RLPy.RAudioRecorder.RegisterCallback ( self, pCallback )

Register audio recorder event callback.

Parameters

pCallback [IN] RAudioRecorderCallback - RLPy.RAudioRecorderCallback


SetInputDevice

RLPy.RAudioRecorder.SetInputDevice ( self, strInputAudioDeviceName )

Select your recording device.

Parameters

strInputAudioDeviceName [IN] Device name - string

Return Values

RLPy.RStatus.Success Success

RLPy.RStatus.Failure Fail


SetTimeLimit

RLPy.RAudioRecorder.SetTimeLimit ( self, nMillisecond )

Limit recording time for Audio Recorder.

Parameters

nMillisecond [IN] limit of recording time in millisecond - int


Start

RLPy.RAudioRecorder.Start ( self )

Starts recording from the audio input device.

Return Values

RLPy.RStatus.Success Success

RLPy.RStatus.Failure Fail


Stop

RLPy.RAudioRecorder.Stop ( self )

Stop recording from the audio input device.

Return Values

RLPy.RStatus.Success Success

RLPy.RStatus.Failure Fail