broadcast

package
v0.0.0-...-7673b73 Latest Latest
Warning

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

Go to latest
Published: May 24, 2015 License: GPL-3.0 Imports: 40 Imported by: 0

Documentation

Index

Constants

View Source
const (
	STEREO        = C.STEREO
	JOINT_STEREO  = C.JOINT_STEREO
	MONO          = C.MONO
	NOT_SET       = C.NOT_SET
	MAX_INDICATOR = C.MAX_INDICATOR
)
View Source
const (
	OPUS_APPLICATION_AUDIO int = C.OPUS_APPLICATION_AUDIO

	OPUS_OK int = C.OPUS_OK
)
View Source
const (
	O_RDONLY int = C.SFM_READ
	O_WRONLY int = C.SFM_WRITE
	O_RDWR   int = C.SFM_RDWR

	/* Major formats. */
	FORMAT_WAV   int = C.SF_FORMAT_WAV   /* Microsoft WAV format (little endian). */
	FORMAT_AIFF  int = C.SF_FORMAT_AIFF  /* Apple/SGI AIFF format (big endian). */
	FORMAT_AU    int = C.SF_FORMAT_AU    /* Sun/NeXT AU format (big endian). */
	FORMAT_RAW   int = C.SF_FORMAT_RAW   /* RAW PCM data. */
	FORMAT_PAF   int = C.SF_FORMAT_PAF   /* Ensoniq PARIS file format. */
	FORMAT_SVX   int = C.SF_FORMAT_SVX   /* Amiga IFF / SVX8 / SV16 format. */
	FORMAT_NIST  int = C.SF_FORMAT_NIST  /* Sphere NIST format. */
	FORMAT_VOC   int = C.SF_FORMAT_VOC   /* VOC files. */
	FORMAT_IRCAM int = C.SF_FORMAT_IRCAM /* Berkeley/IRCAM/CARL */
	FORMAT_W64   int = C.SF_FORMAT_W64   /* Sonic Foundry's 64 bit RIFF/WAV */
	FORMAT_MAT4  int = C.SF_FORMAT_MAT4  /* Matlab (tm) V4.2 / GNU Octave 2.0 */
	FORMAT_MAT5  int = C.SF_FORMAT_MAT5  /* Matlab (tm) V5.0 / GNU Octave 2.1 */
	FORMAT_PVF   int = C.SF_FORMAT_PVF   /* Portable Voice Format */
	FORMAT_XI    int = C.SF_FORMAT_XI    /* Fasttracker 2 Extended Instrument */
	FORMAT_HTK   int = C.SF_FORMAT_HTK   /* HMM Tool Kit format */
	FORMAT_SDS   int = C.SF_FORMAT_SDS   /* Midi Sample Dump Standard */
	FORMAT_AVR   int = C.SF_FORMAT_AVR   /* Audio Visual Research */
	FORMAT_WAVEX int = C.SF_FORMAT_WAVEX /* MS WAVE with WAVEFORMATEX */
	FORMAT_SD2   int = C.SF_FORMAT_SD2   /* Sound Designer 2 */
	FORMAT_FLAC  int = C.SF_FORMAT_FLAC  /* FLAC lossless file format */
	FORMAT_CAF   int = C.SF_FORMAT_CAF   /* Core Audio File format */
	FORMAT_WVE   int = C.SF_FORMAT_WVE   /* Psion WVE format */
	FORMAT_OGG   int = C.SF_FORMAT_OGG   /* Xiph OGG container */
	FORMAT_MPC2K int = C.SF_FORMAT_MPC2K /* Akai MPC 2000 sampler */
	FORMAT_RF64  int = C.SF_FORMAT_RF64  /* RF64 WAV file */

	FORMAT_PCM_S8 int = C.SF_FORMAT_PCM_S8 /* Signed 8 bit data */
	FORMAT_PCM_16 int = C.SF_FORMAT_PCM_16 /* Signed 16 bit data */
	FORMAT_PCM_24 int = C.SF_FORMAT_PCM_24 /* Signed 24 bit data */
	FORMAT_PCM_32 int = C.SF_FORMAT_PCM_32 /* Signed 32 bit data */

	FORMAT_PCM_U8 int = C.SF_FORMAT_PCM_U8 /* Unsigned 8 bit data (WAV and RAW only) */

	FORMAT_FLOAT  int = C.SF_FORMAT_FLOAT  /* 32 bit float data */
	FORMAT_DOUBLE int = C.SF_FORMAT_DOUBLE /* 64 bit float data */

	FORMAT_ULAW      int = C.SF_FORMAT_ULAW      /* U-Law encoded. */
	FORMAT_ALAW      int = C.SF_FORMAT_ALAW      /* A-Law encoded. */
	FORMAT_IMA_ADPCM int = C.SF_FORMAT_IMA_ADPCM /* IMA ADPCM. */
	FORMAT_MS_ADPCM  int = C.SF_FORMAT_MS_ADPCM  /* Microsoft ADPCM. */

	FORMAT_GSM610    int = C.SF_FORMAT_GSM610    /* GSM 6.10 encoding. */
	FORMAT_VOX_ADPCM int = C.SF_FORMAT_VOX_ADPCM /* Oki Dialogic ADPCM encoding. */

	FORMAT_G721_32 int = C.SF_FORMAT_G721_32 /* 32kbs G721 ADPCM encoding. */
	FORMAT_G723_24 int = C.SF_FORMAT_G723_24 /* 24kbs G723 ADPCM encoding. */
	FORMAT_G723_40 int = C.SF_FORMAT_G723_40 /* 40kbs G723 ADPCM encoding. */

	FORMAT_DWVW_12 int = C.SF_FORMAT_DWVW_12 /* 12 bit Delta Width Variable Word encoding. */
	FORMAT_DWVW_16 int = C.SF_FORMAT_DWVW_16 /* 16 bit Delta Width Variable Word encoding. */
	FORMAT_DWVW_24 int = C.SF_FORMAT_DWVW_24 /* 24 bit Delta Width Variable Word encoding. */
	FORMAT_DWVW_N  int = C.SF_FORMAT_DWVW_N  /* N bit Delta Width Variable Word encoding. */

	FORMAT_DPCM_8  int = C.SF_FORMAT_DPCM_8  /* 8 bit differential PCM (XI only) */
	FORMAT_DPCM_16 int = C.SF_FORMAT_DPCM_16 /* 16 bit differential PCM (XI only) */

	FORMAT_VORBIS int = C.SF_FORMAT_VORBIS /* Xiph Vorbis encoding. */

	ENDIAN_FILE   int = C.SF_ENDIAN_FILE   /* Default file endian-ness. */
	ENDIAN_LITTLE int = C.SF_ENDIAN_LITTLE /* Force little endian-ness. */
	ENDIAN_BIG    int = C.SF_ENDIAN_BIG    /* Force big endian-ness. */
	ENDIAN_CPU    int = C.SF_ENDIAN_CPU    /* Force CPU endian-ness. */

	// FIXME Usefull ?
	FORMAT_SUBMASK  int = C.SF_FORMAT_SUBMASK
	FORMAT_TYPEMASK int = C.SF_FORMAT_TYPEMASK
	FORMAT_ENDMASK  int = C.SF_FORMAT_ENDMASK
)
View Source
const (
	DefaultSampleRate = 44100
)
View Source
const MadFixedOne float32 = 1 << 28

Variables

View Source
var Sample16bLittleEndian sample16bLittleEndian
View Source
var Sample32bLittleEndian sample32bLittleEndian

Functions

func FindEncodingByContentType

func FindEncodingByContentType(contentType string) string

func LoadConfig

func LoadConfig(file string, config interface{}) error

func SaveConfig

func SaveConfig(file string, config interface{}) error

func ToAlsaSampleFormat

