Playback voice recorded (BLOB)

This Q&A forum allows users to post and respond to "How Do I Do ....." questions. Please do not use to report (suspected) errors - you must use your regional help desk for this. The information contained in this forum has not been validated by LANSA and, as such, LANSA cannot guarantee the accuracy of the information.
Post Reply
adrian.bustillo
Posts: 20
Joined: Thu Mar 16, 2017 5:14 pm

Playback voice recorded (BLOB)

Post by adrian.bustillo » Thu Aug 08, 2024 12:59 pm

Hi!

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.
BLOB from file.png
BLOB from file.png (14.05 KiB) Viewed 1564 times

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


adale
Posts: 152
Joined: Wed Apr 08, 2020 9:18 pm
Location: Poplarville, MS

Re: Playback voice recorded (BLOB)

Post by adale » Fri Aug 09, 2024 3:50 am

Adrian,
I have not utilized the Lansa mobile record and playback feature specifically with it's RUP and widget, but have built a web app that pulled voice recordings as BLOBs from the server (IFS), and played in a VL web view using PRIM_SOND, so could be similar.

Looking at the xDemoLansaMobileRecordPlayback, the #Path looks to get pulled from the mobile device 'AudioFileOutPutPath' when you playback the initial recording from the mobile device, but I don't see where the #Path gets redefined when you have pulled the BLOB from the server?

My guess is that this 'Path' piece is what is causing the grief. Someone with more widget expertise could comment how best to redefine the new path to the file pulled from the server???

Or, when the recording is pulled from the server, utilize the prim_sond instead of the RUP/widget?
Arlyn Dale
Servias LLC

adrian.bustillo
Posts: 20
Joined: Thu Mar 16, 2017 5:14 pm

Re: Playback voice recorded (BLOB)

Post by adrian.bustillo » Mon Sep 02, 2024 4:07 pm

HI Arlyn,

Thank you for response and sorry for the late reply. It worked. Using component PRIM_SOND I were able to replay the recording.

Post Reply