asset

package
v0.0.0-...-becbe35 Latest Latest
Warning

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

Go to latest
Published: Jan 7, 2025 License: MIT Imports: 18 Imported by: 0

Documentation

Index

Constants

View Source
const (
	ChunkIdx_Nil = ChunkIdx(-1)
)
View Source
const (
	Header_AssetWordSize uint8 = 0x03
)
View Source
const (

	// Spotify inserts a custom Ogg packet at the start with custom metadata values, that you would
	// otherwise expect in Vorbis comments. This packet isn't well-formed and players may balk at it.
	// Search for "parse_from_ogg" in librespot -- https://github.com/librespot-org/librespot
	SPOTIFY_OGG_HEADER_SIZE = 0xa7
)

Variables

DefaultAudioFormats is the default audio format for assets if not specified via AssetFormat.

Functions

func ReadU16

func ReadU16(data []byte) (uint16, []byte, error)

func ReadU32

func ReadU32(data []byte) uint32

Types

type AssetFormat

type AssetFormat struct {

	// Audio formats for the asset in order of preference.
	// If nil, DefaultAudioFormats is used.
	AudioFormats []Spotify.AudioFile_Format
}

Expresses preferences for the asset data in order of preference.

type ChunkIdx

type ChunkIdx int32 // 0-based index of the chunk in the asset

func ChunkIdxAtOffset

func ChunkIdxAtOffset(byteOfs int64) ChunkIdx

func (ChunkIdx) StartByteOffset

func (ci ChunkIdx) StartByteOffset() int64

type ChunkStatus

type ChunkStatus int32

type Downloader

type Downloader interface {
	HandleCmd(cmd byte, data []byte) error

	// Blocks until the asset is ready to be accessed.
	PinTrack(uri string, want *AssetFormat) (media.Asset, error)
}

func NewDownloader

func NewDownloader(conn connection.PacketStream, client *mercury.Client) Downloader

Jump to

Keyboard shortcuts

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