Skip to content

rg-net/OpusConductor

Folders and files

NameName
Last commit message
Last commit date

Latest commit

 

History

5 Commits
 
 
 
 
 
 
 
 
 
 
 
 

Repository files navigation

OpusConductor

OpusConductor

OpusConductor 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 OpusConductor via the NuGet Package Manager:

Install-Package OpusConductor

Basic Usage

A simple example of encoding and decoding audio:

using (var encoder = new OpusEncoder(OpusOptimizer.Clarity, OpusSampleRate._48k, OpusAudioChannels.Stereo)
{
    VBR = true // Variable bitrate
})
using (var decoder = new OpusDecoder(OpusSampleRate._48k, OpusAudioChannels.Stereo))
{
    // 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

About

No description, website, or topics provided.

Resources

License

Stars

Watchers

Forks

Releases

No releases published

Packages

No packages published

Languages