Class Decoder
Represents an Opus decoder for decoding Opus-encoded data to PCM.
Inheritance
System.Object
Decoder
Implements
System.IDisposable
Inherited Members
System.Object.ToString()
System.Object.Equals(System.Object)
System.Object.Equals(System.Object, System.Object)
System.Object.ReferenceEquals(System.Object, System.Object)
System.Object.GetHashCode()
System.Object.GetType()
System.Object.MemberwiseClone()
Namespace: Adrenak.UnityOpus
Assembly: cs.temp.dll.dll
Syntax
public class Decoder : IDisposable
Constructors
Decoder(SamplingFrequency, NumChannels)
Initializes a new instance of the Decoder class.
Declaration
public Decoder(SamplingFrequency samplingFrequency, NumChannels channels)
Parameters
Type | Name | Description |
---|---|---|
SamplingFrequency | samplingFrequency | The sampling frequency of the input data. |
NumChannels | channels | The number of audio channels. |
Fields
maximumPacketDuration
The maximum packet duration supported by the Opus decoder.
Declaration
public const int maximumPacketDuration = 5760
Field Value
Type | Description |
---|---|
System.Int32 |
Methods
Decode(Byte[], Int32, Single[], Int32)
Decodes the provided Opus data into PCM float format.
Declaration
public int Decode(byte[] data, int dataLength, float[] pcm, int decodeFec = 0)
Parameters
Type | Name | Description |
---|---|---|
System.Byte[] | data | The Opus-encoded byte data. |
System.Int32 | dataLength | The length of the input data. |
System.Single[] | pcm | Output float array for PCM data. |
System.Int32 | decodeFec | Flag to enable forward error correction (FEC). |
Returns
Type | Description |
---|---|
System.Int32 | The length of the decoded PCM data. |
Dispose()
Disposes of the decoder and suppresses finalization.
Declaration
public void Dispose()
Dispose(Boolean)
Releases the unmanaged resources used by the decoder.
Declaration
protected virtual void Dispose(bool disposing)
Parameters
Type | Name | Description |
---|---|---|
System.Boolean | disposing | True if disposing managed resources. |
Finalize()
Finalizer for Decoder.
Declaration
protected void Finalize()
Implements
System.IDisposable