Play base64 audio string from Azure Blob service REST api with Javascript/Phonegap
Date : March 29 2020, 07:55 AM
I wish this helpful for you I have solved this by uploading the file as a byte[] instead of base64 encoded string. The file get's stored as an .aac audio file in blob storage and can be played directly from storage. For uploading i used the following code: var reader = new FileReader();
reader.onloadend = function (evt) {
if (evt.target.readyState === FileReader.DONE) { // DONE == 2
var RETRY_TIMEOUT_SECONDS = 5;
var NUMBER_OF_RETRIES = 3;
var requestData = new Uint8Array(evt.target.result);
$.ajax({
url: url,
type: "PUT",
data: requestData,
processData: false,
beforeSend: function (xhr) {
xhr.setRequestHeader('x-ms-blob-type', 'BlockBlob');
},
tryCount: 0,
retryLimit: NUMBER_OF_RETRIES,
success: function (data, status) {
console.log(status);
},
error: function (xhr, desc, err) {
if (xhr.status === 403) {
console.log("Access denied, the assigned upload time has been exeeded");
} else {
this.tryCount += 1;
if (this.tryCount <= this.retryLimit) {
console.log("Retrying transmission");
setTimeout($.ajax(this), RETRY_TIMEOUT_SECONDS * 1000);
return;
}
}
console.log(desc);
console.log(err);
}
});
}
};
// Read the file as a byte[]
reader.readAsArrayBuffer(dbFile);
|
Base64 encoded image string into Oracle BLOB database
Date : March 29 2020, 07:55 AM
I hope this helps you . I am tasked with taking a base64 encoded image and storing it into an Oracle SQL database as a blob. , The Image= is showing you the raw file in Hexadecimal.
|
How do I get audio/video from base64 encoded string?
Tag : ios , By : user165781
Date : March 29 2020, 07:55 AM
I wish this help you In JSON file, I am receiving the base64 encoded string. It may contain image file, pdf file, doc or text file or audio/video file. //try this simple logic as per your code
NSURL *URL = [NSURL URLWithString:
[NSString stringWithFormat:@"data:audio/mp3;base64,%@",
yourBase64EncodedString]];
[_webView loadRequest:[NSURLRequest requestWithURL:URL]];
|
How to convert Google Apps script blob to a base64 encoded string?
Date : December 25 2020, 10:01 AM
hop of those help? I have an blob within Google Apps Script. How can I convert it to an base64 encoded string in order to write it to other APIs? FileReader seems not to work ... , You could try this: Utilities.base64Encode(blob.getBytes());
|
Using AudioTrack to play base64 encoded audio String (converted to byte array) just produces white noise
Date : March 29 2020, 07:55 AM
this will help Your audio data is encoded with Opus codec with a sample rate of 48000 Hz (detected by FFmpeg). You have given wrong sample rate as a parameter to the AudioTrack constructor (given 44100 but it's 48000) and also it's encoded with a codec, and AudioTrack expects raw/decoded PCM audio so it could be the reason for the white noise you are hearing. In order to play the audio correctly, first convert it to raw PCM audio data then encode it with Base64.
|