SkillAgentSearch skills...

OpusDotNet

An easy-to-use library for encoding and decoding 16-bit audio using the Opus Audio Codec.

Install / Use

/learn @mrphil2105/OpusDotNet
About this skill

Quality Score

0/100

Supported Platforms

Universal

README

OpusDotNet

OpusDotNet

OpusDotNet is a wrapper around the official libopus, and makes it easy to encode and decode audio. The library is mainly suited for VoIP applications and at the moment only provides libopus binaries for Windows (compiled with the Win10 SDK).

Getting Started

Installation

Install OpusDotNet via the NuGet Package Manager:

Install-Package OpusDotNet

Basic Usage

A simple example of encoding and decoding audio:

using (var encoder = new OpusEncoder(Application.Audio, 48000, 2)
{
    Bitrate = 128000, // 128 kbps
    VBR = true // Variable bitrate
})
using (var decoder = new OpusDecoder(48000, 2))
{
    // 40 ms of silence at 48 KHz (2 channels).
    byte[] inputPCMBytes = new byte[40 * 48000 / 1000 * 2 * 2];
    byte[] opusBytes = encoder.Encode(inputPCMBytes, inputPCMBytes.Length, out int encodedLength);
    byte[] outputPCMBytes = decoder.Decode(opusBytes, encodedLength, out int decodedLength);
}

Licenses

Related Skills

View on GitHub
GitHub Stars32
CategoryDevelopment
Updated6mo ago
Forks12

Languages

C#

Security Score

82/100

Audited on Sep 12, 2025

No findings