php-pulseaudio/examples/list-sinks.php

13 lines
295 B
PHP

<?php
require_once __DIR__."/../vendor/autoload.php";
use NoccyLabs\PulseAudio\PulseAudio;
$pulse = new PulseAudio();
$sinks = $pulse->getSinks();
foreach ($sinks as $sink) {
printf(" [#%d] %s => %s (%s)\n", $sink->getIndex(), $sink->getName(), $sink->getCard(), $sink->getDriver());
}