xDeviceAudioRecord

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
soa
Posts: 339
Joined: Mon Dec 07, 2015 3:15 pm

xDeviceAudioRecord

Post by soa »

I want to record some audio in a LMA VL Web app and store the resultant mp3 in my database. I assumed I could do this through the server module but the documentation seems to imply that Longreach is required. This would not be ideal as Longreach requires that a non-standard port be opened in the firewall and does allow us store to the mp3 and its meta data in a single operation. Is this correct?
User avatar
Stewart Marshall
Posts: 417
Joined: Thu Nov 05, 2015 5:25 pm

Re: xDeviceAudioRecord

Post by Stewart Marshall »

Yes, that's correct as at today.

Tighter integration with VL Web is a work in progress. We're hoping (no promises) to deliver this as part of SP2

Regards
Stewart Marshall

Independent IT Consultant
www.marshallfloyd.com.au
soa
Posts: 339
Joined: Mon Dec 07, 2015 3:15 pm

Re: xDeviceAudioRecord

Post by soa »

I would be very keen to see this.
tsupartono

Re: xDeviceAudioRecord

Post by tsupartono »

In the interim, if this can be of help, I have an example of how you can use a widget to send your audio file to a server module (as a BLOB field). Attached is a LANSA export package containing 3 items:
  • SendBlobWidget
  • SaveBlobTestServerModule
  • SaveBlobTestWebPage
The webpage shows you how you can use the xDeviceFileRead to read the audio file after recording (using xDeviceAudioRecord), and subsequently use the SendBlobWidget example to send the audio content as a BLOB data to the server module.
One thing to note, if you are using server sessions, you would need to set your server module's session-key-method to COOKIE (the default is HIDDEN). See the server module example in the export package.
Attachments
QuickExport20170307080930.zip
(17.9 KiB) Downloaded 1516 times
Last edited by tsupartono on Tue Mar 07, 2017 8:09 am, edited 1 time in total.
soa
Posts: 339
Joined: Mon Dec 07, 2015 3:15 pm

Re: xDeviceAudioRecord

Post by soa »

That's great news. I'll check it out asap.
soa
Posts: 339
Joined: Mon Dec 07, 2015 3:15 pm

Re: xDeviceAudioRecord

Post by soa »

I can't get this to work. How long does it take to load - I've waited up to a minute.


Fatal Error:

Can't access a widget before it has completed loading
Location:

Web Page: SaveBlobTestWebPage, line 16
Call Stack:

1. Evtroutine Handling(#RecordButton.Click): SaveBlobTestWebPage, line 16
Reported By:

http://localhost/lansa/lansa_14_1_11_2/lansa_wdgt.js, line 6
soa
Posts: 339
Joined: Mon Dec 07, 2015 3:15 pm

Re: xDeviceAudioRecord

Post by soa »

Please ignore my dumb error - of course it doesn't work in a browser!

Sorry.
soa
Posts: 339
Joined: Mon Dec 07, 2015 3:15 pm

Re: xDeviceAudioRecord - upload example.

Post by soa »

I have installed this app on my ipad and it longers produces an error and 'uplaod' returns a success message. However, I can't determine if anything is being recorded. I've added

Define_Com Class(#xDeviceAudioPlayback) Name(#AudioPlayback)

and new play button with a click event of

Evtroutine Handling(#btnPlay.Click)
#AudioPlayback.File := #AudioRecord.File
#AudioPlayback.Play
Endroutine

but nothing happens when I hit play after recording.There is no sound or error messages. Volume is on full. There appears to be no way on the ipad of looking at the file system to see if a file exists.

Any ideas about what I am doing wrong or how I can verify that this function is working?
soa
Posts: 339
Joined: Mon Dec 07, 2015 3:15 pm

Re: xDeviceAudioRecord

Post by soa »

I've modified the supplied server app to store the recorded file in a blob file on our iseries. I've retrieved the file the file system where it is named file.bin. I've changed the extension to .mp3 and played it back. It plays but appears to contain 7 seconds or so of silence. I've tested my microphone by recording a video and this works ok.

Any ideas why the app wouldn't record anything or how to troubleshoot it.

LANSA mobile did ask for permission which I granted. LANSA mobile is listed in settings as allowed to access the mic.
tsupartono

Re: xDeviceAudioRecord

Post by tsupartono »

It records fine on my iPhone.
Can you try on a different device (also on android vs iOS)
Post Reply