Documentation ¶
Index ¶
Constants ¶
const ( // DefaultChannels recorded into a wav file DefaultChannels int = 1 // DefaultSamplerate for writing wav files to disk DefaultSamplerate float64 = 48000 // DefaultBitDepth for writing audio samples to disk DefaultBitDepth int = 16 )
Variables ¶
This section is empty.
Functions ¶
This section is empty.
Types ¶
type Option ¶
type Option func(*Options)
Option is the type for a function option
func BitDepth ¶
BitDepth is a functional option to set the bit depth with which the audio will be written to file. The Bitdepth (12/16 bit) defines the dynamic range of the audio. For most usecases 16 bit (default) is the way to go. The higher the bitDepth, the larger the recordings are.
func Channels ¶
Channels is a functional option to set the amount of channels to be used with the audio device. Typically this is either Mono (1) or Stereo (2).
func Samplerate ¶
Samplerate is a functional option to set the sampling rate with which the audio will be recorded. The higher the samplerate, the higher larger the recordings are.
type WavWriter ¶
WavWriter implements the audio.Sink interface and is used to write (record) audio frames in the wav format.
func NewWavWriter ¶
NewWavWriter returns a wavWriter to which audio frames can be written to. The audio data will be saved in the wav format.