Create audio apps without headache in the .NET ecosystem.
This library allows you to create audio apps without a lot of headache existing in the "audio topic"
See Documentation
You can add this lib via nuget package manager.
dotnet cli example:
dotnet add package NextAudio
OBS: This install only the core lib. The individual components may also be installed from NuGet.
The stable builds are available from NuGet.
The development builds are availabe from Myget feed https://www.myget.org/F/next-audio/api/v3/index.json
.
These builds target the main
branch.
The lib will always use audio frame buffers for read/write operations.
This makes the streaming data very easy.
using var output = new MemoryStream();
using var file = AudioStream.CreateFromFile("test1.mkv");
using var demuxer = new MatroskaDemuxer(file);
var bytesRead = 0;
Span<byte> buffer = new byte[1024];
while ((bytesRead = demuxer.Demux(buffer)) > 0)
{
// Always slice the buffer to bytesRead,
// the lib always will return an audio frame
// when using a read operation.
var frame = buffer.Slice(0, bytesRead);
output.Write(frame);
}
For more usage and guides check the documentation
- High performance, low memory allocation with
Span<T>
,Memory<T>
,ArrayPool
and lower GC pressure withValueTask
. - Fully Sync and Async support.
- Per audio frame reading/writing.
- Logging with
Microsoft.Extensions.Logging
. - Symbols debugging (
.snupkg
).
- Matroska (.mkv/.webm)
OBS: Goals will change as new lib versions come out.
- File (current supported by
AudioStream.CreateFromFile
) - Http (current supported by
AudioStream.CreateFromStream
but is not persistent) - Youtube
- Ogg (.ogg/.ogv/.oga/.ogx)
- Wav (.wav/.wave)
- MPEG-4 Part 14 (.mp4)
- Flac (.flac)
- Opus (.opus)
- Vorbis (.ogg/.oga)
- AAC (.m4a/.m4b/.m4p/.m4v/.m4r/.aac/.3gp/.mp4)
- MPEG-1/2 Audio Layer 3 (.mp3/.mp4)
- Opus (.opus)
- Matroska (.mkv/.webm)
- Ogg (.ogg/.ogv/.oga/.ogx)
- Wav (.wav/.wave)
- MPEG-4 Part 14 (.mp4)
- Flac (.flac)
- Seeking (by timestamp)
- Volume
- Resampling
- Mono to Stereo
- Package with all lib individual components
- Audio Pipelines (less complexity when wanna a specific output format)
- Support for
Microsoft.Extensions.DependencyInjection
- Writing to output formats (
PipelineWriter
/Stream
) - An Audio Player structure to control play/queue/pause/seek/volume operations
To contribute to this library follow the Contributing guideline
This project uses the MIT License.
See Code of Conduct