Decode base64 string to an audio file in Ionic3 and Angular5 - audio

I have a base64 string and I need decode it to an audio which I can reproduce with Media and MediaObject of ionic-cordova.
As I said, I am using Ionic3 and Angular5.

Related

Converting heic/heif to jpg in react native (or nodejs)

I have a react native app on ios where users can upload photos. I resize these photos server-side with sharp. The problem is:
the HEIC/HEIF-files from ios are not compatible with sharp. I get the following error:
¡Error: source: bad seek to 2808991
heif: Unsupported feature: Unsupported codec (4.3000)
¿
Is there a way to get a JPG version of the photo? It's also ok if I have to convert the file to jpg on the server, but how can I detect the codec of the image (so that only HEIC/HEIF images are converted, and not jpg or png)?
How can I convert them client side or server side?
React Native Image Resizer can perform HEIC to jpeg compression on the app. It's a native module so you'll have to build a development client if you're using expo.

Convert Kinesis Vides Stream /GetMedia result into audio file - node.js

Currently, I'm trying to convert a response of Kinesis Vides Stream GetMedia API to an audio file but have had no success in this. According to AWS documentation, - result of GetMedia request? it's recommended to use Kinesis Video Stream Parser Library. But I'd like to use js/ts implementation. Is it possible to convert this stream to an audio file using just js/ts?
Thank you for your help.

decode Base64 string in hapi

I have a need to decode some base 64 string in java script server based in Hapi library
In link I found that Hapi support base64 encode/decode but I can not find any example for how to use the relevant library.
Does anyone has a good example?

IBM Watson Speech to Text Audio Conversion on Node.js Web Application

The gist of the issue is that IBM Watson Speech to Text only allows for FLAC, WAV, and OGG file formats to be uploaded and used with the API.
My solution to that would be that if the user uploads an mp3, BEFORE sending the file to Watson, a data conversion would take place. Essentially, the user uploads an mp3, then using ffmpeg or sox the audio would be converted to an OGG, after which the audio would then be uploaded to Watson.
What I am unsure about is: What exactly do I have to modify in the Node.js Watson code to allow for the audio conversion to happen? Linked below is the Watson repo which is what I am working through. I am sure that the file that will have to be changes is fileupload.js, which I have linked, but where the changes go is what I am uncertain about?
I have looked through both SO and developerWorks, the IBM SO for answers to this issue, but I have not seen any which is why I am posting here. I would be happy to clarify my question if that is necessary.
Watson Speech to Text Repo
The Speech to Text sample application you are trying to use doesn't convert MP3 files to OGG. The src folder(with fileupload.js on it) is just javascript that will be used on the client side(thanks to Browserify).
The application is basically communicating the browser with the API using CORS so the audio goes from the browser to the Watson API.
If you want to convert the audio using ffmpeg or sox you will need to install the dependencies using a custom buildpack since those modules have binary dependencies (C++ code in them)
James Thomas has a buildpack with sox on it: https://github.com/jthomas/nodejs-buildpack.
You need to update your manifest.yml to be something like:
memory: 256M
buildpack: https://github.com/jthomas/nodejs-buildpack.git
command: npm start
Node:
var sox = require('sox');
var job = sox.transcode('audio.mp3', 'audio.ogg', {
sampleRate: 16000,
format: 'ogg',
channelCount: 2,
bitRate: 192 * 1024,
compressionQuality: -1
});

Is it possible to decode an AES encrypted video with node-webkit file on the fly?

With file-encryptor and node-webkit its simple to encrypt a local videofile (webm) to a local encrypted file like myvideo.dat.
But is there a way to decrypt and view this video? Without a temp file?
The file-encryptor encrypts all the webm container, you should encrypt the video stream like the webM Encryption RFC. You could use the webm_crypt tool from the repository https://chromium.googlesource.com/webm/webm-tools/.
For example:
$ webm_crypt -i video.webm -o encrypted_video.webm
This will generate a key file named vid_base_secret.key
$ webm_crypt -i video.webm -o encrypted_video.webm -video_options base_file=vid_base_secret.key
In the wiki of WebM project You can find more information although it is something relatively new.

Resources