func ToAlsaSampleFormat(sampleFormat SampleFormat) alsa.SampleFormat

Types

type AACEncoder

type AACEncoder struct {
	BitRate      int
	ChannelCount int
	SampleRate   int

	Writer io.Writer
	// contains filtered or unexported fields
}

func (*AACEncoder) AudioOut

func (encoder *AACEncoder) AudioOut(audio *Audio)

func (*AACEncoder) Close

func (encoder *AACEncoder) Close()

func (*AACEncoder) Init

func (encoder *AACEncoder) Init() error

type AACPEncoder

type AACPEncoder struct {
	BitRate      int
	ChannelCount int
	SampleRate   int

	Writer io.Writer
	// contains filtered or unexported fields
}

func (*AACPEncoder) AudioOut

func (encoder *AACPEncoder) AudioOut(audio *Audio)

func (*AACPEncoder) Close

func (encoder *AACPEncoder) Close()

func (*AACPEncoder) Init

func (encoder *AACPEncoder) Init() error

type AdjustAudioBuffer

type AdjustAudioBuffer struct {
	Buffer       AudioBuffer
	ChannelCount int

	LimitSampleCount     uint32
	ThresholdSampleCount uint32
}

func (*AdjustAudioBuffer) AudioOut

func (pseudoBuffer *AdjustAudioBuffer) AudioOut(audio *Audio)

func (*AdjustAudioBuffer) Read

func (pseudoBuffer *AdjustAudioBuffer) Read() (audio *Audio)

func (*AdjustAudioBuffer) SampleCount

func (pseudoBuffer *AdjustAudioBuffer) SampleCount() uint32

type AlsaInput

type AlsaInput struct {
	Device            string
	SampleRate        int
	BufferSampleCount int
	SampleFormat      SampleFormat
	Channels          int
	// contains filtered or unexported fields
}

func (*AlsaInput) ChannelCount

func (input *AlsaInput) ChannelCount() int

func (*AlsaInput) Init

func (input *AlsaInput) Init() (err error)

func (*AlsaInput) Read

func (input *AlsaInput) Read() (err error)

func (*AlsaInput) Run

func (input *AlsaInput) Run()

func (*AlsaInput) SetAudioHandler

func (input *AlsaInput) SetAudioHandler(audioHandler AudioHandler)

type AlsaInputConfig

type AlsaInputConfig struct {
	Device         string
	SampleRate     int
	BufferDuration time.Duration
	SampleFormat   string
	Channels       int
	Remix          string
}

func (*AlsaInputConfig) Apply

func (config *AlsaInputConfig) Apply(alsaInput *AlsaInput)

func (*AlsaInputConfig) Flags

func (config *AlsaInputConfig) Flags(flags *flag.FlagSet, prefix string)

type AlsaOutput

type AlsaOutput struct {
	Device       string
	SampleRate   int
	SampleFormat SampleFormat
	Channels     int
	// contains filtered or unexported fields
}

func (*AlsaOutput) AudioOut

func (alsa *AlsaOutput) AudioOut(audio *Audio)

func (*AlsaOutput) Delay

func (alsa *AlsaOutput) Delay() (delay int)

func (*AlsaOutput) Init

func (output *AlsaOutput) Init() error

type AlsaOutputConfig

type AlsaOutputConfig struct {
	Device       string
	SampleRate   int
	SampleFormat string
	ChannelCount int
}

func (*AlsaOutputConfig) Apply

func (config *AlsaOutputConfig) Apply(alsaOutput *AlsaOutput)

func (*AlsaOutputConfig) Flags

func (config *AlsaOutputConfig) Flags(flags *flag.FlagSet, prefix string)

type Amplifier

type Amplifier struct {
	Amplification float32
	Output        AudioHandler
}

func (*Amplifier) AudioOut

func (amplifier *Amplifier) AudioOut(audio *Audio)

type Audio

type Audio struct {
	// contains filtered or unexported fields
}

func NewAudio

func NewAudio(sampleCount int, channelCount int) *Audio

func (*Audio) ChannelCount

func (audio *Audio) ChannelCount() int

func (*Audio) InterleavedFloats

func (audio *Audio) InterleavedFloats() []float32

func (*Audio) LoadInterleavedFloats

func (audio *Audio) LoadInterleavedFloats(samples []float32, sampleCount int, channelCount int)

func (*Audio) Process

func (audio *Audio) Process(processor AudioProcessor)

func (*Audio) Sample

func (audio *Audio) Sample(channel int, samplePosition int) float32

func (*Audio) SampleCount

func (audio *Audio) SampleCount() int

func (*Audio) Samples

func (audio *Audio) Samples(channel int) []float32

func (*Audio) SetSample

func (audio *Audio) SetSample(channel int, samplePosition int, sample float32)

func (*Audio) SetSamples

func (audio *Audio) SetSamples(channel int, samples []float32)

func (*Audio) SetTimestamp

func (audio *Audio) SetTimestamp(timestamp time.Time)

func (*Audio) Timestamp

func (audio *Audio) Timestamp() time.Time

type AudioBuffer

type AudioBuffer interface {
	AudioOut(audio *Audio)
	Read() *Audio
	SampleCount() uint32
}

type AudioDecoder

type AudioDecoder interface {
	Decode([]byte) (*Audio, error)
	Init() error
}

type AudioEncoder

type AudioEncoder interface {
	Encode(audio *Audio) ([]byte, error)
	Init() error
}

type AudioFormat

type AudioFormat struct {
	Encoding string
	Mode     string

	BitRate int
	Quality float32

	ChannelCount int
	SampleRate   int
}

func ParseAudioFormat

func ParseAudioFormat(definition string) AudioFormat

func (*AudioFormat) ContentType

func (format *AudioFormat) ContentType() string

type AudioHandler

type AudioHandler interface {
	AudioOut(audio *Audio)
}

type AudioHandlerFunc

type AudioHandlerFunc func(audio *Audio)
audioHandler := broadcast.AudioHandlerFunc(func(audio *broadcast.Audio) {
  ...
})

func (AudioHandlerFunc) AudioOut

func (f AudioHandlerFunc) AudioOut(audio *Audio)

type AudioHandlerSupport

type AudioHandlerSupport interface {
	SetAudioHandler(audioHandler AudioHandler)
}

type AudioProcessor

type AudioProcessor func(int, int, float32) float32

type AudioProvider

type AudioProvider interface {
	Read() *Audio
}

type AudioProviderFunc

type AudioProviderFunc func() *Audio

func (AudioProviderFunc) Read

func (f AudioProviderFunc) Read() *Audio

type BackupConfig

type BackupConfig struct {
	CommandConfig

	Alsa  AlsaInputConfig
	Files TimedFileOutputConfig
}

func (*BackupConfig) Apply

func (config *BackupConfig) Apply(alsaInput *AlsaInput, timedFileOutput *TimedFileOutput, httpServer *HttpServer)

func (*BackupConfig) Flags

func (config *BackupConfig) Flags(flags *flag.FlagSet)

type BufferHttpStreamInput

type BufferHttpStreamInput struct {
	// contains filtered or unexported fields
}

func NewBufferHttpStreamInput

func NewBufferHttpStreamInput() *BufferHttpStreamInput

func (*BufferHttpStreamInput) AudioOut

func (buffer *BufferHttpStreamInput) AudioOut(audio *Audio)

func (*BufferHttpStreamInput) Read

func (buffer *BufferHttpStreamInput) Read() *Audio

func (*BufferHttpStreamInput) SampleCount

func (buffer *BufferHttpStreamInput) SampleCount() uint32

func (*BufferHttpStreamInput) SampleRate

func (buffer *BufferHttpStreamInput) SampleRate() int

func (*BufferHttpStreamInput) SetChannelCount

func (buffer *BufferHttpStreamInput) SetChannelCount(channelCount int)

func (*BufferHttpStreamInput) SetSampleRate

