intake

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

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

Go to latest
Published: Jun 7, 2019 License: Apache-2.0 Imports: 8 Imported by: 0

Documentation

Overview

Package intake handles the reading in of the wav audio source

Index

Constants

View Source
const (
	// RESOLUTION of sampling
	RESOLUTION = 1 // seconds
)

Variables

This section is empty.

Functions

This section is empty.

Types

type Config

type Config struct {
	Filename string `validate:"required"`
	Logger   *zap.Logger
}

Config describes configuration for Intake

func (*Config) Validate

func (c *Config) Validate() error

Validate validates the contents of Config

type Intake

type Intake struct {
	Logger *zap.Logger
	// contains filtered or unexported fields
}

Intake describes our audio consumer

func New

func New(c *Config) (*Intake, error)

New returns a new Intake

func (*Intake) Sample

func (i *Intake) Sample() (*SampleSet, error)

Sample collects the contents of the wav file and returns the sample collection or error

type Sample

type Sample struct {
	Timecode int
	S        audio.Float64
}

Sample is a de-interleaved raw audio sample second

type SampleSet

type SampleSet struct {
	Samples []*Sample
}

SampleSet represents many samples

func (*SampleSet) Decompose

func (s *SampleSet) Decompose() []float64

Decompose returns just a slice of all float64s

Jump to

Keyboard shortcuts

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