membrane_flac_plugin

Plugin for parsing FLAC encoded audio stream


License
Apache-2.0

Documentation

Membrane FLAC plugin

Hex.pm API Docs CircleCI

This package provides an element for parsing FLAC encoded audio stream. More info can be found in the docs for element module.

Installation

The package can be installed by adding membrane_flac_plugin to your list of dependencies in mix.exs:

def deps do
  [
    {:membrane_flac_plugin, "~> 0.8.0"}
  ]
end

Usage example

defmodule Membrane.Demo.FlacPipeline do
  use Membrane.Pipeline
  alias Membrane.{Fake}
  @impl true
  def handle_init(_opts) do
    children = %{
      file: %Membrane.File.Source{location: "sample.flac"},
      parser: %Membrane.FLAC.Parser{streaming?: false},
      fake_sink: Fake.Sink.Buffers
    }
    links = [
      link(:file)
      |> to(:parser)
      # There you can do something with the parsed data
      |> to(:fake_sink)
    ]
    {{:ok, spec: %ParentSpec{children: children, links: links}}, %{}}
  end
end

To run the example:

alias Membrane.Demo.FlacPipeline
{:ok, pid} = FlacPipeline.start_link("sample.flac")
FlacPipeline.play(pid)

Dependencies for the example above:

  {:membrane_file_plugin, "~> 0.7.0"},
  {:membrane_fake_plugin, "~> 0.7.0"},
  {:membrane_flac_plugin, "~> 0.7.0"}

Sponsors

This project is sponsored by Abridge AI, Inc.

Copyright and License

Copyright 2019, Software Mansion

Software Mansion

Licensed under the Apache License, Version 2.0