Create FileDocument from MediaRecorder in custom widget

0
So I’m working with a custom widget that records audio using MediaRecorder, and once it’s done, I want to make a FileDocument entity using the audio. Currently, I can create the entity and pass it into a microflow, but I cannot fill out the contents attribute of the entity. Below is the code I currently have. What data type do I need to convert the MediaRecorder audio to in order to be able to pass it into the contents attribute?   _this.saveRecording = function () { mx.data.create({ entity: "MyModule.AudioMessage", //AudioMessage is generalized from System.FileDocument callback : function (obj) { obj.set("Title", "New Audio Title"); obj.set("Name", "recording.weba"); obj.set("Contents", ???); // This needs to pass in the audio recording to Contents mx.data.action({ params: { applyto: "selection", actionname: "MyModule.testObjMicroflow", guids: [obj.toString()] }, callback: function(obj2) { }, error: function(error) { alert(error.message); } }, this); }, error: function (e) { alert(e.message) } })  
asked
0 answers