Skip to content

Instantly share code, notes, and snippets.

@Horaddrim
Created March 18, 2018 14:59
Show Gist options
  • Save Horaddrim/e836968d008a187487496389a4069b35 to your computer and use it in GitHub Desktop.
Save Horaddrim/e836968d008a187487496389a4069b35 to your computer and use it in GitHub Desktop.
const axios = require('axios');
module.exports = function(context, blob, outputBlob) {
context.log(blob);
axios.post(
'https://speech.platform.bing.com/speech/recognition/interactive/cognitiveservices/v1?language=pt-BR&format=detailed',
blob,
{
headers: {
'Ocp-Apim-Subscription-Key': process.env.API_KEY,
'Content-Type': 'audio/wav; codec=audio/pcm; samplerate=16000'
}
},
(error, response) => {
if (error) {
context.log(error);
}
context.log(JSON.stringify(response.data, null, 2));
}
);
context.done();
}
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment