Class VoiceEncoder
Encodes 20 ms voice frames as Opus packets, with Concentus in pure C#.
Inherited Members
Namespace: Uniform.Matrix.Audio
Assembly: Uniform.Matrix.Audio.dll
Syntax
public sealed class VoiceEncoder
Remarks
Tuned for speech: the VoIP application, voice signal, variable bit rate and in-band forward error correction, so a lost packet can be partly recovered from the next.
Constructors
| Edit this page View SourceVoiceEncoder(int)
Create an encoder.
Declaration
public VoiceEncoder(int bitrate = 32000)
Parameters
| Type | Name | Description |
|---|---|---|
| int | bitrate | Bits per second; 32 kbit/s gives clear wideband speech. |
Fields
| Edit this page View SourceMaxPacketBytes
Largest Opus packet.
Declaration
public const int MaxPacketBytes = 1275
Field Value
| Type | Description |
|---|---|
| int |
Methods
| Edit this page View SourceEncode(ReadOnlySpan<short>)
Encode one frame of FrameSamples samples; return the Opus packet.
Declaration
public byte[] Encode(ReadOnlySpan<short> frame)
Parameters
| Type | Name | Description |
|---|---|---|
| ReadOnlySpan<short> | frame |
Returns
| Type | Description |
|---|---|
| byte[] |