ffmpeg

package module
v0.0.0-...-5a87b93 Latest Latest
Warning

This package is not in the latest version of its module.

Go to latest
Published: Mar 27, 2024 License: Apache-2.0 Imports: 7 Imported by: 0

README

ffmpeg-audio

Documentation

Index

Constants

View Source
const (
	// Exec is the default path to the ffmpeg executable
	Exec       = "ffmpeg"
	Channels   = 2
	SampleRate = 48000
	BufferSize = 65307
)

Variables

This section is empty.

Functions

This section is empty.

Types

type AudioProvider

type AudioProvider struct {
	Paused bool
	// contains filtered or unexported fields
}

func New

func New(ctx context.Context, r io.Reader, opts ...ConfigOpt) (*AudioProvider, error)

func (*AudioProvider) Close

func (p *AudioProvider) Close()

func (*AudioProvider) ProvideOpusFrame

func (p *AudioProvider) ProvideOpusFrame() ([]byte, error)

func (*AudioProvider) Wait

func (p *AudioProvider) Wait() error

type Config

type Config struct {
	Exec       string
	SampleRate int
	Channels   int
	BufferSize int
}

Config is used to configure a ffmpeg audio source.

func DefaultConfig

func DefaultConfig() *Config

DefaultConfig returns a new Config with default values.

func (*Config) Apply

func (c *Config) Apply(opts []ConfigOpt)

Apply applies the ConfigOpt(s) to the Config.

type ConfigOpt

type ConfigOpt func(config *Config)

ConfigOpt is used to functionally configure a Config.

func WithBufferSize

func WithBufferSize(bufferSize int) ConfigOpt

WithBufferSize sets the Config(s) used BufferSize.

func WithChannels

func WithChannels(channels int) ConfigOpt

WithChannels sets the Config(s) used Channels.

func WithExec

func WithExec(exec string) ConfigOpt

WithExec sets the Config(s) used Exec.

func WithSampleRate

func WithSampleRate(sampleRate int) ConfigOpt

WithSampleRate sets the Config(s) used SampleRate.

Directories

Path Synopsis
_examples

Jump to

Keyboard shortcuts

? : This menu
/ : Search site
f or F : Jump to
y or Y : Canonical URL