DrAbc.SilkSharp 2.0.2

There is a newer version of this package available.
See the version list below for details.
dotnet add package DrAbc.SilkSharp --version 2.0.2                
NuGet\Install-Package DrAbc.SilkSharp -Version 2.0.2                
This command is intended to be used within the Package Manager Console in Visual Studio, as it uses the NuGet module's version of Install-Package.
<PackageReference Include="DrAbc.SilkSharp" Version="2.0.2" />                
For projects that support PackageReference, copy this XML node into the project file to reference the package.
paket add DrAbc.SilkSharp --version 2.0.2                
#r "nuget: DrAbc.SilkSharp, 2.0.2"                
#r directive can be used in F# Interactive and Polyglot Notebooks. Copy this into the interactive tool or source code of the script to reference the package.
// Install DrAbc.SilkSharp as a Cake Addin
#addin nuget:?package=DrAbc.SilkSharp&version=2.0.2

// Install DrAbc.SilkSharp as a Cake Tool
#tool nuget:?package=DrAbc.SilkSharp&version=2.0.2                

SilkSharp

alternate text is missing from this package README image NuGet Downloads

SilkSharp is a simple binding for silk-codec https://github.com/foyoux/silk-codec

It can convert audio in s16le format to silk v3 format

Compatible wechat and QQ


SilkSharp 是一个 silk-codec https://github.com/foyoux/silk-codec 的简单绑定

它可以将s16le格式的音频转换为silk v3格式

兼容微信和QQ格式


usage:

//Encoding
Encoder encoder = new();
//File
encoder.EncodeAsync("./rasputin.pcm", "./rasputin.silk");
//Stream
using FileStream fse = File.OpenRead("./rasputin.pcm");
using MemoryStream mse = new(await encoder.EncodeAsync(fse));

//Decoding
Decoder decoder = new();
//File
encoder.EncodeAsync("./badmoonrising.silk", "./badmoonrising.pcm");
//Stream
using FileStream fsd = File.OpenRead("./badmoonrising.silk");
using MemoryStream msd = new(await encoder.EncodeAsync(fsd));

E.g: Convert other audio to pcm (NAudio)

using NAudio.Wave;

using Mp3FileReader reader = new("input.mp3");
WaveFormat pcmFormat = new(16000, 16, 1);
using WaveFormatConversionStream conversionStream = new(pcmFormat, reader);
Encoder encoder = new()
{
    //Same with your music
    Rate = 16000,
    FS_API = 16000,
    //QQ and Wechat Compatibility
    Tencent = true
};
using MemoryStream silk = new(await encoder.EncodeAsync(conversionStream));
Product Compatible and additional computed target framework versions.
.NET net8.0 is compatible.  net8.0-android was computed.  net8.0-browser was computed.  net8.0-ios was computed.  net8.0-maccatalyst was computed.  net8.0-macos was computed.  net8.0-tvos was computed.  net8.0-windows was computed. 
Compatible target framework(s)
Included target framework(s) (in package)
Learn more about Target Frameworks and .NET Standard.
  • net8.0

    • No dependencies.

NuGet packages (1)

Showing the top 1 NuGet packages that depend on DrAbc.SilkSharp:

Package Downloads
DrAbc.SilkSharp.NAudio

silk v3 codec binding, support WeChat and QQ

GitHub repositories

This package is not used by any popular GitHub repositories.