Documentation
¶
Index ¶
- func Play(filename string) error
- type Audio
- func (audio *Audio) Bitrate() int
- func (audio *Audio) BitsPerSample() int
- func (audio *Audio) Buffer() []byte
- func (audio *Audio) Channels() int
- func (audio *Audio) Close()
- func (audio *Audio) Codec() string
- func (audio *Audio) Duration() float64
- func (audio *Audio) FileName() string
- func (audio *Audio) Format() string
- func (audio *Audio) Read() bool
- func (audio *Audio) SampleRate() int
- func (audio *Audio) Samples() interface{}
- func (audio *Audio) SetBuffer(buffer []byte) error
- type AudioWriter
- func (writer *AudioWriter) Bitrate() int
- func (writer *AudioWriter) Channels() int
- func (writer *AudioWriter) Close()
- func (writer *AudioWriter) Codec() string
- func (writer *AudioWriter) FileName() string
- func (writer *AudioWriter) Format() string
- func (writer *AudioWriter) SampleRate() int
- func (writer *AudioWriter) Video() string
- func (writer *AudioWriter) Write(samples interface{}) error
- type Microphone
- func (mic *Microphone) BitsPerSample() int
- func (mic *Microphone) Buffer() []byte
- func (mic *Microphone) Channels() int
- func (mic *Microphone) Close()
- func (mic *Microphone) Format() string
- func (mic *Microphone) Name() string
- func (mic *Microphone) Read() bool
- func (mic *Microphone) SampleRate() int
- func (mic *Microphone) Samples() interface{}
- func (mic *Microphone) SetBuffer(buffer []byte) error
- type Options
- type Player
Constants ¶
This section is empty.
Variables ¶
This section is empty.
Functions ¶
Types ¶
type Audio ¶
type Audio struct {
// contains filtered or unexported fields
}
func (*Audio) BitsPerSample ¶
func (*Audio) Read ¶
Reads the next frame from of audio and stores it in the buffer. If the last frame has been read, returns false, otherwise true.
func (*Audio) SampleRate ¶
type AudioWriter ¶
type AudioWriter struct {
// contains filtered or unexported fields
}
func NewAudioWriter ¶
func NewAudioWriter(filename string, options *Options) (*AudioWriter, error)
func (*AudioWriter) Bitrate ¶
func (writer *AudioWriter) Bitrate() int
func (*AudioWriter) Channels ¶
func (writer *AudioWriter) Channels() int
func (*AudioWriter) Close ¶
func (writer *AudioWriter) Close()
Closes the pipe and stops the ffmpeg process.
func (*AudioWriter) Codec ¶
func (writer *AudioWriter) Codec() string
func (*AudioWriter) FileName ¶
func (writer *AudioWriter) FileName() string
func (*AudioWriter) Format ¶
func (writer *AudioWriter) Format() string
func (*AudioWriter) SampleRate ¶
func (writer *AudioWriter) SampleRate() int
func (*AudioWriter) Video ¶
func (writer *AudioWriter) Video() string
func (*AudioWriter) Write ¶
func (writer *AudioWriter) Write(samples interface{}) error
Writes the given buffer to the audio file.
type Microphone ¶
type Microphone struct {
// contains filtered or unexported fields
}
func NewMicrophone ¶
func NewMicrophone(stream int, options *Options) (*Microphone, error)
func (*Microphone) BitsPerSample ¶
func (mic *Microphone) BitsPerSample() int
func (*Microphone) Buffer ¶
func (mic *Microphone) Buffer() []byte
func (*Microphone) Channels ¶
func (mic *Microphone) Channels() int
func (*Microphone) Close ¶
func (mic *Microphone) Close()
Closes the pipe and stops the ffmpeg process.
func (*Microphone) Format ¶
func (mic *Microphone) Format() string
func (*Microphone) Name ¶
func (mic *Microphone) Name() string
func (*Microphone) Read ¶
func (mic *Microphone) Read() bool
Reads the next audio sample from the microphone and stores in the buffer.
func (*Microphone) SampleRate ¶
func (mic *Microphone) SampleRate() int
func (*Microphone) Samples ¶ added in v1.1.0
func (mic *Microphone) Samples() interface{}
func (*Microphone) SetBuffer ¶
func (mic *Microphone) SetBuffer(buffer []byte) error
Sets the framebuffer to the given byte array. Note that "buffer" must be large enough to store one frame of mic data.
Click to show internal directories.
Click to hide internal directories.