OpusDotNet
An easy-to-use library for encoding and decoding 16-bit audio using the Opus Audio Codec.
Install / Use
/learn @mrphil2105/OpusDotNetREADME
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
- This project is licensed under the MIT License.
- Opus Audio Codec is licensed under the BSD License.
Related Skills
node-connect
350.8kDiagnose OpenClaw node connection and pairing failures for Android, iOS, and macOS companion apps
frontend-design
110.4kCreate distinctive, production-grade frontend interfaces with high design quality. Use this skill when the user asks to build web components, pages, or applications. Generates creative, polished code that avoids generic AI aesthetics.
openai-whisper-api
350.8kTranscribe audio via OpenAI Audio Transcriptions API (Whisper).
qqbot-media
350.8kQQBot 富媒体收发能力。使用 <qqmedia> 标签,系统根据文件扩展名自动识别类型(图片/语音/视频/文件)。
