GithubHelp home page GithubHelp logo

Comments (4)

tempops avatar tempops commented on July 19, 2024 1

Hello,
I had to provide pipe:0 input to ffmpeg to ingest bytes on the fly and provide metadata about the bytes beforehand to make it work.

Thanks!

from sherpa-onnx.

csukuangfj avatar csukuangfj commented on July 19, 2024

I am getting raw audio bytes

Everything in the computer is represented in bytes.

Given that you did not describe any metadata about the bytes, it is not possible to tell you how to do with your bytes, since
the bytes can represent any thing.

from sherpa-onnx.

tempops avatar tempops commented on July 19, 2024

These bytes are from an audio stream, I am sending the bytes to be decoded by ffmpeg and then read by Sherpa_ONNX. The audio stream is from online-websocket-client-microphone.py which is sending the microphone bytes to the websocket I had given above:

recognizer = create_recognizer(args)

byte = await websocket.recv()

ffmpeg_cmd = [
"ffmpeg",
"-i",
byte,
"-f",
"s16le",
"-acodec",
"pcm_s16le",
"-ac",
"1",
"-ar",
"16000",
"-",
]

However ffmpeg does not give any output in stdout and it is stuck at the first frame

data = process.stdout.read(frames_per_read * 2)
if not data:
break

do we need to send a specific chunk of bytes as input to ffmpeg? currently it is receiving byte length of 3200

from sherpa-onnx.

csukuangfj avatar csukuangfj commented on July 19, 2024

I suggest that you save the output of ffmpeg to a file and check the file.

from sherpa-onnx.

Related Issues (20)

Recommend Projects

  • React photo React

    A declarative, efficient, and flexible JavaScript library for building user interfaces.

  • Vue.js photo Vue.js

    🖖 Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.

  • Typescript photo Typescript

    TypeScript is a superset of JavaScript that compiles to clean JavaScript output.

  • TensorFlow photo TensorFlow

    An Open Source Machine Learning Framework for Everyone

  • Django photo Django

    The Web framework for perfectionists with deadlines.

  • D3 photo D3

    Bring data to life with SVG, Canvas and HTML. 📊📈🎉

Recommend Topics

  • javascript

    JavaScript (JS) is a lightweight interpreted programming language with first-class functions.

  • web

    Some thing interesting about web. New door for the world.

  • server

    A server is a program made to process requests and deliver data to clients.

  • Machine learning

    Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.

  • Game

    Some thing interesting about game, make everyone happy.

Recommend Org

  • Facebook photo Facebook

    We are working to build community through open source technology. NB: members must have two-factor auth.

  • Microsoft photo Microsoft

    Open source projects and samples from Microsoft.

  • Google photo Google

    Google ❤️ Open Source for everyone.

  • D3 photo D3

    Data-Driven Documents codes.