player

package
v1.0.1 Latest Latest
Warning

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

Go to latest
Published: Jan 26, 2020 License: MIT Imports: 13 Imported by: 0

Documentation

Index

Constants

This section is empty.

Variables

View Source
var AUDIO_AESIV = []byte{0x72, 0xe0, 0x67, 0xfb, 0xdd, 0xcb, 0xcf, 0x77, 0xeb, 0xe8, 0xbc, 0x64, 0x3f, 0x63, 0x0d, 0x93}

Functions

func CreateCipher

func CreateCipher(key []byte) cipher.Block

Types

type AudioFile

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

AudioFile represents a downloadable/cached audio file fetched by Spotify, in an encoded format (OGG, etc)

func (*AudioFile) Read

func (a *AudioFile) Read(buf []byte) (int, error)

Read is an implementation of the io.Reader interface. Note that due to the nature of the streaming, we may return zero bytes when we are waiting for audio data from the Spotify servers, so make sure to wait for the io.EOF error before stopping playback.

func (*AudioFile) Seek

func (a *AudioFile) Seek(offset int64, whence int) (int64, error)

Seek implements the io.Seeker interface

func (*AudioFile) Size

func (a *AudioFile) Size() uint32

Size returns the size, in bytes, of the final audio file

type AudioFileDecrypter

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

func NewAudioFileDecrypter

func NewAudioFileDecrypter() *AudioFileDecrypter

func (*AudioFileDecrypter) DecryptAudioWithBlock

func (afd *AudioFileDecrypter) DecryptAudioWithBlock(index int, block cipher.Block, ciphertext []byte, plaintext []byte) []byte

type Channel

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

func NewChannel

func NewChannel(num uint16, release releaseFunc) *Channel

type Player

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

func CreatePlayer

func CreatePlayer(conn connection.PacketStream, client *mercury.Client) *Player

func (*Player) AllocateChannel

func (p *Player) AllocateChannel() *Channel

func (*Player) HandleCmd

func (p *Player) HandleCmd(cmd byte, data []byte)

func (*Player) LoadTrack

func (p *Player) LoadTrack(file *Spotify.AudioFile, trackId []byte) (*AudioFile, error)

func (*Player) LoadTrackWithIdAndFormat

func (p *Player) LoadTrackWithIdAndFormat(fileId []byte, format Spotify.AudioFile_Format, trackId []byte) (*AudioFile, error)

Jump to

Keyboard shortcuts

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