Membrane Multimedia Framework: Mad Element
This package provides Membrane Multimedia Framework elements that can be used to decode MPEG audio using MAD library.
Documentation is available at HexDocs
Installation
Add the following line to your deps
in mix.exs
. Run mix deps.get
.
{:membrane_element_mad, "~> 0.1"}
You also need to have MAD installed.
Sample usage
Playing below pipeline should read input.mp3
, decode and save raw payload to output
:
defmodule MadExamplePipeline do
use Membrane.Pipeline
alias Pipeline.Spec
alias Membrane.Element.{Mad, File}
@impl true
def handle_init(_) do
children = [
src: %File.Source{location: "input.mp3"},
decoder: Mad.Decoder,
sink: %File.Sink{location: "output"},
]
links = %{
{:src, :source} => {:decoder, :sink},
{:decoder, :source} => {:sink, :sink}
}
{{:ok, %Spec{children: children, links: links}}, %{}}
end
end
Copyright and License
Copyright 2018, Software Mansion
Licensed under the Apache License, Version 2.0