Empresas
Empregos
  • Sobre nós
  • Soluções
    • Publicação de vagas
      Publique sua vaga e receba candidatos qualificados em 48h.
    • Avaliações de candidatos
      Mais de 500 testes técnicos e psicológicos, mais anti-fraude.
    • Headhunting
      Busca executiva personalizada do início ao fim.
    • Folha de Pagamento + EOR
      Dispersão de folha e EOR em mais de 15 países da LATAM.
  • Preços
  • Empregos

0

463
Visualizações
Dart Uint8list to javascript/node ArrayBuffer

I'm trying to pass the output from the microphone in a Flutter app to a Node server that proxies a Speech to Text service via a websocket. The microphone produces a Uint8list which I'm trying to convert to a javascript ArrayBuffer and send over the websocket. The node service works ok with other clients and on inspection is receiving data that looks like from the websocket:

<Buffer f9 ff fa ff f9 ff f7 ff f5 ff f7 ff f8 ff f5 ff f2 ff f0 ff f5 ff f7 ff f1 ff f2 ff f1 ff f2 ff f6 ff f5 ff f2 ff f4 ff f7 ff f7 ff f7 ff f9 ff fe ff ... 2922 more bytes>

However with the Flutter app it recieves data that looks like:

[
    7,  13, 114, 101,  99, 111, 114, 100, 105, 110, 103,  68,
   97, 116,  97,  13,   4,   7,   7, 115, 117,  99,  99, 101,
   ...
]

which can't be consumed by the STT service. Can anyone help with this? The STT service expects audio data in the following format:


    - PCM format
    - One channel
    - 16 bits per sample, 8,000 or 16,000 samples per second (16,000 bytes or 32,000 bytes per second)
    - Two-block aligned (16 bit including padding for a sample)

It's the last requirement that's tripping me up I believe.

EDIT: I solved this by wrapping the array in a Uint8Array on the Node side const uint8Array = new Uint8Array(data). I couldn't get Flutter to output the data in the required format

about 4 years ago · Juan Pablo Isaza
Responde à pergunta
Encontrar trabalhos remotos

Descubra a nova forma de encontrar um emprego!

melhores empregos
Principais categorias de trabalho
Empresas
Postar vaga Preços Comercial
Jurídico
Termos e Condições Política de privacidade
© 2026 PeakU Inc. All Rights Reserved.
Andres GPT
Recomende algumas ofertas para mim
Preciso de ajuda