# Problem with @intres/azure-cognitive speech to text

**URL:** <https://discourse.nodered.org/t/problem-with-intres-azure-cognitive-speech-to-text/65882>\
**Category:** General\
**Created:** [1 August 2022 12:29 UTC](https://discourse.nodered.org/t/problem-with-intres-azure-cognitive-speech-to-text/65882 "2022-08-01T12:29:17Z")\
**Posts on this page:** 13\
**Page:** 1

<div class="post-metadata">

**Author:** ![Corentin-F](https://avatars.discourse-cdn.com/v4/letter/c/f04885/32.png) [@Corentin-F](https://discourse.nodered.org/u/Corentin-F)\
**Post date:** [1 August 2022 12:29 UTC](https://discourse.nodered.org/t/problem-with-intres-azure-cognitive-speech-to-text/65882/1 "2022-08-01T12:29:17Z")

</div>

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 :

 ![image](https://us1.discourse-cdn.com/flex026/uploads/nodered/original/3X/f/5/f53f0c45d2f0cb0083e3aa7467a58d2f17ef1922.png)

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

---

<div class="post-metadata">

**Author:** ![Patrick\_UK](https://avatars.discourse-cdn.com/v4/letter/p/df788c/32.png) [@Patrick\_UK](https://discourse.nodered.org/u/Patrick_UK)\
**Post date:** [1 August 2022 19:44 UTC](https://discourse.nodered.org/t/problem-with-intres-azure-cognitive-speech-to-text/65882/2 "2022-08-01T19:44:37Z")

</div>

Are you able to post the code to your flow?

---

<div class="post-metadata">

**Author:** ![Corentin-F](https://avatars.discourse-cdn.com/v4/letter/c/f04885/32.png) [@Corentin-F](https://discourse.nodered.org/u/Corentin-F)\
**Post date:** [2 August 2022 07:18 UTC](https://discourse.nodered.org/t/problem-with-intres-azure-cognitive-speech-to-text/65882/3 "2022-08-02T07:18:52Z")

</div>

Here is the code :

```auto
[{"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"]]}]

```

---

<div class="post-metadata">

**Author:** ![Patrick\_UK](https://avatars.discourse-cdn.com/v4/letter/p/df788c/32.png) [@Patrick\_UK](https://discourse.nodered.org/u/Patrick_UK)\
**Post date:** [2 August 2022 13:06 UTC](https://discourse.nodered.org/t/problem-with-intres-azure-cognitive-speech-to-text/65882/4 "2022-08-02T13:06:39Z")

</div>

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

---

<div class="post-metadata">

**Author:** ![Corentin-F](https://avatars.discourse-cdn.com/v4/letter/c/f04885/32.png) [@Corentin-F](https://discourse.nodered.org/u/Corentin-F)\
**Post date:** [2 August 2022 13:26 UTC](https://discourse.nodered.org/t/problem-with-intres-azure-cognitive-speech-to-text/65882/5 "2022-08-02T13:26:19Z")

</div>

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.

---

<div class="post-metadata">

**Author:** ![Patrick\_UK](https://avatars.discourse-cdn.com/v4/letter/p/df788c/32.png) [@Patrick\_UK](https://discourse.nodered.org/u/Patrick_UK)\
**Post date:** [2 August 2022 20:20 UTC](https://discourse.nodered.org/t/problem-with-intres-azure-cognitive-speech-to-text/65882/6 "2022-08-02T20:20:47Z")

</div>

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

---

<div class="post-metadata">

**Author:** ![Corentin-F](https://avatars.discourse-cdn.com/v4/letter/c/f04885/32.png) [@Corentin-F](https://discourse.nodered.org/u/Corentin-F)\
**Post date:** [3 August 2022 12:34 UTC](https://discourse.nodered.org/t/problem-with-intres-azure-cognitive-speech-to-text/65882/7 "2022-08-03T12:34:43Z")

</div>

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.

---

<div class="post-metadata">

**Author:** ![Patrick\_UK](https://avatars.discourse-cdn.com/v4/letter/p/df788c/32.png) [@Patrick\_UK](https://discourse.nodered.org/u/Patrick_UK)\
**Post date:** [3 August 2022 14:53 UTC](https://discourse.nodered.org/t/problem-with-intres-azure-cognitive-speech-to-text/65882/8 "2022-08-03T14:53:03Z")

</div>

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.

---

<div class="post-metadata">

**Author:** ![Corentin-F](https://avatars.discourse-cdn.com/v4/letter/c/f04885/32.png) [@Corentin-F](https://discourse.nodered.org/u/Corentin-F)\
**Post date:** [3 August 2022 15:21 UTC](https://discourse.nodered.org/t/problem-with-intres-azure-cognitive-speech-to-text/65882/9 "2022-08-03T15:21:44Z")

</div>

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.

---

<div class="post-metadata">

**Author:** ![Patrick\_UK](https://avatars.discourse-cdn.com/v4/letter/p/df788c/32.png) [@Patrick\_UK](https://discourse.nodered.org/u/Patrick_UK)\
**Post date:** [3 August 2022 19:34 UTC](https://discourse.nodered.org/t/problem-with-intres-azure-cognitive-speech-to-text/65882/10 "2022-08-03T19:34:30Z")

</div>

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

---

<div class="post-metadata">

**Author:** ![Corentin-F](https://avatars.discourse-cdn.com/v4/letter/c/f04885/32.png) [@Corentin-F](https://discourse.nodered.org/u/Corentin-F)\
**Post date:** [4 August 2022 08:21 UTC](https://discourse.nodered.org/t/problem-with-intres-azure-cognitive-speech-to-text/65882/11 "2022-08-04T08:21:26Z")

</div>

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.

---

<div class="post-metadata">

**Author:** ![Corentin-F](https://avatars.discourse-cdn.com/v4/letter/c/f04885/32.png) [@Corentin-F](https://discourse.nodered.org/u/Corentin-F)\
**Post date:** [4 August 2022 11:48 UTC](https://discourse.nodered.org/t/problem-with-intres-azure-cognitive-speech-to-text/65882/12 "2022-08-04T11:48:52Z")

</div>

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.

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

```

---

<div class="post-metadata">

**Author:** ![system](https://us1.discourse-cdn.com/flex026/uploads/nodered/original/1X/d073cd938eafa2e558d7c2cd59003b3ef4963033.png) [@system](https://discourse.nodered.org/u/system)\
**Post date:** [18 August 2022 11:49 UTC](https://discourse.nodered.org/t/problem-with-intres-azure-cognitive-speech-to-text/65882/13 "2022-08-18T11:49:35Z")

</div>

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