func (buffer *BufferHttpStreamInput) SetSampleRate(sampleRate int)

func (*BufferHttpStreamInput) Setup

func (buffer *BufferHttpStreamInput) Setup(config *BufferHttpStreamInputConfig)

type BufferHttpStreamInputConfig

type BufferHttpStreamInputConfig struct {
	Duration time.Duration

	LowAdjustThreshold  float64
	LowRefill           float64
	HighAdjustThreshold float64
	HighUnfill          float64
}

func NewBufferHttpStreamInputConfig

func NewBufferHttpStreamInputConfig() *BufferHttpStreamInputConfig

func (*BufferHttpStreamInputConfig) Flags

func (config *BufferHttpStreamInputConfig) Flags(flags *flag.FlagSet, prefix string)

type BufferedHttpStreamInput

type BufferedHttpStreamInput struct {
	// contains filtered or unexported fields
}

func NewBufferedHttpStreamInput

func NewBufferedHttpStreamInput() *BufferedHttpStreamInput

func (*BufferedHttpStreamInput) Init

func (input *BufferedHttpStreamInput) Init() error

func (*BufferedHttpStreamInput) Read

func (input *BufferedHttpStreamInput) Read() *Audio

func (*BufferedHttpStreamInput) Run

func (input *BufferedHttpStreamInput) Run()

func (*BufferedHttpStreamInput) SetChannelCount

func (input *BufferedHttpStreamInput) SetChannelCount(channelCount int)

func (*BufferedHttpStreamInput) SetSampleRate

func (input *BufferedHttpStreamInput) SetSampleRate(sampleRate int)

func (*BufferedHttpStreamInput) Setup

type BufferedHttpStreamInputConfig

type BufferedHttpStreamInputConfig struct {
	HttpStreamInputConfig
	Buffer BufferHttpStreamInputConfig
}

func (*BufferedHttpStreamInputConfig) Apply

func (*BufferedHttpStreamInputConfig) Flags

func (config *BufferedHttpStreamInputConfig) Flags(flags *flag.FlagSet, prefix string)

type BufferedHttpStreamOutput

type BufferedHttpStreamOutput struct {
	Identifier string

	Metrics  *LocalMetrics
	EventLog *LocalEventLog
	// contains filtered or unexported fields
}

func NewBufferedHttpStreamOutput

func NewBufferedHttpStreamOutput() *BufferedHttpStreamOutput

func (*BufferedHttpStreamOutput) AdminStatus

func (output *BufferedHttpStreamOutput) AdminStatus() string

func (*BufferedHttpStreamOutput) AudioOut

func (output *BufferedHttpStreamOutput) AudioOut(audio *Audio)

func (*BufferedHttpStreamOutput) Config

func (*BufferedHttpStreamOutput) ConnectionStatus

func (output *BufferedHttpStreamOutput) ConnectionStatus() string

func (*BufferedHttpStreamOutput) Init

func (output *BufferedHttpStreamOutput) Init() error

func (*BufferedHttpStreamOutput) OperationalStatus

func (output *BufferedHttpStreamOutput) OperationalStatus() string

func (*BufferedHttpStreamOutput) Read

func (output *BufferedHttpStreamOutput) Read() (audio *Audio)

func (*BufferedHttpStreamOutput) Run

func (output *BufferedHttpStreamOutput) Run()

func (*BufferedHttpStreamOutput) SetChannelCount

func (output *BufferedHttpStreamOutput) SetChannelCount(channelCount int)

func (*BufferedHttpStreamOutput) SetSampleRate

func (output *BufferedHttpStreamOutput) SetSampleRate(sampleRate int)

func (*BufferedHttpStreamOutput) Setup

func (*BufferedHttpStreamOutput) Start

func (output *BufferedHttpStreamOutput) Start()

func (*BufferedHttpStreamOutput) Status

func (*BufferedHttpStreamOutput) Stop

func (output *BufferedHttpStreamOutput) Stop()

type BufferedHttpStreamOutputConfig

type BufferedHttpStreamOutputConfig struct {
	HttpStreamOutputConfig
	Identifier     string
	BufferDuration time.Duration
}

func NewBufferedHttpStreamOutputConfig

func NewBufferedHttpStreamOutputConfig() BufferedHttpStreamOutputConfig

func (*BufferedHttpStreamOutputConfig) Apply

func (config *BufferedHttpStreamOutputConfig) Apply(bufferedHttpStreamOutput *BufferedHttpStreamOutput)

func (*BufferedHttpStreamOutputConfig) Empty

func (config *BufferedHttpStreamOutputConfig) Empty() bool

func (*BufferedHttpStreamOutputConfig) Flags

func (config *BufferedHttpStreamOutputConfig) Flags(flags *flag.FlagSet, prefix string)

type BufferedHttpStreamOutputStatus

type BufferedHttpStreamOutputStatus struct {
	BufferedHttpStreamOutputConfig
	AdminStatus        string // "enabled" / "disabled"
	OperationalStatus  string // "started" / "stopped"
	ConnectionStatus   string // "connected" / "disconnected"
	ConnectionDuration time.Duration
	Efficiency         float64
	EfficiencyHistory  IoEfficiencyMeterHistory
	Events             []*Event
}

type CPUProfiler

type CPUProfiler struct {
}

func (*CPUProfiler) Start

func (profiler *CPUProfiler) Start(file *os.File)

func (*CPUProfiler) Stop

func (profiler *CPUProfiler) Stop(file *os.File)

type CommandConfig

type CommandConfig struct {
	File string `json:"-"`

	HttpServer HttpServerConfig
	Log        LogConfig
	Metrics    MetricsConfig
	Profiler   ProfilerConfig
}

func (*CommandConfig) BaseApply

func (config *CommandConfig) BaseApply(httpServer *HttpServer)

func (*CommandConfig) BaseFlags

func (config *CommandConfig) BaseFlags(flags *flag.FlagSet)

type ConfigController

type ConfigController struct {
	// contains filtered or unexported fields
}

func NewConfigController

func NewConfigController(manager ConfigManager) *ConfigController

func (*ConfigController) Save

func (controller *ConfigController) Save(response http.ResponseWriter)

func (*ConfigController) ServeHTTP

func (controller *ConfigController) ServeHTTP(response http.ResponseWriter, request *http.Request)

func (*ConfigController) Show

func (controller *ConfigController) Show(response http.ResponseWriter)

type ConfigManager

type ConfigManager interface {
	ConfigToJSON() []byte
	SaveConfig() error
}

type Event

type Event struct {
	Timestamp  time.Time
	Message    string
	Source     string `json:",omitempty"`
	Occurrence int
}

func (*Event) Equal

func (event *Event) Equal(other *Event) bool

type EventCollection

type EventCollection interface {
	EventLogger

	Create(message string) *Event
	Append(event *Event)
	Events() []*Event
}
var EventLog EventCollection = &LoggerEventLog{Parent: NewMemoryEventLog(256)}

type EventLogger

type EventLogger interface {
	NewEvent(message string) *Event
}

type FDKAACEncoder

type FDKAACEncoder struct {
	ChannelCount int
	AOT          int
	SampleRate   int
	Mode         string
	Quality      float32
	BitRate      int
	Writer       io.Writer
	// contains filtered or unexported fields
}

func (*FDKAACEncoder) AudioOut

func (encoder *FDKAACEncoder) AudioOut(audio *Audio)

func (*FDKAACEncoder) BitRateMode

func (encoder *FDKAACEncoder) BitRateMode() C.UINT

func (*FDKAACEncoder) ChannelMode

func (encoder *FDKAACEncoder) ChannelMode() (channelMode C.CHANNEL_MODE)

func (*FDKAACEncoder) Close

func (encoder *FDKAACEncoder) Close()

func (*FDKAACEncoder) Init

