Documentation
¶
Index ¶
- Constants
- Variables
- func SaveTags(tag *OggTag, writer io.Writer) error
- type ErrBadSegs
- type ErrInvalidOggs
- type OGGDecoder
- type OGGEncoder
- func (enc *OGGEncoder) Encode(granule int64, packets [][]byte) error
- func (enc *OGGEncoder) EncodeBOS(granule int64, packets [][]byte) error
- func (enc *OGGEncoder) EncodeEOS(granule int64, packets [][]byte) error
- func (enc *OGGEncoder) Segmentize(pay segmentizePayload) ([]byte, segmentizePayload, segmentizePayload)
- func (enc *OGGEncoder) WritePackets(flag byte, granulePosition int64, packets [][]byte) error
- type OGGPage
- type OGGPageHeader
- type OggTag
- func (o *OggTag) ClearAllTags()
- func (o *OggTag) GetAlbum() string
- func (o *OggTag) GetAlbumArtist() string
- func (o *OggTag) GetArtist() string
- func (o *OggTag) GetBPM() int
- func (o *OggTag) GetComposer() string
- func (o *OggTag) GetCopyright() string
- func (o *OggTag) GetCoverArt() *image.Image
- func (o *OggTag) GetDiscNumber() int
- func (o *OggTag) GetDiscTotal() int
- func (o *OggTag) GetEncoder() string
- func (o *OggTag) GetGenre() string
- func (o *OggTag) GetTitle() string
- func (o *OggTag) GetTrackNumber() int
- func (o *OggTag) GetTrackTotal() int
- func (o *OggTag) Save(w io.Writer) error
- func (o *OggTag) SetAlbum(album string)
- func (o *OggTag) SetAlbumArtist(albumArtist string)
- func (o *OggTag) SetArtist(artist string)
- func (o *OggTag) SetBPM(bpm int)
- func (o *OggTag) SetComposer(composer string)
- func (o *OggTag) SetCopyright(copyright string)
- func (o *OggTag) SetCoverArt(coverArt *image.Image)
- func (o *OggTag) SetDiscNumber(discNumber int)
- func (o *OggTag) SetDiscTotal(discTotal int)
- func (o *OggTag) SetEncoder(encoder string)
- func (o *OggTag) SetGenre(genre string)
- func (o *OggTag) SetTitle(title string)
- func (o *OggTag) SetTrackNumber(trackNumber int)
- func (o *OggTag) SetTrackTotal(trackTotal int)
Constants ¶
View Source
const ( Vorbis = "vorbis" Opus = "opus" )
View Source
const ( HeaderSize = 27 MaxSegSize = 255 MaxSegSequenceSize = MaxSegSize * 255 MaxPageSize = HeaderSize + MaxSegSequenceSize + MaxSegSize )
View Source
const ( FlagCOP = 1 << iota // Continuation of packet FlagBOS // Beginning of stream FlagEOS // End of stream )
Variables ¶
View Source
var ( Oggs = [4]byte{'O', 'g', 'g', 'S'} VorbisPrefix = []byte("\x03vorbis") OpusPrefix = []byte("OpusTags") )
Functions ¶
Types ¶
type ErrBadSegs ¶
type ErrBadSegs struct{}
func (*ErrBadSegs) Error ¶
func (e *ErrBadSegs) Error() string
type ErrInvalidOggs ¶
type ErrInvalidOggs struct{}
func (*ErrInvalidOggs) Error ¶
func (e *ErrInvalidOggs) Error() string
type OGGDecoder ¶
type OGGDecoder struct {
Reader io.ReadSeeker
TagReader io.ReadSeeker
}
func (*OGGDecoder) Decode ¶
func (dec *OGGDecoder) Decode() (*OGGPage, error)
func (*OGGDecoder) ReadTags ¶
func (dec *OGGDecoder) ReadTags() (*OggTag, error)
type OGGEncoder ¶
func (*OGGEncoder) Encode ¶
func (enc *OGGEncoder) Encode(granule int64, packets [][]byte) error
Encode writes a data packet to the ogg stream with a given granule position. Large packets are split across multiple pages with continuation-of-packet flag set. Packets can be empty or nil, resulting in a single segment of size 0.
func (*OGGEncoder) EncodeBOS ¶
func (enc *OGGEncoder) EncodeBOS(granule int64, packets [][]byte) error
EncodeBOS writes a beginning-of-stream packet to the ogg stream with a given granule position. Large packets are split across multiple pages with continuation-of-packet flag set. Packets can be empty or nil, resulting in a single segment of size 0.
func (*OGGEncoder) EncodeEOS ¶
func (enc *OGGEncoder) EncodeEOS(granule int64, packets [][]byte) error
EncodeEOS writes a end-of-stream packet to the ogg stream. Packets can be empty or nil, resulting in a single segment of size 0.
func (*OGGEncoder) Segmentize ¶
func (enc *OGGEncoder) Segmentize(pay segmentizePayload) ([]byte, segmentizePayload, segmentizePayload)
func (*OGGEncoder) WritePackets ¶
func (enc *OGGEncoder) WritePackets(flag byte, granulePosition int64, packets [][]byte) error
type OGGPage ¶
type OGGPage struct {
Header OGGPageHeader
Packets [][]byte
}
type OGGPageHeader ¶
type OggTag ¶
type OggTag struct {
Album string
AlbumArtist string
Artist string
BPM string
Codec string
Composer string
Copyright string
CoverArt *image.Image
DiscNumber string
DiscTotal string
Encoder string
Genre string
Title string
TrackNumber string
TrackTotal string
UnmappedFields map[string]string
Vendor string
// contains filtered or unexported fields
}
func (*OggTag) ClearAllTags ¶
func (o *OggTag) ClearAllTags()
func (*OggTag) GetAlbumArtist ¶
func (*OggTag) GetComposer ¶
func (*OggTag) GetCopyright ¶
func (*OggTag) GetCoverArt ¶
func (*OggTag) GetDiscNumber ¶
func (*OggTag) GetDiscTotal ¶
func (*OggTag) GetEncoder ¶
func (*OggTag) GetTrackNumber ¶
func (*OggTag) GetTrackTotal ¶
func (*OggTag) SetAlbumArtist ¶
func (*OggTag) SetComposer ¶
func (*OggTag) SetCopyright ¶
func (*OggTag) SetCoverArt ¶
func (*OggTag) SetDiscNumber ¶
func (*OggTag) SetDiscTotal ¶
func (*OggTag) SetEncoder ¶
func (*OggTag) SetTrackNumber ¶
func (*OggTag) SetTrackTotal ¶
Click to show internal directories.
Click to hide internal directories.