NAME

Peta::Synth::Output::PipeWire - sound to PipeWire as it plays (pperl)

VERSION

version 0.2610180

SYNOPSIS

if (Peta::Synth::Output::PipeWire::available()) {
    my $out = Peta::Synth::Output::PipeWire->new(rate => 48000, latency => 0.1);
    $out->write(\@left, \@right) while ...;    # waits while the stream has enough
    $out->close;                                # plays the rest to its end
}

DESCRIPTION

A PipeWire stream through libpipewire (MIT licensed), called with pperl's Peta::FFI; perl5 has no such FFI, and plays through Peta::Synth::Output::Pulse. libpipewire runs its loop in its own thread; C never calls back into Perl: the writer fills the stream's empty buffers under the loop's lock, and waits while they are full. The same methods as Peta::Synth::Output::Pulse.

METHODS

new

new(rate => 48000, latency => 0.1, title => ...): a stream of floats in two channels; latency the seconds PipeWire is asked to keep its cycle to.

write, close, stop, sent, rate

As for Peta::Synth::Output::Pulse.

FUNCTIONS

available

Whether this perl has Peta::FFI and the library loads; $@ says why not.

AUTHOR

PetaMem s.r.o. <info@petamem.com>

COPYRIGHT

Copyright (c) 2026 PetaMem s.r.o.

LICENSE

This package is free software, dual-licensed under the Artistic License 2.0 and the BSD 2-Clause License. See the LICENSE file of the distribution.