Coder Social home page Coder Social logo

encoder: invalid argument about opus HOT 1 CLOSED

hraban avatar hraban commented on July 1, 2024
encoder: invalid argument

from opus.

Comments (1)

hraban avatar hraban commented on July 1, 2024

The error comes from the encode step, which is encoding uninitialised PCM data. Do you have pcm float data somewhere to encode? If you can't find any; have a look at stream_test.go and testdata/speech_8.wav for how to get PCM data from a .wav file. Another way to generate raw PCM data is shown in utils_test.go; the addSine function will add a sine wave to a set of PCM samples.

Note: PCM data = raw audio samples. Audio is a sequence of air pressure measurements, at very high frequency. You can plot the PCM data in Excel to see the waveform, e.g. #18 (comment) . Opus is a library to turn that waveform into a dense series of bytes, so when you decode it, you get more or less the original waveform back. Have a look at the test files for examples of use, and what kind of data you can pass in.

I'm closing this issue since it's not a bug in the opus wrapper code, but a support ticket. Feel free to ask more questions after you've looked at the test files and we'll see if we can sort this out :)

from opus.

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.