Skip to content

MineCake147E/Shamisen

Folders and files

NameName
Last commit message
Last commit date

Latest commit

 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 

Repository files navigation

Shamisen Logo

Shamisen - .NET Audio Library

CodeFactor .NET
A Cross-Platform Audio Library for .NET 8.

Usage of Shamisen

  • Fast Digital Signal Processing
  • Abstraction Layer for Audio I/O

Currently implemented features

Audio I/O and bindings

Managed backends using existing library

Name (Backend) Author (Backend) License (Binding) Windows10 Desktop Windows10 UWP Android Linux iOS Mac OSX
OpenTK (OpenAL) OpenTK MIT License
AudioGraph on
.NET 5 or later
Microsoft MIT License
NAudio (WaveOut, ASIO, DirectSound, WASAPI) NAudio MIT License
Xamarin.Android (AudioTrack) Xamarin MIT License

❓: Not Tested or needs more information
✅: Tested
❎: Impossible

Digital Signal Processing (Cross-Platform)

Fast and smooth Up-sampling using Catmull-Rom Spline

  • Utilizes System.Numerics.Vectors and System.Runtime.Intrinsics for resampling calculation.
  • Uses Direct/Wrapped caching for Catmull-Rom spline coefficients.

Benchmarks on .Net 5, Intel Core i7 4790

Highly Optimized Cooley–Tukey FFT algorithm for single-precision 1D complex data.

  • Utilizes System.Runtime.Intrinsics.X86.Avx and System.Runtime.Intrinsics.X86.Avx2 for FFT calculation.
  • Forward transformation rescales result by 1/N.
  • The memory consumption is O(N) even though the FFT is done in-place.
  • Does not need initialization for certain fixed size by default.
    • Fixed-size variant is also implemented and is slightly faster.
  • It requires that the size of the data be a power of two. Otherwise, the data will be implicitly resized to the size of the largest power of two less than the original size.

Fast conversion between PCM sample formats

To\From IEEE 754
Binary32(float)
32bit Linear
PCM(Q0.31)
24bit Linear
PCM(Q0.23)
16bit Linear
PCM(Q0.15)
8bit LPCM
(Excess-128)
G.711
μ−Law
G.711
A-Law
IEEE 754
Binary32(float)
✖️ ✅*
32bit Linear
PCM(Q0.31)
✅* ✖️ ☑️ ☑️ ☑️ ☑️ ☑️
24bit Linear
PCM(Q0.23)
✅* ☑️* ✖️ ☑️ ☑️ ☑️ ☑️
16bit Linear
PCM(Q0.15)
✅* ☑️* ☑️* ✖️ ☑️ ☑️ ☑️
8bit LPCM
(Excess-128)
✅* ☑️* ☑️* ☑️* ✖️ ☑️* ☑️*
G.711 μ−Law ✅* ☑️* ☑️* ☑️* ☑️* ✖️ ☑️*
G.711 A-Law ✅* ☑️* ☑️* ☑️* ☑️* ☑️* ✖️

Legends:
✅: Shamisen has optimized implementation of direct conversion.
☑️: Shamisen can handle conversion by 2 or more converter. Can be partially optimized. Depending on the combination, noise due to quantization error may occur.
✔: Shamisen has simple implementation of direct conversion.
⭕: Shamisen can handle conversion by 2 or more converter. Both converter is implemented in simple way. Depending on the combination, noise due to quantization error may occur.
❎: Shamisen has no support for conversion.
✖️: No conversion needed(same format).
* : Such conversion can cause noise due to quantization errors.

Optimized BiQuad Filters that supports some filtering

  • Uses Vector2 and Vector3 for filter calculations in each channels.
  • Unrolls channel loop for Monaural and <5ch filter calculation.
  • For some special cases, it utilizes SSEx.x and AVX(2) intrinsics for the calculation.

Other Features

  • FastFill for some types that fills quickly using Vector<T>.

File Formats and Codecs

Cross-Platform

Container Name Typical File Extensions Implemented Codec Library contains Decoder/Encoder License Decoding Encoding
Waveform
RF64
.wav Linear PCM, IEEE 754 Floating-Point PCM, A-Law, μ-law Shamisen MIT License
(RF64 as default)
FLAC .flac FLAC Shamisen.Codecs.Flac MIT License ❎(Planned)

Legends:
✅: Supported by Shamisen itself
✔: Supported by another library and its wrapper for Shamisen
❎: Not supported by Shamisen without any custom integration

Platform-Dependent

  • Any formats supported by platform-dependent binding libraries

Dependencies and system requirements

  • Currently, Unity IS NOT SUPPORTED AT ALL!
  • Requires DivideSharp for frequently appearing divide-by-number-of-channels operations.
  • The most processing in this library fully depends on SINGLE core.
    • Because Span<T> does not support multi-thread processing at all.

Features planned or under development

Audio I/O and bindings

Native backends

✅: Possible
❓: Needs more information
❎: Impossible

Name of Backend Author of Backend License (binding) Target Platform Status
Oboe Google MIT License Android >10 Planned

Managed backends

✅: Possible
❓: Needs more information
❎: Impossible

Name of Backend Author of Backend License (binding) Target Platforms Status
Silk.NET OpenAL .NET Foundation Silk.NET Team MIT License Cross Platform(OpenAL) Gathering Information
Silk.NET XAudio .NET Foundation Silk.NET Team MIT License Windows-Like(XAudio) Planned
Xamarin.iOS Microsoft MIT License iOS Planned

File Formats and Codecs

Cross-Platform

✅: Shamisen will have Managed Implementation of decoder/encoder itself
⭕: Shamisen will have Managed Wrapper for another library
❎: Not included in plan currently

Container Name Typical File Extensions Target Codec Planned Library containing Decoder/Encoder Planned Library License Decoding Encoding Status
FLAC .flac FLAC Shamisen.Codecs.Flac MIT License Implemented Decoder
Opus .opus Opus Shamisen.Codecs.Opus MIT License Planned
Ogg .ogg Vorbis Shamisen.Codecs.Ogg MIT License Planned