Categorygithub.com/ConnorsApps/pipewire-monitor-go
modulepackage
0.1.0
Repository: https://github.com/connorsapps/pipewire-monitor-go.git
Documentation: pkg.go.dev

# README

Pipewire Monitor Golang

A wrapper for watching Pipewire events using the CLI pw-dump

pw-dump ---monitor --no-colors

Example

import (
	"context"
	"fmt"

	pwmonitor "github.com/ConnorsApps/pipewire-monitor-go"
)

// Only watch for nodes or removal events
func filter(e *pwmonitor.Event) bool {
	return e.Type == pwmonitor.EventNode || e.IsRemovalEvent()
}

func main() {
	var (
		ctx        = context.Background()
		eventsChan = make(chan []*pwmonitor.Event)
	)
	go func() {
		panic(pwmonitor.Monitor(ctx, eventsChan, filter))
	}()

	for {
		events := <-eventsChan
		for _, e := range events {
			fmt.Println(e.Type, "id:", e.ID)
		}
	}
}

# Packages

No description provided by the author

# Functions

Monitor listens to pipewire events and sends them to the output channel Provide a filter function to remove events you're not interested in.

# Constants

No description provided by the author
No description provided by the author
No description provided by the author
A node that is both a sink and a source.
A sink for audio samples, like an audio card.
A source of audio samples like a microphone.
A capture stream.
A playback stream.
No description provided by the author
No description provided by the author
No description provided by the author
No description provided by the author
No description provided by the author

# Structs

No description provided by the author
No description provided by the author
No description provided by the author
No description provided by the author
No description provided by the author
No description provided by the author
No description provided by the author
No description provided by the author

# Type aliases

No description provided by the author
No description provided by the author
No description provided by the author
No description provided by the author