func (encoder *FDKAACEncoder) Init() error

type FileInput

type FileInput struct {
	File string
	// contains filtered or unexported fields
}

func (*FileInput) ChannelCount

func (input *FileInput) ChannelCount() int

func (*FileInput) Close

func (input *FileInput) Close()

func (*FileInput) Init

func (input *FileInput) Init() error

func (*FileInput) Read

func (input *FileInput) Read() *Audio

func (*FileInput) SampleRate

func (input *FileInput) SampleRate() int

type FixedRateAudioHandler

type FixedRateAudioHandler struct {
	SampleRate uint
	Output     AudioHandler
	Tolerance  float64
	// contains filtered or unexported fields
}

func (*FixedRateAudioHandler) AudioOut

func (rated *FixedRateAudioHandler) AudioOut(audio *Audio)

type HttpInput

type HttpInput struct {
	Url      string
	Username string
	Password string

	ReadTimeout time.Duration
	WaitOnError time.Duration
	// contains filtered or unexported fields
}

func (*HttpInput) GetReadTimeout

func (input *HttpInput) GetReadTimeout() time.Duration

func (*HttpInput) GetWaitOnError

func (input *HttpInput) GetWaitOnError() time.Duration

func (*HttpInput) Init

func (input *HttpInput) Init() (err error)

func (*HttpInput) Read

func (input *HttpInput) Read() (err error)

func (*HttpInput) Reset

func (input *HttpInput) Reset()

func (*HttpInput) Run

func (input *HttpInput) Run()

func (*HttpInput) SetAudioHandler

func (input *HttpInput) SetAudioHandler(audioHandler AudioHandler)

func (*HttpInput) Setup

func (input *HttpInput) Setup(config *HttpStreamInputConfig)

type HttpServer

type HttpServer struct {
	Bind                   string
	SoundMeterAudioHandler *SoundMeterAudioHandler
}

func (*HttpServer) Init

func (server *HttpServer) Init() error

func (*HttpServer) Register

func (server *HttpServer) Register(pattern string, handler http.Handler)

type HttpServerConfig

type HttpServerConfig struct {
	Bind string
}

func (*HttpServerConfig) Apply

func (config *HttpServerConfig) Apply(httpServer *HttpServer)

func (*HttpServerConfig) Flags

func (config *HttpServerConfig) Flags(flags *flag.FlagSet, prefix string)

type HttpStreamDialer

type HttpStreamDialer interface {
	Connect(output *HttpStreamOutput) (net.Conn, error)
}

type HttpStreamInputConfig

type HttpStreamInputConfig struct {
	Url string

	ReadTimeout time.Duration
	WaitOnError time.Duration
}

func (*HttpStreamInputConfig) Flags

func (config *HttpStreamInputConfig) Flags(flags *flag.FlagSet, prefix string)

type HttpStreamOutput

type HttpStreamOutput struct {
	Target     string
	Format     AudioFormat
	ServerType string

	Provider AudioProvider

	Description *StreamDescription

	Metrics  *LocalMetrics
	EventLog *LocalEventLog
	// contains filtered or unexported fields
}

func (*HttpStreamOutput) AdminStatus

func (output *HttpStreamOutput) AdminStatus() string

func (*HttpStreamOutput) ConnectionDuration

func (output *HttpStreamOutput) ConnectionDuration() time.Duration

func (*HttpStreamOutput) ConnectionStatus

func (output *HttpStreamOutput) ConnectionStatus() string

func (*HttpStreamOutput) GetWaitOnError

func (output *HttpStreamOutput) GetWaitOnError() time.Duration

func (*HttpStreamOutput) GetWriteTimeout

func (output *HttpStreamOutput) GetWriteTimeout() time.Duration

func (*HttpStreamOutput) Init

func (output *HttpStreamOutput) Init() error

func (*HttpStreamOutput) IsConnected

func (output *HttpStreamOutput) IsConnected() bool

func (*HttpStreamOutput) OperationalStatus

func (output *HttpStreamOutput) OperationalStatus() string

func (*HttpStreamOutput) Reset

func (output *HttpStreamOutput) Reset()

func (*HttpStreamOutput) Run

func (output *HttpStreamOutput) Run()

func (*HttpStreamOutput) SampleRate

func (output *HttpStreamOutput) SampleRate() int

func (*HttpStreamOutput) Start

func (output *HttpStreamOutput) Start()

func (*HttpStreamOutput) Stop

func (output *HttpStreamOutput) Stop()

func (*HttpStreamOutput) Write

func (output *HttpStreamOutput) Write(buffer []byte) (int, error)

type HttpStreamOutputConfig

type HttpStreamOutputConfig struct {
	Target      string
	Format      string
	Description StreamDescription
	ServerType  string
	Disabled    bool
}

func NewHttpStreamOutputConfig

func NewHttpStreamOutputConfig() HttpStreamOutputConfig

func (*HttpStreamOutputConfig) Apply

func (config *HttpStreamOutputConfig) Apply(httpStreamOutput *HttpStreamOutput)

func (*HttpStreamOutputConfig) Flags

func (config *HttpStreamOutputConfig) Flags(flags *flag.FlagSet, prefix string)

type HttpStreamOutputStatus

type HttpStreamOutputStatus int
const (
	HttpStreamOutputStopped HttpStreamOutputStatus = 0 + iota
	HttpStreamOutputStarted
	HttpStreamOutputStopping
)

type HttpStreamOutputs

type HttpStreamOutputs struct {
	// contains filtered or unexported fields
}

func NewHttpStreamOutputs

func NewHttpStreamOutputs() *HttpStreamOutputs

func (*HttpStreamOutputs) AudioOut

func (output *HttpStreamOutputs) AudioOut(audio *Audio)

func (*HttpStreamOutputs) Config

func (output *HttpStreamOutputs) Config() HttpStreamOutputsConfig

func (*HttpStreamOutputs) Create

func (*HttpStreamOutputs) Destroy

func (output *HttpStreamOutputs) Destroy(identifier string) *BufferedHttpStreamOutput

func (*HttpStreamOutputs) Init

func (output *HttpStreamOutputs) Init() error

func (*HttpStreamOutputs) Run

func (output *HttpStreamOutputs) Run()

func (*HttpStreamOutputs) SetChannelCount

func (output *HttpStreamOutputs) SetChannelCount(channelCount int)

func (*HttpStreamOutputs) SetSampleRate

func (output *HttpStreamOutputs) SetSampleRate(sampleRate int)

func (*HttpStreamOutputs) Setup

func (output *HttpStreamOutputs) Setup(config *HttpStreamOutputsConfig)

func (*HttpStreamOutputs) Start

func (output *HttpStreamOutputs) Start()

func (*HttpStreamOutputs) Status

func (output *HttpStreamOutputs) Status() HttpStreamOutputsStatus

func (*HttpStreamOutputs) Stop

func (output *HttpStreamOutputs) Stop()

func (*HttpStreamOutputs) Stream

func (output *HttpStreamOutputs) Stream(identifier string) *BufferedHttpStreamOutput

type HttpStreamOutputsConfig

type HttpStreamOutputsConfig struct {
	Streams []BufferedHttpStreamOutputConfig
}

func (*HttpStreamOutputsConfig) Apply

func (config *HttpStreamOutputsConfig) Apply(httpStreamOutputs *HttpStreamOutputs)

func (*HttpStreamOutputsConfig) Compact

func (config *HttpStreamOutputsConfig) Compact()

func (*HttpStreamOutputsConfig) Empty

func (config *HttpStreamOutputsConfig) Empty() bool

func (*HttpStreamOutputsConfig) Flags

func (config *HttpStreamOutputsConfig) Flags(flags *flag.FlagSet, prefix string)

type HttpStreamOutputsController

type HttpStreamOutputsController struct {
	// contains filtered or unexported fields
}

