Looking for Node module plus Bubble Plugin Experts

Hello all,

I am looking for someone familiar/some advice with using “context” for async on server side actions. I have never been able to get it to work. Example:

const request = require(“request”);
const fs = require(“fs”);
var file = “https://s3.amazonaws.com/appforest_uf/f1594920055740x716865500871644900/audio47825369.wav”;
var subscriptionKey = context.keys[“azure_key”]; // replace this with your subscription key
var region = context.keys[“region”]; // replace this with the region corresponding to your subscription key, e.g.westus, eastasia

// build pronunciation assessment parameters
var referenceText = “my test parameters”;
var pronAssessmentParamsJson = {"ReferenceText":"${referenceText}","GradingSystem":"HundredMark","Dimension":"Comprehensive"};
var pronAssessmentParams = Buffer.from(pronAssessmentParamsJson, ‘utf-8’).toString(‘base64’);

// build request
var options = {
method: ‘POST’,
baseUrl: https://${region}.stt.speech.microsoft.com/,
url: ‘speech/recognition/conversation/cognitiveservices/v1?language=en-us’,
headers: {
‘Accept’: ‘application/json;text/xml’,
‘Connection’: ‘Keep-Alive’,
‘Content-Type’: ‘audio/wav; codecs=audio/pcm; samplerate=16000’,
‘Transfer-Encoding’: ‘chunked’,
‘Expect’: ‘100-continue’,
‘Ocp-Apim-Subscription-Key’: subscriptionKey,
‘Pronunciation-Assessment’: pronAssessmentParams
}
}

var req = context.request.post(options);

Is there something simple I’m missing here? Basically, I would like to make a call through a server-side action to the Azure STT API. Azure requires a binary body, so I am making a call through Javascript client-side now. I would like to be able to stream from the microphone to Azure instead of sending a file once uploaded. Some reference:

Is this doable? Can you do it? Find my missing semicolon? Ping me or respond here :slight_smile:

Thanks!

CSP

@NigelG

Any thoughts here? I tried to use your twitter reference in another post but no luck. Happy to pay for a solution.