sound

package
v0.0.0-...-f445fa1 Latest Latest
Warning

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

Go to latest
Published: Feb 22, 2020 License: MIT Imports: 5 Imported by: 0

Documentation

Index

Constants

This section is empty.

Variables

This section is empty.

Functions

func RecordWAV

func RecordWAV(writer io.Writer, stopCh <-chan struct{}) error

RecordWAV listens on the microphone and saves the signal to the given io.Writer it takes a stop channel to interrupt the recording

Types

type Reader

type Reader interface {
	Read([]float64) (int, error)
	SampleRate() float64
}

Reader interface allows you to read audio files

type WAVReader

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

WAVReader implements the sound.Reader interface

func NewWAVReader

func NewWAVReader(r riff.RIFFReader) (*WAVReader, error)

NewWAVReader creates a new wav reader

func (*WAVReader) Read

func (r *WAVReader) Read(dst []float64) (int, error)

Read reads from the given wav file and return raw audio data or an error if an error occured

func (*WAVReader) SampleRate

func (r *WAVReader) SampleRate() float64

SampleRate returns the sample rate for the given reader

Jump to

Keyboard shortcuts

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