func NewHttpStreamOutputsController

func NewHttpStreamOutputsController(outputs *HttpStreamOutputs) (controller *HttpStreamOutputsController)

func (*HttpStreamOutputsController) Config

func (*HttpStreamOutputsController) Create

func (controller *HttpStreamOutputsController) Create(response http.ResponseWriter, body []byte)

func (*HttpStreamOutputsController) Delete

func (controller *HttpStreamOutputsController) Delete(response http.ResponseWriter, identifier string)

func (*HttpStreamOutputsController) Index

func (controller *HttpStreamOutputsController) Index(response http.ResponseWriter)

func (*HttpStreamOutputsController) IndexEvents

func (controller *HttpStreamOutputsController) IndexEvents(response http.ResponseWriter)

func (*HttpStreamOutputsController) ServeHTTP

func (controller *HttpStreamOutputsController) ServeHTTP(response http.ResponseWriter, request *http.Request)

func (*HttpStreamOutputsController) Show

func (controller *HttpStreamOutputsController) Show(response http.ResponseWriter, identifier string)

func (*HttpStreamOutputsController) Status

func (*HttpStreamOutputsController) Update

func (controller *HttpStreamOutputsController) Update(response http.ResponseWriter, identifier string, body []byte)

type HttpStreamOutputsStatus

type HttpStreamOutputsStatus struct {
	Streams []BufferedHttpStreamOutputStatus
	Events  []*Event
}

type Icecast2Dialer

type Icecast2Dialer struct {
}

func (*Icecast2Dialer) Connect

func (dialer *Icecast2Dialer) Connect(output *HttpStreamOutput) (net.Conn, error)

type IdentifierGenerator

type IdentifierGenerator struct {
	Prefix   string
	Index    int
	Validate IdentifierValidator
}

func (*IdentifierGenerator) Generate

func (generator *IdentifierGenerator) Generate() string

func (*IdentifierGenerator) Identifier

func (generator *IdentifierGenerator) Identifier() string

func (*IdentifierGenerator) NextIdentifier

func (generator *IdentifierGenerator) NextIdentifier() string

type IdentifierValidator

type IdentifierValidator func(identifier string) bool

type Info

type Info C.SF_INFO

sf_count_t frames ; int samplerate ; int channels ; int format ; int sections ; int seekable ;

func (*Info) Channels

func (info *Info) Channels() int

func (*Info) Frames

func (info *Info) Frames() int64

func (*Info) SampleRate

func (info *Info) SampleRate() int

func (*Info) SetChannels

func (info *Info) SetChannels(channels int)

func (*Info) SetFormat

func (info *Info) SetFormat(format int)

func (*Info) SetSampleRate

func (info *Info) SetSampleRate(sampleRate int)

type InterleavedAudioCoder

type InterleavedAudioCoder struct {
	SampleFormat SampleFormat
	ChannelCount int
}

func (*InterleavedAudioCoder) Decode

func (encoder *InterleavedAudioCoder) Decode(data []byte) (*Audio, error)

func (*InterleavedAudioCoder) Encode

func (encoder *InterleavedAudioCoder) Encode(audio *Audio) ([]byte, error)

func (*InterleavedAudioCoder) FrameSize

func (encoder *InterleavedAudioCoder) FrameSize() int

type IoEfficiencyHandler

type IoEfficiencyHandler func(efficiency float64)

type IoEfficiencyMeter

type IoEfficiencyMeter struct {
	Metrics *LocalMetrics
	Handler IoEfficiencyHandler
	// contains filtered or unexported fields
}

func (*IoEfficiencyMeter) Efficiency

func (meter *IoEfficiencyMeter) Efficiency() float64

func (*IoEfficiencyMeter) History

func (meter *IoEfficiencyMeter) History() *IoEfficiencyMeterHistory

func (*IoEfficiencyMeter) Input

func (meter *IoEfficiencyMeter) Input(count int64)

func (*IoEfficiencyMeter) Output

func (meter *IoEfficiencyMeter) Output(count int64)

func (*IoEfficiencyMeter) Reset

func (meter *IoEfficiencyMeter) Reset()

type IoEfficiencyMeterHistory

type IoEfficiencyMeterHistory struct {
	Efficiencies []float64
	Max          float64
	Min          float64
	Average      float64
	// contains filtered or unexported fields
}

func NewIoEfficiencyMeterHistory

func NewIoEfficiencyMeterHistory(size int) *IoEfficiencyMeterHistory

func (*IoEfficiencyMeterHistory) IsEmpty

func (history *IoEfficiencyMeterHistory) IsEmpty() bool

func (*IoEfficiencyMeterHistory) Push

func (history *IoEfficiencyMeterHistory) Push(efficiency float64)

type LameEncoder

type LameEncoder struct {
	Quality float32
	BitRate int
	Mode    string

	ChannelCount int
	SampleRate   int

	Writer io.Writer
	// contains filtered or unexported fields
}

func (*LameEncoder) AudioOut

func (encoder *LameEncoder) AudioOut(audio *Audio)

func (*LameEncoder) Close

func (encoder *LameEncoder) Close()

func (*LameEncoder) Flush

func (encoder *LameEncoder) Flush()

func (*LameEncoder) Init

func (encoder *LameEncoder) Init() error

func (*LameEncoder) LameMode

func (encoder *LameEncoder) LameMode() int

func (*LameEncoder) LameQuality

func (encoder *LameEncoder) LameQuality() int

type LocalEventLog

type LocalEventLog struct {
	Parent EventCollection
	Source string
	// contains filtered or unexported fields
}

func (*LocalEventLog) Append

func (log *LocalEventLog) Append(event *Event)

func (*LocalEventLog) Create

func (log *LocalEventLog) Create(message string) *Event

func (*LocalEventLog) Events

func (log *LocalEventLog) Events() []*Event

func (*LocalEventLog) NewEvent

func (log *LocalEventLog) NewEvent(message string) *Event

type LocalMetrics

type LocalMetrics struct {
	// contains filtered or unexported fields
}

func (*LocalMetrics) Counter

func (local *LocalMetrics) Counter(name string) metrics.Counter

func (*LocalMetrics) Gauge

func (local *LocalMetrics) Gauge(name string) metrics.Gauge

func (*LocalMetrics) Histogram

func (local *LocalMetrics) Histogram(name string) metrics.Histogram

func (*LocalMetrics) Name

func (local *LocalMetrics) Name(name string) string

type LogConfig

type LogConfig struct {
	Debug  bool
	Syslog bool
}

func (*LogConfig) Apply

func (config *LogConfig) Apply()

func (*LogConfig) Flags

func (config *LogConfig) Flags(flags *flag.FlagSet, prefix string)

type LogWriter

type LogWriter interface {
	Debug(message string) error
	Info(message string) error
	Emerg(message string) error
}

type Logger

type Logger struct {
	Syslog bool
	Debug  bool
	// contains filtered or unexported fields
}
var Log *Logger = &Logger{}

func (*Logger) Debugf

func (logger *Logger) Debugf(format string, values ...interface{})

func (*Logger) Panicf

func (logger *Logger) Panicf(format string, values ...interface{})

func (*Logger) Printf

func (logger *Logger) Printf(format string, values ...interface{})

func (*Logger) Writer

func (logger *Logger) Writer() LogWriter

type LoggerEventLog

type LoggerEventLog struct {
	Parent EventCollection
}

func (*LoggerEventLog) Append

func (log *LoggerEventLog) Append(event *Event)

func (*LoggerEventLog) Create

func (log *LoggerEventLog) Create(message string) *Event

func (*LoggerEventLog) Events

func (log *LoggerEventLog) Events() []*Event

func (*LoggerEventLog) NewEvent

func (log *LoggerEventLog) NewEvent(message string) *Event

type MadDecoder

type MadDecoder struct {
	// contains filtered or unexported fields
}

