Documentation ¶
Index ¶
- 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) HasStreams() bool
- func (audio *Audio) MetaData() map[string]string
- func (audio *Audio) Read() bool
- func (audio *Audio) SampleRate() int
- func (audio *Audio) Samples() interface{}
- func (audio *Audio) SetBuffer(buffer []byte) error
- func (audio *Audio) Stream() int
- func (audio *Audio) Total() int
- 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) StreamFile() 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 ¶
This section is empty.
Types ¶
type Audio ¶
type Audio struct {
// contains filtered or unexported fields
}
func NewAudioStreams ¶ added in v1.3.0
Read all audio streams from the given file.
func (*Audio) BitsPerSample ¶
func (*Audio) HasStreams ¶ added in v1.4.0
Returns true if file has any video, subtitle, data or attachment streams.
func (*Audio) Read ¶
Reads the next frame of audio and stores it in the buffer. If the last audio frame has been read, returns false, otherwise true.
func (*Audio) Samples ¶ added in v1.1.0
func (audio *Audio) Samples() interface{}
Casts the values in the byte buffer to those specified by the audio format.
func (*Audio) SetBuffer ¶
Sets the buffer to the given byte array. The length of the buffer must be a multiple of (bytes per sample * audio channels).
type AudioWriter ¶
type AudioWriter struct {
// contains filtered or unexported fields
}
func NewAudioWriter ¶
func NewAudioWriter(filename string, options *Options) (*AudioWriter, error)
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
Audio Sample Rate in Hz.
func (*AudioWriter) StreamFile ¶ added in v1.4.0
func (writer *AudioWriter) StreamFile() string
File used to fill in extra stream data.
func (*AudioWriter) Write ¶
func (writer *AudioWriter) Write(samples interface{}) error
Writes the given samples 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 frame from of audio and stores it in the buffer. If the last frame has been read, returns false, otherwise true.
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 buffer to the given byte array. The length of the buffer must be a multiple of (bytes per sample * audio channels).
type Player ¶
type Player struct {
// contains filtered or unexported fields
}