MobileCRM.Services.AudioRecorder.startRecording - Resconet/JSBridge GitHub Wiki
[v10.0] Starts recording audio from microphone
Arguments
Argument | Type | Description |
---|---|---|
callback | function | The callback function which is called asynchronously in case of success. |
errorCallback | function(errorMsg) | The errorCallback which is called in case of error. |
scope | Object | The scope for callbacks. |
This example demonstrates how to intialize audiorecording and how to use recorded data in HTML 5.
var audioRecorder = MobileCRM.Services.AudioRecorder.startRecording(function (res) { }, MobileCRM.bridge.alert, null);
audioRecorder.stopRecording(function () {
var filePath = audioRecorder.getRecordFilePath(function (path) {
if (path) {
audioRecorder.getRecordBase64(function (base64) {
// requires HTML 5
var audioElemet = document.createElement("audio");
if (audioElemet) {
audioElemet.src = "data:audio/mp3:base64," + base64;
}
}, MobileCRM.bridge.alert, null);
}
}, MobileCRM.bridge.alert, null);
}, MobileCRM.bridge.alert, null);