Ecosyste.ms: Awesome

An open API service indexing awesome lists of open source software.

Awesome Lists | Featured Topics | Projects

https://github.com/jimm98y/sharpjaad

SharpJaad is an AAC decoder and MP4 demultiplexer library written completely in C#. It uses no native libraries, is platform-independent and portable. It can read MP4 container from a stream and decode AAC-LC (Low Complexity) and HE-AAC (High Efficiency/AAC+). Ported into C# (netstandard2.0) from: sourceforge.net/projects/jaadec
https://github.com/jimm98y/sharpjaad

aac audio-processing codec decoder netstandard

Last synced: 22 days ago
JSON representation

SharpJaad is an AAC decoder and MP4 demultiplexer library written completely in C#. It uses no native libraries, is platform-independent and portable. It can read MP4 container from a stream and decode AAC-LC (Low Complexity) and HE-AAC (High Efficiency/AAC+). Ported into C# (netstandard2.0) from: sourceforge.net/projects/jaadec

Awesome Lists containing this project

README

        

# SharpJaad
JAAD is an AAC decoder and MP4 demultiplexer library written completely in Java. It uses no native libraries, is platform-independent and portable. It can read MP4 container from almost every input-stream (files, network sockets etc.) and decode AAC-LC (Low Complexity) and HE-AAC (High Efficiency/AAC+).

SharpJaad is a netstandard2.0 port of the original Java code base with a few small fixes. It has no third-party dependencies and it's portable as it does not use any platform-specific APIs.

## SharpJaad.AAC
SharpJaad.AAC is just the AAC decoder without any MP4 code. It's well suited for applications in RTP where the MP4 container is not needed.

### Example
To decode stereo AAC Low Complexity (AAC-LC) with 44.1kHz, start with creating the configuration:
```cs
var decoderConfig = new DecoderConfig();
decoderConfig.SetProfile(Profile.AAC_LC);
decoderConfig.SetSampleFrequency(SampleFrequency.SAMPLE_FREQUENCY_44100);
decoderConfig.SetChannelConfiguration((ChannelConfiguration)2);
```

Create the decoder:
```cs
var aacDecoder = new Decoder(decoderConfig);
```

Create an output buffer for the result:
```cs
SampleBuffer buffer = new SampleBuffer();
buffer.SetBigEndian(false);
```

Decode the AAC frame:
```cs
byte[] aacFrame = { ... } // AAC frame to decode
aacDecoder.DecodeFrame(aacFrame, buffer);
```

Convert it to PCM:
```cs
short[] pcm = new short[buffer.Data.Length / sizeof(short)];
Buffer.BlockCopy(buffer.Data, 0, pcm, 0, buffer.Data.Length);
```

## SharpJaadMain
A sample application that can extract AAC audio from a (MP4) file and transcode it into a WAV file.

## Credits
This is a port of the https://sourceforge.net/projects/jaadec/ into C#.