let audioStream = fs.createReadStream(myFileName);
then in
let client = new BingSpeechClient(subscriptionKey);
client.recognizeStream(audioStream).then(response => console.log(response.results[0].name));
recognizeStream method, the type expected is NodeJS.ReadWriteStream but audioStream is fs.ReadStream, though I found that NodeJS.ReadWriteStream extends both ReadableStream and WriteableStream, but still I am getting error in Typescript transpiler.
TS2345: Argument of type 'ReadStream' is not assignable to parameter of type 'ReadWriteStream'.
Types of property 'setEncoding' are incompatible.
Type '(encoding: string) => ReadStream' is not assignable to type '(encoding: string) => ReadWriteStream'.
Type 'ReadStream' is not assignable to type 'ReadWriteStream'.
As per the README,
I created a new ReadStream by
then in
recognizeStream method, the type expected is NodeJS.ReadWriteStream but audioStream is fs.ReadStream, though I found that NodeJS.ReadWriteStream extends both ReadableStream and WriteableStream, but still I am getting error in Typescript transpiler.
Can you suggest what can I do?