CSCore .NET Audio Library

repository·master·Indexed 25 days ago

https://github.com/filoe/cscore

A high-performance, extensible .NET audio library written in C# for building music players, game audio engines, and recording software. It provides low-level hardware access, real-time audio processing, and DSP capabilities including FFT, resamplers, and equalizers. Supports multiple backends such as WASAPI, XAudio2, DirectSoundOut, and WaveOut. Includes native codec support for MP3, WAVE, FLAC, and AAC, with extended format support available via the LGPL-licensed CSCore.Ffmpeg package.

Tokens
1K
Snippets
3
Records
7
Agent score
82%

What's inside CSCore

  1. Overview of CSCore features and capabilities

    master

    CSCore is a high-performance, extensible .NET audio library written in C#. It is designed for both beginners and professionals to build applications like music players, voice chats, and audio recorders.

    Key Capabilities:

    • Realtime Audio Processing: Apply processors (effects, analyzers, decoders) in any order in real-time. You can also create custom processors.
    • Speaker Output: Supports multiple backends including WaveOut, DirectSoundOut (real-time streaming), WASAPI (with exclusive mode and callback support), and XAudio2.
    • Recording: Supports WaveIn and WASAPI (including loopback capture to record system output).
    • DSP & Effects: Includes FFT (Fast Fourier Transform), Resamplers, Equalizers, and various effects like Echo, Compressor, Reverb, Chorus, Gargle, and Flanger.
    • Codecs: Native support for MP3, WAVE (PCM, IeeeFloat, GSM, ADPCM), FLAC, AAC, AC3, WMA, and Raw data. OGG-Vorbis is available via NVorbis. Extended format support is available via CSCore.Ffmpeg.
    • XAudio2 Support: Optimized for games, supporting XAudio2.7/2.8, 3D Audio, and streaming source voices.
    • Platform Support: Primarily Windows. Linux and macOS support is currently experimental.
  2. Debug CSCore.Ffmpeg in MonoDevelop

    master

    To debug an assembly using MonoDevelop on Linux, you need to configure the LD_LIBRARY_PATH environment variable within the project settings so the debugger can locate the native FFmpeg libraries:

    1. Open the Project Options of your project.
    2. Navigate to Run > General.
    3. Add a new variable with the name LD_LIBRARY_PATH.
    4. Set the value of this variable to your project's output directory (the folder containing your compiled assembly).
  3. Install CSCore.Ffmpeg for extended codec support

    master

    If you require support for additional audio formats via FFmpeg, you must install the CSCore.Ffmpeg NuGet package. Note that while the core CSCore library is licensed under MS-PL, the CSCore.Ffmpeg project is licensed under LGPL.

    Install-Package CSCore.Ffmpeg -Pre
  4. Run CSCore.Ffmpeg on Linux & Mono

    master

    When using CSCore.Ffmpeg on Linux or with Mono, you must ensure that the native libraries are located in the same directory as your assembly. To ensure the runtime can find these libraries, you must set the LD_LIBRARY_PATH environment variable to point to your assembly's output directory.

    To run your application via the command line, use:

    LD_LIBRARY_PATH=./ mono MyApp.exe
  5. License information for CSCore.Ffmpeg

    master

    The CSCore.Ffmpeg project is licensed under the LGPL2.1 (GNU Lesser General Public License, version 2.1).

    When using this library in a Combined Work (an application that links with the library), you may convey the work under terms of your choice, provided you meet the following requirements:

    1. Notice: Give prominent notice with each copy that the library is used and is covered by the LGPL.
    2. Documentation: Accompany the work with a copy of the GNU GPL and this license document.
    3. Copyright: If the work displays copyright notices during execution, include the library's copyright notice and a reference to the GPL/LGPL.
    4. Relinking/Shared Library: You must either:
      • Convey the Minimal Corresponding Source and Corresponding Application Code in a form that allows the user to recombine or relink the application with a modified version of the library.
      • Use a suitable shared library mechanism for linking (e.g., using a copy of the library already present on the user's system that is interface-compatible with the version used).
    5. Installation Information: If required by the GPL, provide information necessary to install and execute a modified version of the combined work produced by recombining or relinking.