Problem with @intres/azure-cognitive speech to text

Hi,
During a test with @intres/azure-cognitive, using ms-speech-to-text, i always got this debug message : SST is cancelled with NoMatch

To test, i do that :

But same error.. If someone have an idea or can help me. :smile:

Are you able to post the code to your flow?

Here is the code :

[{"id":"c7f99e7473d8f320","type":"inject","z":"4dc161f1d79bd216","name":"Text","props":[{"p":"payload"}],"repeat":"","crontab":"","once":false,"onceDelay":0.1,"topic":"","payload":"Bonjour, c'est un test","payloadType":"str","x":130,"y":460,"wires":[["aa6428f6b3f7fdbd","1cc2f8068063b6f6"]]},
{"id":"aa6428f6b3f7fdbd","type":"ms-text-to-speech","z":"4dc161f1d79bd216","name":"","inputMode":"payload","outputMode":"payload","synthesisVoice":"fr-FR-CelesteNeural","textFilePath":"","audioFilePath":"","x":350,"y":460,"wires":[["c58e6e2eb30bb6f0","ca10abbcff042177"]]},
{"id":"ef7751c231abfa5e","type":"debug","z":"4dc161f1d79bd216","name":"End Text check","active":true,"tosidebar":true,"console":false,"tostatus":false,"complete":"true","targetType":"full","statusVal":"","statusType":"auto","x":960,"y":460,"wires":[]},
{"id":"1cc2f8068063b6f6","type":"debug","z":"4dc161f1d79bd216","name":"Start Text check","active":true,"tosidebar":true,"console":false,"tostatus":false,"complete":"payload","targetType":"msg","statusVal":"","statusType":"auto","x":340,"y":540,"wires":[]},
{"id":"c58e6e2eb30bb6f0","type":"debug","z":"4dc161f1d79bd216","name":"Buffer check","active":true,"tosidebar":true,"console":false,"tostatus":false,"complete":"payload","targetType":"msg","statusVal":"","statusType":"auto","x":610,"y":540,"wires":[]},
{"id":"ca10abbcff042177","type":"ms-speech-to-text","z":"4dc161f1d79bd216","name":"","inputMode":"payload","outputMode":"payload","fromLanguage":"fr-FR","textFilePath":"./test.txt","audioFilePath":"","x":630,"y":460,"wires":[["ef7751c231abfa5e"]]}]

Try changing the from language to fr instead of fr-FR and see if that makes any difference.

This gives me another error : "SST is cancelled with Canceled"

With a wav file it works but it doesn't help when going with a payload.

Have you tried to use by passing a text file into it? Just passing a string should work.

A string or file works for the ms-text-to-speech node but the errors come from the ms-speech-to-text and it only takes in payload ArrayBuffer or Buffer(NodeJS) class, or with a wav file but no text.
I think the problem is the buffer class, but I can't figure out why.

One thing to try is use a read file node to read a file you have and then pass that as a buffer.
It could be just the way the buffer is being passed that is causing the issue.

I just tried it with "a single Buffer object" output, it works, a node debug returns this: msg.payload: buffer[323012]
With a "Stream of buffer" the message is cut.

There is not too much on what payload types are accepted. Looking within the code it does a check to see if an ArrayBuffer or Buffer(NodeJS). So I would say it only supports a buffer and not a stream buffer, might explain why it is being cut off.

Below is the text:
msg.payload must be an instance of either ArrayBuffer or Buffer(NodeJS) class

I already got an error message saying that, but the output of the ms-text-to-speech node is a buffer and I can listen to it with an audio play node.
I'll try to save the buffer in wave format and input it like that to see if it works.

I found a solution, thanks to the node ffmpeg conversion of the node-red-contrib-media-utils palette, no more errors, and it works well.

[{"id":"e407d144a1994107","type":"ffmpeg-conversion","z":"a97665cbb9bc05f4","name":"","format":"wav","audiochannels":"mono","x":830,"y":280,"wires":[["ca10abbcff042177"]]}]
1 Like

This topic was automatically closed 14 days after the last reply. New replies are no longer allowed.