sio: zikichombo.org/sio Index | Files | Directories

package sio

import "zikichombo.org/sio"

Package sio provides support for audio capture and playback.

Package sio is part of http://zikichombo.org

Package sio is in alpha, under development. Playback and capture interfaces are more mature than duplex and device interfaces. Linux/ALSA and darwin have worked on a few test systems. This package intends to be open-ended with respect to platform support, hopefully one day also including drivers from the likes of http://periph.io as upstream providers.

You are welcome to join the discussion and help us meet this goal at http://github.com/zikichombo/sio

Index

Package Files

doc.go init_linux.go sio.go

func Capture Uses

func Capture() (sound.Source, error)

Capture tries to open the default capture device with default settings with the default host, returning a non-nil in case of failure.

func CaptureWith Uses

func CaptureWith(v sound.Form, co sample.Codec, b int) (sound.Source, error)

CaptureWith opens a sound.Source with the specified sample codec and buffer size.

func Connect Uses

func Connect(pkgSel func(string) bool) (host.Entry, error)

Connect returns a connection to the default host sound system entry point "entry".

Connect returns ErrNoEntryAvailable if there are no entries for the host.

Connect returns ErrEntryInUse if a non-default host entry is in use.

Connect can be called many times without cost of re-initialising a connection. Connect can be called in different goroutines.

The argument pkgSel is used to filter the implementions of an entry point by means of examining their defining package path by reflection. It should return true if it accepts the implementation. If pkgSel is nil, Connect acts as though the function body were "return true".

func ConnectTo Uses

func ConnectTo(name string, pkgSel func(string) bool) (host.Entry, error)

ConnectTo connects to the named host sound system entry point "entry".

ConnectTo returns ErrNoEntryAvailable if there are no entries for the host.

ConnectTo returns ErrEntryInUse if another host entry other than one requested is in use.

ConnectTo can be called many times without cost of re-initialising a connection. ConnectTo can be called in different goroutines.

pkgSel is as in Connect.

func Disconnect Uses

func Disconnect()

Disconnect closes the currently in use entry, if any, so that another one may be used.

func Duplex Uses

func Duplex(in, out sound.Form) (sound.Duplex, error)

Duplex tries to return a sound.Duplex.

func DuplexWith Uses

func DuplexWith(in, out sound.Form, co sample.Codec, b int) (sound.Duplex, error)

DuplexWith tries to return a sound.Duplex.

func EntryNames Uses

func EntryNames() []string

EntryNames returns the names of host entry points.

func Play Uses

func Play(src sound.Source) error

Play tries to play a sound.Source default settings with the default entry, returning a non-nil in case of failure.

func PlayWith Uses

func PlayWith(src sound.Source, co sample.Codec, b int) error

PlayWith

func Player Uses

func Player(v sound.Form) (sound.Sink, error)

Player tries to return a sound.Sink to which Sends are played to some system output. Default entry and settings are applied.

func PlayerWith Uses

func PlayerWith(v sound.Form, co sample.Codec, b int) (sound.Sink, error)

PlayerWith tries to return a sound.Sink for playback with the specified sample codec and buffer size b.

Directories

PathSynopsis
hostPackage host provides host sound entry point support.
libsioPackage libsio provides some support for implementing the different ports.
ports/darwinPackage darwin zc sound/io entry points.
ports/linuxPackage linux zc sound/io entry points.

Package sio imports 4 packages (graph). Updated 2018-10-07. Refresh now. Tools for package owners.