papipes

package module
v0.0.0-...-3c63b49 Latest Latest
Warning

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

Go to latest
Published: Oct 27, 2020 License: MIT Imports: 7 Imported by: 5

README

papipes

Pulseaudio client library in Golang for creating virtual sinks and sources

Usage

package main

import (
	"github.com/akosmarton/papipes"
)

func main() {
	source := papipes.Source{
		Filename: "/tmp/source.sock",
		Properties: map[string]interface{}{
			"device.description": "Virtual Input",
		},
	}
	source.Open()
	defer source.Close()

	sink := papipes.Sink{
		Filename: "/tmp/sink.sock",
		Properties: map[string]interface{}{
			"device.description": "Virtual Output",
		},
	}
	sink.Open()
	defer sink.Close()

	p := make([]byte, 0)

	source.Write(p)
	sink.Read(p)
}

Documentation

Index

Constants

This section is empty.

Variables

This section is empty.

Functions

This section is empty.

Types

type Sink

type Sink struct {
	Filename string
	Name     string
	Format   string
	Rate     int
	Channels int
	// ChannelMap
	UseSystemClockForTiming bool
	// contains filtered or unexported fields
}

func GetActiveSinks

func GetActiveSinks() ([]*Sink, error)

func (*Sink) Close

func (s *Sink) Close() error

func (*Sink) GetProperty

func (s *Sink) GetProperty(key string) interface{}

func (*Sink) IsOpen

func (s *Sink) IsOpen() bool

func (*Sink) Open

func (s *Sink) Open() error

func (*Sink) Read

func (s *Sink) Read(p []byte) (n int, err error)

func (*Sink) SetProperty

func (s *Sink) SetProperty(key string, value interface{}) *Sink

type Source

type Source struct {
	Filename string
	Name     string
	Format   string
	Rate     int
	Channels int
	// contains filtered or unexported fields
}

func GetActiveSources

func GetActiveSources() ([]*Source, error)

func (*Source) Close

func (s *Source) Close() error

func (*Source) GetProperty

func (s *Source) GetProperty(key string) interface{}

func (*Source) IsOpen

func (s *Source) IsOpen() bool

func (*Source) Open

func (s *Source) Open() error

func (*Source) SetProperty

func (s *Source) SetProperty(key string, value interface{}) *Source

func (*Source) Write

func (s *Source) Write(p []byte) (n int, err error)

Directories

Path Synopsis

Jump to

Keyboard shortcuts

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