I am trying to playback the voice recorded from the BLOB data. We were able to record and playback the voice recorded from the memory. But when the voice recorded were saved to a BLOB and a file. We weren't able to replay the voice recording.
We used the exact same code from the LANSA IDE > HOME > Samples > xDemoLANSAMobileRecordPlayback for recording, stop and play.
The voice recorded is converted to BLOB and store it to a file. Below is the screenshot of the BLOB from the server module.
Code: Select all
* Control
Define_Com Class(#xDemoRecordPlaybackControl) Name(#RecordPlaybackControl)
* Event Routines
*
Evtroutine Handling(#Record.Click)
#COM_OWNER.RecordAndPlayback Control('Recording')
Endroutine
Evtroutine Handling(#Stop.Click)
#RecordPlaybackControl.Stop
Endroutine
Evtroutine Handling(#Play.Click)
#COM_OWNER.RecordAndPlayback Control('Playback')
Endroutine
Evtroutine Handling(#RecordPlaybackControl.RecordingCompleted) Audiofileoutputpath(#Path)
#AudioFile := #Path
#COM_OWNER.EnableRecordPlay
Endroutine
Evtroutine Handling(#RecordPlaybackControl.PlaybackCompleted)
#COM_OWNER.EnableRecordPlay
Endroutine
Evtroutine Handling(#RecordPlaybackControl.Failed)
#sys_web.Alert( 'Cannot access device recording and playback feature. Please verify this application is being run in LANSA Mobile.' )
Endroutine
*
* Method Routines
*
Mthroutine Name(RecordAndPlayback)
Define_Map For(*INPUT) Class(#Prim_Str) Name(#control)
#Play.Enabled #Record.Enabled := False
#Status := #control + ' in progres...'
If (#control = 'Recording')
#RecordPlaybackControl.Record( #com_owner.FileName )
Endif
If (#control = 'Playback')
#RecordPlaybackControl.Playback( #AudioFile )
Endif
Endroutine
Mthroutine Name(EnableRecordPlay)
#Status := ''
#Record.Enabled := True
If (#AudioFile <> '')
#Play.Enabled := True
Endif
Endroutine
Mthroutine Name(FileName)
Define_Map For(*RESULT) Class(#Prim_Str) Name(#name)
#name := 'Aud_' + #DATETIMEX.Now.AsString.ReplaceAll( " " "_" ).ReplaceAll( ":" "-" ) + '.m4a'
Endroutine