audio

package
v0.10.6 Latest Latest
Warning

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

Go to latest
Published: Nov 16, 2026 License: GPL-3.0 Imports: 20 Imported by: 3 modules, 1 package

The first number is the count of modules that contain a package that imports this one. The module count is a better indicator of popularity than the package count. A module with 100 importing packages is counted only once instead of 100 times, reflecting the fact that the choice to use the package was likely made only once, not 100 times.
A '?' means that the value hasn't been computed yet.

Documentation

Index

Constants

View Source
const (
	DefaultChunkSize = 512 * 1024
	PrefetchCount    = 3
)

Variables

This section is empty.

Functions

This section is empty.

Types

type Decryptor

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

func NewAesAudioDecryptor

func NewAesAudioDecryptor(r io.ReaderAt, key []byte) (*Decryptor, error)

func (*Decryptor) Close

func (a *Decryptor) Close() error

func (*Decryptor) ReadAt

func (a *Decryptor) ReadAt(p []byte, pos int64) (n int, err error)

type HttpChunkedReader

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

func NewHttpChunkedReader

func NewHttpChunkedReader(log librespot.Logger, client *http.Client, audioUrl string) (_ *HttpChunkedReader, err error)

func (*HttpChunkedReader) AvgLatencyMs added in v0.3.0

func (r *HttpChunkedReader) AvgLatencyMs() float64

func (*HttpChunkedReader) Close added in v0.5.0

func (r *HttpChunkedReader) Close() error

func (*HttpChunkedReader) InitialLatency added in v0.3.0

func (r *HttpChunkedReader) InitialLatency() time.Duration

func (*HttpChunkedReader) MaxLatency added in v0.3.0

func (r *HttpChunkedReader) MaxLatency() time.Duration

func (*HttpChunkedReader) MedianLatency added in v0.3.0

func (r *HttpChunkedReader) MedianLatency() time.Duration

func (*HttpChunkedReader) MinLatency added in v0.3.0

func (r *HttpChunkedReader) MinLatency() time.Duration

func (*HttpChunkedReader) OnComplete added in v0.8.0

func (r *HttpChunkedReader) OnComplete(cb func(io.ReaderAt, int64))

OnComplete registers a callback invoked once, in a separate goroutine, as soon as every chunk has been downloaded. The callback receives the reader as an io.ReaderAt (serving the fully-buffered chunks) and the total size, which allows the complete encrypted file to be persisted to a cache. If the file is already fully downloaded, the callback fires immediately.

func (*HttpChunkedReader) Read

func (r *HttpChunkedReader) Read(p []byte) (n int, err error)

func (*HttpChunkedReader) ReadAt

func (r *HttpChunkedReader) ReadAt(p []byte, pos int64) (n int, _ error)

func (*HttpChunkedReader) Seek

func (r *HttpChunkedReader) Seek(offset int64, whence int) (int64, error)

func (*HttpChunkedReader) Size

func (r *HttpChunkedReader) Size() int64

func (*HttpChunkedReader) TotalTime added in v0.3.0

func (r *HttpChunkedReader) TotalTime() time.Duration

func (*HttpChunkedReader) Url added in v0.3.0

func (r *HttpChunkedReader) Url() *url.URL

type KeyProvider

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

func NewAudioKeyProvider

func NewAudioKeyProvider(log librespot.Logger, ap *ap.Accesspoint) *KeyProvider

func (*KeyProvider) Request

func (p *KeyProvider) Request(ctx context.Context, gid []byte, fileId []byte) ([]byte, error)

type KeyProviderError added in v0.2.0

type KeyProviderError struct {
	Code uint16
}

func (KeyProviderError) Error added in v0.2.0

func (e KeyProviderError) Error() string

type LatencyReader added in v0.3.0

type LatencyReader struct {
	io.Reader
	Callback func(time.Duration)
	// contains filtered or unexported fields
}

func (*LatencyReader) Read added in v0.3.0

func (r *LatencyReader) Read(b []byte) (int, error)

Jump to

Keyboard shortcuts

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