Skip to content

About

A Go SDK for Sendspin players: encrypted connections, audio decoding, synchronized playback, discovery, and optional audio capture.

Topics

Resources

Stars

1 star

Watchers

0 watching

Forks

Latest commit

 

History

25 Commits

Folders and files

NameName
Last commit message
Last commit date
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 

Repository files navigation

Go Reference Continuous Integration

sendspin-player-go

A Go SDK for Sendspin players: encrypted connections, audio decoding, synchronized playback, discovery, and optional audio capture.

Install

Go 1.27.3+ is required.

go get github.com/echocat/sendspin-player-go

The SDK and native audio backends build without CGO. Opening an audio device still requires the operating system's runtime libraries and permissions.

Quick start

package main

import (
    "context"
    "os"
    "os/signal"
    "path/filepath"

    sendspin "github.com/echocat/sendspin-player-go"
    "github.com/echocat/sendspin-player-go/audio/native"
)

func main() {
    ctx, stop := signal.NotifyContext(context.Background(), os.Interrupt)
    defer stop()

    configDir, err := os.UserConfigDir()
    if err != nil {
        panic(err)
    }
    player, err := sendspin.New(ctx, sendspin.Config{
        Name:   "Living room",
        Store:  sendspin.FileStore{Path: filepath.Join(configDir, "sendspin-player-go", "device.json")},
        Output: native.Output{},
    })
    if err != nil {
        panic(err)
    }
    if err := player.Run(ctx, "ws://192.0.2.1:8927/sendspin"); err != nil && ctx.Err() == nil {
        panic(err)
    }
}

Pair the client with your server using player.PairingToken(). Treat the token and credential file as secrets. See SDK usage for pairing, discovery, server-initiated connections, and cancellation.

Features

  • Encrypted client- and server-initiated connections with mDNS discovery.
  • PCM, FLAC, and Opus decoding, buffering, clock synchronization, and drift correction.
  • Native ALSA, PipeWire, WASAPI, and CoreAudio playback and capture.
  • Controller commands, metadata, artwork, visualizer, and color updates.
  • Optional Source streaming, PIN pairing, and host-managed volume/mute.
  • Replaceable audio interfaces, codecs, storage, and application-selected logging.

Targets Sendspin 1.0.0-rc1. See protocol support and limitations.

Documentation

License

MIT, with third-party notices in NOTICES. The derived time-filter code uses Apache License 2.0. Sendspin is a trademark of the Open Home Foundation.

About

A Go SDK for Sendspin players: encrypted connections, audio decoding, synchronized playback, discovery, and optional audio capture.

Topics

Resources

Stars

1 star

Watchers

0 watching

Forks

Releases

Used by

Contributors

Languages