Membrane WAV Plugin
This repository provides WAV Parser.
It is part of Membrane Multimedia Framework.
Installation
The package can be installed by adding membrane_wav_plugin to your list of dependencies in mix.exs:
def deps do
[
{:membrane_wav_plugin, "~> 0.1.0"}
]
end
Parser
The Parser requires a WAV file on the input and provides a raw audio in uncompressed, PCM format on the output.
Parsing steps:
- Reading WAV header
- Extracting audio metadata and sending it through caps to the next element
- Sending only audio samples to the next elements
It can parse only uncompressed audio.
Sample usage
defmodule Mixing.Pipeline do
use Membrane.Pipeline
@impl true
def handle_init(_) do
children = [
file_src: %Membrane.File.Source{location: "/tmp/input.wav"},
parser: Membrane.WAV.Parser,
converter: %Membrane.FFmpeg.SWResample.Converter{
input_caps: %Membrane.Caps.Audio.Raw{channels: 1, sample_rate: 16_000, format: :s16le},
output_caps: %Membrane.Caps.Audio.Raw{channels: 2, sample_rate: 48_000, format: :s16le}
},
player: Membrane.PortAudio.Sink
]
links = [
link(:file_src)
|> to(:parser)
|> to(:converter)
|> to(:player)
]
{{:ok, spec: %ParentSpec{children: children, links: links}}, %{}}
end
end
Copyright and License
Copyright 2021, Software Mansion
Licensed under the Apache License, Version 2.0