Control audio recording on mobile device. Audio file is saved in LMA's logical file system. Maximum audio length depends on the device storage space.
A string value indicates the fully qualified name of the file to record.
An integer from 1 to 5 that indicates the level of compression (1 is the lowest compression level, best quality, 5 is highest compression level, lowest quality). Default is 2.
An integer specifies the max recording duration in seconds. No limit when set to 0.
Start recording.
Stop recording.
Triggered when recoding is started.
Name | Type | Description |
|---|---|---|
Status | Enum | See Status Code |
Triggered when audio recording is finished.
Name | Type | Description |
|---|---|---|
Status | Enum | See Status Code |
Message | String |
Triggered when recoding has reached to duration limit.
Define_Com Class(#xDeviceAudioRecord) Name(#AudioRecord)
Evtroutine Handling(#COM_OWNER.Initialize)
#Record.Enabled := false
#Stop.Enabled := false
Endroutine
Evtroutine Handling(#AudioRecord.Initialize)
#Record.Enabled := true
#Stop.Enabled := true
Endroutine
Evtroutine Handling(#Record.Click)
#AudioRecord.File := 'MyVoice'
#AudioRecord.SampleRate := 44100
#AudioRecord.Channels := 2
#AudioRecord.Record()
Endroutine
Evtroutine Handling(#AudioRecord.Started) Status(#lstatus)
If (#lstatus = 'OK')
#Status := 'Recording started'
Else
#Status := 'Error starting recording: ' + #lstatus
Endif
Endroutine
Evtroutine Handling(#AudioRecord.Completed) Status(#lstatus)
Case (#lstatus)
When ('= OK')
#Status := 'Recording finished'
Otherwise
#Status := 'Error with recording: ' + #lstatus
Endcase
Endroutine
Evtroutine Handling(#Stop.Click)
#AudioRecord.Stop
Endroutine