Skip to content

Commit

Permalink
Readme
Browse files Browse the repository at this point in the history
  • Loading branch information
StefH committed Jan 5, 2021
1 parent d1faae4 commit baa8a52
Show file tree
Hide file tree
Showing 2 changed files with 11 additions and 2 deletions.
7 changes: 5 additions & 2 deletions README.md
Original file line number Diff line number Diff line change
Expand Up @@ -20,9 +20,12 @@ A Matroska demuxer to extract Ogg Opus audio from a .webm file
[![NuGet](https://buildstats.info/nuget/Matroska)](https://www.nuget.org/packages/Matroska)

### Usage
Todo
Extract
``` c#
...
var inputStream = new FileStream("test.webm", FileMode.Open, FileAccess.Read);
var outputStream = File.OpenWrite("test.opus");

MatroskaDemuxer.ExtractOggOpusAudio(inputStream, outputStream);
```

# Credits
Expand Down
6 changes: 6 additions & 0 deletions src/Matroska.Muxer/MatroskaDemuxer.cs
Original file line number Diff line number Diff line change
Expand Up @@ -6,6 +6,12 @@ namespace Matroska.Muxer
{
public static class MatroskaDemuxer
{
public static void ExtractOggOpusAudio(Stream inputStream, Stream outputStream)
{
var doc = MatroskaSerializer.Deserialize(inputStream);
new OggOpusAudioStreamDemuxer(doc).CopyTo(outputStream);
}

public static void ExtractOggOpusAudio(MatroskaDocument doc, Stream outputStream)
{
new OggOpusAudioStreamDemuxer(doc).CopyTo(outputStream);
Expand Down

0 comments on commit baa8a52

Please sign in to comment.