func (*MadDecoder) Init

func (decoder *MadDecoder) Init() error

func (*MadDecoder) Read

func (decoder *MadDecoder) Read(reader io.Reader) error

func (*MadDecoder) Reset

func (decoder *MadDecoder) Reset()

func (*MadDecoder) SetAudioHandler

func (decoder *MadDecoder) SetAudioHandler(audioHandler AudioHandler)

type MadError

type MadError int
const (
	MadErrorBufferLength MadError = C.MAD_ERROR_BUFLEN
)

func (MadError) Error

func (err MadError) Error() error

func (MadError) IsRecoverable

func (err MadError) IsRecoverable() bool

func (MadError) String

func (err MadError) String() string

type MemoryAudioBuffer

type MemoryAudioBuffer struct {
	Metrics *LocalMetrics
	// contains filtered or unexported fields
}

func (*MemoryAudioBuffer) AudioOut

func (buffer *MemoryAudioBuffer) AudioOut(audio *Audio)

func (*MemoryAudioBuffer) Empty

func (buffer *MemoryAudioBuffer) Empty() bool

func (*MemoryAudioBuffer) Full

func (buffer *MemoryAudioBuffer) Full() bool

func (*MemoryAudioBuffer) Read

func (buffer *MemoryAudioBuffer) Read() (audio *Audio)

func (*MemoryAudioBuffer) SampleCount

func (buffer *MemoryAudioBuffer) SampleCount() uint32

type MemoryBenchmark

type MemoryBenchmark struct {
	Benchmark             *testing.B
	MaxMemoryPerOperation float64
	MinimumOperationCount int
	// contains filtered or unexported fields
}

func NewMemoryBenchmark

func NewMemoryBenchmark(b *testing.B) *MemoryBenchmark

func (*MemoryBenchmark) Complete

func (benchmark *MemoryBenchmark) Complete()

func (*MemoryBenchmark) CurrentResidentMemory

func (benchmark *MemoryBenchmark) CurrentResidentMemory() uint64

func (*MemoryBenchmark) IsEnabled

func (benchmark *MemoryBenchmark) IsEnabled() bool

func (*MemoryBenchmark) MemoryPerOperation

func (benchmark *MemoryBenchmark) MemoryPerOperation() float64

func (*MemoryBenchmark) MemoryUsage

func (benchmark *MemoryBenchmark) MemoryUsage() uint64

func (*MemoryBenchmark) OperationCount

func (benchmark *MemoryBenchmark) OperationCount() int

func (*MemoryBenchmark) Start

func (benchmark *MemoryBenchmark) Start()

func (*MemoryBenchmark) Status

func (benchmark *MemoryBenchmark) Status() string

type MemoryEventLog

type MemoryEventLog struct {
	// contains filtered or unexported fields
}

func NewMemoryEventLog

func NewMemoryEventLog(size int) *MemoryEventLog

func (*MemoryEventLog) Append

func (log *MemoryEventLog) Append(event *Event)

func (*MemoryEventLog) Create

func (log *MemoryEventLog) Create(message string) *Event

func (*MemoryEventLog) Events

func (log *MemoryEventLog) Events() []*Event

func (*MemoryEventLog) NewEvent

func (log *MemoryEventLog) NewEvent(message string) *Event

type MemoryProfiler

type MemoryProfiler struct {
}

func (*MemoryProfiler) Start

func (profiler *MemoryProfiler) Start(file *os.File)

func (*MemoryProfiler) Stop

func (profiler *MemoryProfiler) Stop(file *os.File)

type MetricsConfig

type MetricsConfig struct {
	Librato MetricsLibratoConfig `json:",omitempty"`
}

func (*MetricsConfig) Apply

func (config *MetricsConfig) Apply()

func (*MetricsConfig) Flags

func (config *MetricsConfig) Flags(flags *flag.FlagSet, prefix string)

type MetricsLibratoConfig

type MetricsLibratoConfig struct {
	Account string `json:",omitempty"`
	Token   string `json:",omitempty"`
}

func (*MetricsLibratoConfig) Apply

func (config *MetricsLibratoConfig) Apply()

func (*MetricsLibratoConfig) Flags

func (config *MetricsLibratoConfig) Flags(flags *flag.FlagSet, prefix string)

type MetricsReadCloser

type MetricsReadCloser struct {
	// contains filtered or unexported fields
}

func NewMetricsReadCloser

func NewMetricsReadCloser(reader io.ReadCloser, counterName string) *MetricsReadCloser

func (*MetricsReadCloser) Close

func (metricsReadCloser *MetricsReadCloser) Close() error

func (*MetricsReadCloser) Read

func (metricsReadCloser *MetricsReadCloser) Read(buffer []byte) (n int, err error)

type MutexAudioBuffer

type MutexAudioBuffer struct {
	Buffer AudioBuffer
	// contains filtered or unexported fields
}

func (*MutexAudioBuffer) AudioOut

func (pseudoBuffer *MutexAudioBuffer) AudioOut(audio *Audio)

func (*MutexAudioBuffer) Read

func (pseudoBuffer *MutexAudioBuffer) Read() (audio *Audio)

func (*MutexAudioBuffer) SampleCount

func (pseudoBuffer *MutexAudioBuffer) SampleCount() uint32

type OggDecoder

type OggDecoder struct {
	// contains filtered or unexported fields
}

func (*OggDecoder) Init

func (decoder *OggDecoder) Init() error

func (*OggDecoder) Read

func (decoder *OggDecoder) Read(reader io.Reader) error

func (*OggDecoder) Reset

func (decoder *OggDecoder) Reset()

func (*OggDecoder) SetAudioHandler

func (decoder *OggDecoder) SetAudioHandler(audioHandler AudioHandler)

func (*OggDecoder) SetHandler

func (decoder *OggDecoder) SetHandler(handler OggHandler)

type OggEncoder

type OggEncoder struct {
	Writer  io.Writer
	Encoder *VorbisEncoder
	// contains filtered or unexported fields
}

func (*OggEncoder) AudioOut

func (encoder *OggEncoder) AudioOut(audio *Audio)

func (*OggEncoder) Close

func (encoder *OggEncoder) Close()

func (*OggEncoder) Flush

func (encoder *OggEncoder) Flush()

func (*OggEncoder) Init

func (encoder *OggEncoder) Init() error

func (*OggEncoder) PacketAvailable

func (encoder *OggEncoder) PacketAvailable(packet *ogg.Packet)

type OggHandler

type OggHandler interface {
	NewStream(serialNo int32)
	PacketOut(packet *ogg.Packet) bool
}

type OggPacketHandler

type OggPacketHandler interface {
	PacketAvailable(packet *ogg.Packet)
}

type OpusAudioDecoder

type OpusAudioDecoder struct {
	// contains filtered or unexported fields
}

func (*OpusAudioDecoder) Decode

func (decoder *OpusAudioDecoder) Decode(data []byte) (*Audio, error)

func (*OpusAudioDecoder) Destroy

func (decoder *OpusAudioDecoder) Destroy()

func (*OpusAudioDecoder) Init

func (decoder *OpusAudioDecoder) Init() error

type OpusAudioEncoder

type OpusAudioEncoder struct {
	Bitrate int
	// contains filtered or unexported fields
}

func (*OpusAudioEncoder) Destroy

func (encoder *OpusAudioEncoder) Destroy()

func (*OpusAudioEncoder) Encode

func (encoder *OpusAudioEncoder) Encode(audio *Audio) ([]byte, error)

func (*OpusAudioEncoder) Init

func (encoder *OpusAudioEncoder) Init() error

type OpusAudioEncoderConfig

type OpusAudioEncoderConfig struct {
	Bitrate int
}

func (*OpusAudioEncoderConfig) Apply

func (config *OpusAudioEncoderConfig) Apply(opusEncoder *OpusAudioEncoder)

func (*OpusAudioEncoderConfig) Flags

func (config *OpusAudioEncoderConfig) Flags(flags *flag.FlagSet, prefix string)

type OpusDecoder

type OpusDecoder struct {
	// contains filtered or unexported fields
}

func OpusDecoderCreate

func OpusDecoderCreate() (*OpusDecoder, error)

func (*OpusDecoder) DecodeFloat

func (decoder *OpusDecoder) DecodeFloat(data []byte, pcmFloats []float32, frameSize int) (int32, error)

func (*OpusDecoder) Destroy

func (decoder *OpusDecoder) Destroy()

type OpusEncoder

type OpusEncoder struct {
	// contains filtered or unexported fields
}

func OpusEncoderCreate

func OpusEncoderCreate(bitrate int) (*OpusEncoder, error)

func (*OpusEncoder) Destroy

func (encoder *OpusEncoder) Destroy()

func (*OpusEncoder) EncodeFloat

func (encoder *OpusEncoder) EncodeFloat(pcmFloats []float32, frameSize int, data []byte, maxDataSize int32) (int32, error)

type Processing

type Processing struct {
	Output AudioHandler
	// contains filtered or unexported fields
}

func (*Processing) AudioOut

func (processing *Processing) AudioOut(audio *Audio)

func (*Processing) Config

func (processing *Processing) Config() *ProcessingConfig

func (*Processing) SetAudioHandler

func (processing *Processing) SetAudioHandler(audioHandler AudioHandler)

func (*Processing) Setup

func (processing *Processing) Setup(config *ProcessingConfig)

type ProcessingConfig

type ProcessingConfig struct {
	Amplification float64
}

func (*ProcessingConfig) Apply

func (config *ProcessingConfig) Apply(processing *Processing)

func (*ProcessingConfig) Flags

func (config *ProcessingConfig) Flags(flags *flag.FlagSet, prefix string)

type ProcessingController

type ProcessingController struct {
	// contains filtered or unexported fields
}

func NewProcessingController

func NewProcessingController(processing *Processing) (controller *ProcessingController)

func (*ProcessingController) ServeHTTP

func (controller *ProcessingController) ServeHTTP(response http.ResponseWriter, request *http.Request)

func (*ProcessingController) Show

func (controller *ProcessingController) Show(response http.ResponseWriter)

func (*ProcessingController) Update

func (controller *ProcessingController) Update(response http.ResponseWriter, body []byte)

type Profiler

type Profiler interface {
	Start(file *os.File)
	Stop(file *os.File)
}

type ProfilerConfig

type ProfilerConfig struct {
	CPU    string
	Memory string
}

func (*ProfilerConfig) Apply

func (config *ProfilerConfig) Apply()

func (*ProfilerConfig) Flags

func (config *ProfilerConfig) Flags(flags *flag.FlagSet, prefix string)

type ProfilerController

type ProfilerController struct {
	FileName string
	Profiler Profiler
}

func (*ProfilerController) Start

func (controller *ProfilerController) Start() error

type RawAudioDecoder

type RawAudioDecoder struct {
}

func (*RawAudioDecoder) Decode

func (decoder *RawAudioDecoder) Decode(data []byte) (*Audio, error)

type RawAudioEncoder

type RawAudioEncoder struct {
}

func (*RawAudioEncoder) Encode

func (encoder *RawAudioEncoder) Encode(audio *Audio) ([]byte, error)

type RefillAudioBuffer

type RefillAudioBuffer struct {
	Buffer AudioBuffer

	MinSampleCount uint32
	// contains filtered or unexported fields
}

func (*RefillAudioBuffer) AudioOut

func (pseudoBuffer *RefillAudioBuffer) AudioOut(audio *Audio)

func (*RefillAudioBuffer) Read

func (pseudoBuffer *RefillAudioBuffer) Read() (audio *Audio)

func (*RefillAudioBuffer) SampleCount

func (pseudoBuffer *RefillAudioBuffer) SampleCount() uint32

type Remixer

type Remixer struct {
	OutputChannels []RemixerChannel
	Output         AudioHandler
}

func NewRemixer

func NewRemixer(definition string) *Remixer

func (*Remixer) AudioOut

func (remixer *Remixer) AudioOut(audio *Audio)

func (*Remixer) OutputChannelCount

func (remixer *Remixer) OutputChannelCount() int

func (*Remixer) String

func (remixer *Remixer) String() string

type RemixerChannel

type RemixerChannel struct {
	InputChannels []int
}

func (*RemixerChannel) Mix

func (channel *RemixerChannel) Mix(audio *Audio) []float32

func (*RemixerChannel) String

func (channel *RemixerChannel) String() string

type Resettable

type Resettable interface {
	Reset()
}

type ResizeAudio

type ResizeAudio struct {
	Output       AudioHandler
	SampleCount  int
	ChannelCount int
	// contains filtered or unexported fields
}

func (*ResizeAudio) AudioOut

func (resize *ResizeAudio) AudioOut(audio *Audio)

type SampleFormat

type SampleFormat interface {
	Write(writer io.Writer, sample float32) error
	Read(reader io.Reader) (float32, error)
	Name() string
	SampleSize() int
}

func FromAlsaSampleFormat

func FromAlsaSampleFormat(alsaSampleFormat alsa.SampleFormat) SampleFormat

func ParseSampleFormat

func ParseSampleFormat(name string) SampleFormat

type ShoutcastDialer

type ShoutcastDialer struct {
}

func (*ShoutcastDialer) Client

func (dialer *ShoutcastDialer) Client(output *HttpStreamOutput) (*shoutcast.Client, error)

func (*ShoutcastDialer) Connect

func (dialer *ShoutcastDialer) Connect(output *HttpStreamOutput) (net.Conn, error)

type SndFile

type SndFile struct {
	// contains filtered or unexported fields
}

func SndFileOpen

func SndFileOpen(path string, mode int, info *Info) (*SndFile, error)

func (*SndFile) Close

func (file *SndFile) Close() error

func (*SndFile) Info

func (file *SndFile) Info() *Info

func (*SndFile) IsClosed

func (file *SndFile) IsClosed() bool

func (*SndFile) Path

func (file *SndFile) Path() string

func (*SndFile) ReadFloat

func (file *SndFile) ReadFloat(samples []float32) int64

func (*SndFile) WriteFloat

func (file *SndFile) WriteFloat(samples []float32) int64

func (*SndFile) WriteSync

func (file *SndFile) WriteSync()

type SoundChannelMetrics

type SoundChannelMetrics struct {
	PeakLevel float32
}

type SoundMeterAudioHandler

type SoundMeterAudioHandler struct {
	Output AudioHandler
	// contains filtered or unexported fields
}

func (*SoundMeterAudioHandler) AudioOut

func (soundMeter *SoundMeterAudioHandler) AudioOut(audio *Audio)

func (SoundMeterAudioHandler) MarshalJSON

func (soundMeter SoundMeterAudioHandler) MarshalJSON() ([]byte, error)

func (*SoundMeterAudioHandler) NewReceiver

func (soundMeter *SoundMeterAudioHandler) NewReceiver() *SoundMetricsReceiver

type SoundMetrics

type SoundMetrics struct {
	ChannelMetrics []SoundChannelMetrics
}

func NewSoundMetrics

func NewSoundMetrics(audio *Audio) *SoundMetrics

func (*SoundMetrics) ChannelCount

func (metrics *SoundMetrics) ChannelCount() int

func (*SoundMetrics) MarshalJSON

func (metrics *SoundMetrics) MarshalJSON() ([]byte, error)

type SoundMetricsHistory

type SoundMetricsHistory struct {
	ChannelCount int
	// contains filtered or unexported fields
}

func NewSoundMetricsHistory

func NewSoundMetricsHistory(length int, channelCount int) *SoundMetricsHistory

func (*SoundMetricsHistory) GlobalMetrics

func (history *SoundMetricsHistory) GlobalMetrics() *SoundMetrics

func (*SoundMetricsHistory) Update

func (history *SoundMetricsHistory) Update(metrics *SoundMetrics)

type SoundMetricsReceiver

type SoundMetricsReceiver struct {
	Channel chan *SoundMetrics
	// contains filtered or unexported fields
}

func (*SoundMetricsReceiver) Close

func (receiver *SoundMetricsReceiver) Close()

type StdWriter

type StdWriter struct {
	Out io.Writer
}

func (*StdWriter) Debug

func (writer *StdWriter) Debug(message string) error

func (*StdWriter) Emerg

func (writer *StdWriter) Emerg(message string) error

func (*StdWriter) Info

func (writer *StdWriter) Info(message string) error

type StreamDecoder

type StreamDecoder interface {
	SetAudioHandler(audioHandler AudioHandler)
	Init() error

	Read(reader io.Reader) error
	Reset()
}

func NewStreamDecoder

func NewStreamDecoder(encoding string) StreamDecoder

type StreamDescription

type StreamDescription struct {
	BitRate     int
	Public      bool
	Name        string
	Description string
	URL         string
	Genre       string
}

func (*StreamDescription) IcecastHeaders

func (description *StreamDescription) IcecastHeaders() map[string]string

func (*StreamDescription) IsEmpty

func (description *StreamDescription) IsEmpty() bool

func (*StreamDescription) PublicZeroOrOne

func (description *StreamDescription) PublicZeroOrOne() string

func (*StreamDescription) ShoutcastHeaders

func (description *StreamDescription) ShoutcastHeaders() map[string]string

type StreamEncoder

type StreamEncoder interface {
	AudioOut(audio *Audio)
	Init() error
	Close()
}

func NewStreamEncoder

func NewStreamEncoder(format AudioFormat, writer io.Writer) StreamEncoder

type TimedFileOutput

type TimedFileOutput struct {
	RootDirectory string
	CloseHandler  string
	// contains filtered or unexported fields
}

func (*TimedFileOutput) AudioOut

func (output *TimedFileOutput) AudioOut(audio *Audio)

func (*TimedFileOutput) ChannelCount

func (output *TimedFileOutput) ChannelCount() int

func (*TimedFileOutput) FileDuration

func (output *TimedFileOutput) FileDuration() time.Duration

func (*TimedFileOutput) SampleRate

func (output *TimedFileOutput) SampleRate() int

func (*TimedFileOutput) SetChannelCount

func (output *TimedFileOutput) SetChannelCount(channelCount int)

func (*TimedFileOutput) SetFileDuration

func (output *TimedFileOutput) SetFileDuration(fileDuration time.Duration)

func (*TimedFileOutput) SetSampleRate

func (output *TimedFileOutput) SetSampleRate(sampleRate int)

func (*TimedFileOutput) Write

func (output *TimedFileOutput) Write(audio *Audio) (err error)

type TimedFileOutputConfig

type TimedFileOutputConfig struct {
	Root         string
	Duration     time.Duration
	CloseHandler string
}

func (*TimedFileOutputConfig) Apply

func (config *TimedFileOutputConfig) Apply(output *TimedFileOutput)

func (*TimedFileOutputConfig) Flags

func (config *TimedFileOutputConfig) Flags(flags *flag.FlagSet, prefix string)

type UDPClientConfig

type UDPClientConfig struct {
	CommandConfig

	Alsa AlsaInputConfig
	Udp  UDPOutputConfig
}

func (*UDPClientConfig) Apply

func (config *UDPClientConfig) Apply(alsaInput *AlsaInput, udpOutput *UDPOutput, httpServer *HttpServer)

func (*UDPClientConfig) Flags

func (config *UDPClientConfig) Flags(flags *flag.FlagSet)

type UDPInput

type UDPInput struct {
	Bind    string
	Decoder AudioDecoder
	// contains filtered or unexported fields
}

func (*UDPInput) Init

func (input *UDPInput) Init() (err error)

func (*UDPInput) Read

func (input *UDPInput) Read() (err error)

func (*UDPInput) Run

func (input *UDPInput) Run()

func (*UDPInput) SetAudioHandler

func (input *UDPInput) SetAudioHandler(audioHandler AudioHandler)

type UDPInputConfig

type UDPInputConfig struct {
	Bind string
}

func (*UDPInputConfig) Apply

func (config *UDPInputConfig) Apply(udpInput *UDPInput)

func (*UDPInputConfig) Flags

func (config *UDPInputConfig) Flags(flags *flag.FlagSet, prefix string)

type UDPOutput

type UDPOutput struct {
	Target            string
	Encoder           AudioEncoder
	PacketSampleCount int
	// contains filtered or unexported fields
}

func (*UDPOutput) AudioOut

func (output *UDPOutput) AudioOut(audio *Audio)

func (*UDPOutput) Init

func (output *UDPOutput) Init() (err error)

type UDPOutputConfig

type UDPOutputConfig struct {
	Target string
	Opus   OpusAudioEncoderConfig
}

func (*UDPOutputConfig) Apply

func (config *UDPOutputConfig) Apply(udpOutput *UDPOutput)

func (*UDPOutputConfig) Flags

func (config *UDPOutputConfig) Flags(flags *flag.FlagSet, prefix string)

type UDPServerConfig

type UDPServerConfig struct {
	CommandConfig

	Alsa AlsaOutputConfig
	Udp  UDPInputConfig
}

func (*UDPServerConfig) Apply

func (config *UDPServerConfig) Apply(alsaOutput *AlsaOutput, udpInput *UDPInput, httpServer *HttpServer)

func (*UDPServerConfig) Flags

func (config *UDPServerConfig) Flags(flags *flag.FlagSet)

type UnfillAudioBuffer

type UnfillAudioBuffer struct {
	Buffer AudioBuffer

	MaxSampleCount    uint32
	UnfillSampleCount uint32

	Metrics *LocalMetrics
}

func (*UnfillAudioBuffer) AudioOut

func (pseudoBuffer *UnfillAudioBuffer) AudioOut(audio *Audio)

func (*UnfillAudioBuffer) Read

func (pseudoBuffer *UnfillAudioBuffer) Read() (audio *Audio)

func (*UnfillAudioBuffer) SampleCount

func (pseudoBuffer *UnfillAudioBuffer) SampleCount() uint32

type VorbisDecoder

type VorbisDecoder struct {
	// contains filtered or unexported fields
}

func (*VorbisDecoder) NewStream

func (decoder *VorbisDecoder) NewStream(serialNo int32)

func (*VorbisDecoder) PacketOut

func (decoder *VorbisDecoder) PacketOut(packet *ogg.Packet) (result bool)

func (*VorbisDecoder) Reset

func (decoder *VorbisDecoder) Reset()

func (*VorbisDecoder) SetAudioHandler

func (decoder *VorbisDecoder) SetAudioHandler(audioHandler AudioHandler)

type VorbisEncoder

type VorbisEncoder struct {
	Quality float32
	BitRate int
	Mode    string

	ChannelCount int
	SampleRate   int

	PacketHandler OggPacketHandler
	// contains filtered or unexported fields
}

func (*VorbisEncoder) AudioOut

func (encoder *VorbisEncoder) AudioOut(audio *Audio)

func (*VorbisEncoder) Close

func (encoder *VorbisEncoder) Close()

func (*VorbisEncoder) Flush

func (encoder *VorbisEncoder) Flush()

func (*VorbisEncoder) Init

func (encoder *VorbisEncoder) Init() error

func (*VorbisEncoder) Reset

func (encoder *VorbisEncoder) Reset()

Directories

Path Synopsis

Jump to

Keyboard shortcuts

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