foxAudioEncoder

package
v0.0.0-...-2f35ba3 Latest Latest
Warning

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

Go to latest
Published: Mar 24, 2024 License: MIT Imports: 7 Imported by: 0

Documentation

Overview

package calls an encoder based upon the supplied format and then processes the returned bytestream either to standardd out or to the supplied file name

Index

Constants

This section is empty.

Variables

This section is empty.

Functions

This section is empty.

Types

type AudioEncoder

type AudioEncoder struct {
	SampleRate  int
	BitDepth    int
	NumChannels int
	Size        int64
	Type        string
	Filename    string // Added filename field

	DebugFunc func(string) // enables the use of an external debug function supplied at the application level - expect to use foxLog
	DebugOn   bool         //enables debugging
	// contains filtered or unexported fields
}

Encoder definition EncoderDefinition

func (*AudioEncoder) AccumulateAndEncode

func (myEncoder *AudioEncoder) AccumulateAndEncode(samples [][]float64, n int) error

func (*AudioEncoder) AccumulateAndEncodeChannel

func (myEncoder *AudioEncoder) AccumulateAndEncodeChannel(samplesChannel <-chan [][]float64, throttleInputChannel chan<- time.Duration, n int) error

func (*AudioEncoder) EncodeData

func (myEncoder *AudioEncoder) EncodeData(buffer [][]float64) error

Call low level encoder to convert [][]float64 samples to bytesream of choice, and then call output writer

func (*AudioEncoder) EncodeHeader

func (myEncoder *AudioEncoder) EncodeHeader() error

Expose the methods

func (*AudioEncoder) EncodeSamplesChannel

func (myEncoder *AudioEncoder) EncodeSamplesChannel(samplesChannel <-chan [][]float64, throttleInputChannel chan<- time.Duration) error

Wraps the encoder into a channel based function that takes a stream of inputSamples as [][]float64, throttleInputChannel as duration and a wait group the optional throttleInputChannel will send a delay based upont the encoder processing time to be used by the feeding function in order to slow down any processing

func (*AudioEncoder) Initialise

func (myEncoder *AudioEncoder) Initialise() error

Constructor for Encoder

type EncoderInterface

type EncoderInterface interface {
	EncodeHeader() ([]byte, error)
	EncodeData(samples [][]float64) ([]byte, error)
}

each Encoder must have these methods defined

Directories

Path Synopsis

Jump to

Keyboard shortcuts

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