1.0.5 • Published 2 years ago
@tmigone/pulseaudio v1.0.5
🎶 @tmigone/pulseaudio 🎶
@tmigone/pulseaudio
is a TypeScript based client library for PulseAudio, the most popular sound server for Linux. This library allows you to easily build clients or applications that interact with a PulseAudio server over it's native protocol, for example media players/recorders, volume control applications, etc.
Features
- Zero dependency fully typed TypeScript implementation of the PulseAudio client protocol
- Extensive testing suite
- Protocol features:
- authentication - provide authentication data for the server
- transport - connect over UNIX domain sockets or TCP sockets
- introspection - query, modify and operate on PulseAudio objects like modules, sinks, sources, etc.
- events - subscribe to server-side object events like a sink starting playback, etc.
- (To be implemented) streams - manage audio playback and recording using Node.js streams
Installation
Install the library using npm:
npm install @tmigone/pulseaudio
Usage
import PulseAudio, { Sink } from '@tmigone/pulseaudio'
(async () => {
// Connect using tcp or unix socket
// const client: PulseAudio = new PulseAudio('unix:/run/pulse/pulseaudio.socket')
const client: PulseAudio = new PulseAudio('tcp:192.168.1.10:4317')
await client.connect()
// Set volume of all sinks to 50%
const sinks: Sink[] = await client.getSinkList()
for (const sink of sinks) {
await client.setSinkVolume(sink.index, 50)
}
// Close connection
client.disconnect()
})()
Documentation
Visit the docs site for in depth documentation on the library API's.
1.0.5
2 years ago
1.0.2
2 years ago
1.0.1
2 years ago
1.0.0
2 years ago
1.0.4
2 years ago
1.0.3
2 years ago
0.1.11
3 years ago
0.1.12
3 years ago
0.1.10
3 years ago
0.1.8
4 years ago
0.1.7
4 years ago
0.1.6
4 years ago
0.1.5
4 years ago
0.1.4
4 years ago
0.1.3
4 years ago
0.1.2
4 years ago
0.1.1
4 years ago
0.1.0
4 years ago
0.0.11
4 years ago
0.0.12
4 years ago
0.0.10
4 years ago
0.0.9
4 years ago
0.0.8
4 years ago