You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
I am trying to use Opus.NET to convert from an OGG with Opus data into a WAV file.
My OGG data originates from the Firefox MediaReader API, which records audio from the computer's microphone. Here is a sample data URL. I transmit this data URL to my server, and I decode it into a byte array as follows.
// `recording` is the data URL stringvarbase64=recording.Substring(1+recording.IndexOf(","));varbytes=Convert.FromBase64String(base64);vardecoder=OpusDecoder.Create(48000,1);intlen=this.inputBytes.Length;this.wavBytes=decoder.Decode(this.inputBytes,len,outlen);
The base 64 decoding works fine. However, when the code gets to the decoder.Decode line, it throws the following exception:
Decoding failed - InvalidPacket
I have two questions:
What is the best way to pass a data URL to the OpusDecoder such that the OpusDecoder will accept it?
Once the OpusDecoder is formed, how do you save it as a WAV file?
Thanks in advance!
The text was updated successfully, but these errors were encountered:
This project is a low level wrapper around the Opus codec. Opus media files that are contained in the OGG format will need a library to read frames from the container format.
Hello,
I am trying to use Opus.NET to convert from an OGG with Opus data into a WAV file.
My OGG data originates from the Firefox MediaReader API, which records audio from the computer's microphone. Here is a sample data URL. I transmit this data URL to my server, and I decode it into a byte array as follows.
The base 64 decoding works fine. However, when the code gets to the decoder.Decode line, it throws the following exception:
I have two questions:
Thanks in advance!
The text was updated successfully, but these errors were encountered: