Important: This documentation covers Yarn 1 (Classic).
For Yarn 2+ docs and migration guide, see yarnpkg.com.

Package detail

@tmigone/pulseaudio

tmigone120MIT1.0.5TypeScript support: included

A TypeScript based client library for PulseAudio.

pulseaudio, pulse, audio, paclient, palib, client

readme

🎶 @tmigone/pulseaudio 🎶

NPM CI Coverage Status

@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.

changelog

Change Log

All notable changes to this project will be documented in this file automatically by Versionist. DO NOT EDIT THIS FILE MANUALLY! This project adheres to Semantic Versioning.

1.0.4 - 2022-01-26

  • commands: fix return type of several commands [Tomás Migone]

1.0.3 - 2022-01-26

  • command: fix getSourceList return type [Tomás Migone]

1.0.2 - 2022-01-25

  • client: remove timeout callback [Tomás Migone]

1.0.1 - 2022-01-20

  • meta: fix workflows and readme typos [Tomás Migone]

1.0.0 - 2022-01-20

  • docs: add typedoc generated documentation site [Tomás Migone]
  • tests: add more tests [Tomás Migone]
  • tests: add missing unloadModule tests [Tomás Migone]
  • workflows: fix coverage action [Tomás Migone]
  • docs: add basic readme, add code coverage boilerplate [Tomás Migone]
  • Rename PAClient to PulseAudio [Tomás Migone]
  • Fix channelMap and channelVolume bug [Tomás Migone]
  • Fix ci [Tomás Migone]
  • lint: add lint tooling [Tomás Migone]
  • test: separate unit from e2e, fix ci [Tomás Migone]
  • e2e: add first basic test [Tomás Migone]
  • source-output: add commands and tests [Tomás Migone]
  • source: add source commands and tests [Tomás Migone]
  • command: add module commands [Tomás Migone]
  • paprop: fix bug where property list were parsed incorrectly [Tomás Migone]
  • commands: add server commands with tests [Tomás Migone]
  • command: refactor client commands, add tests [Tomás Migone]
  • command: add sinkInput commands and tests [Tomás Migone]
  • sink: rename getSinks to getSinkList to follow PA naming scheme [Tomás Migone]
  • docs: add testing readme [Tomás Migone]
  • tests: refactor testing framework, add sink tests [Tomás Migone]
  • command: refactor sink commands [Tomás Migone]
  • Multiple changes: - refactor e2e test boilerplate - add iterator - fix sink commands [Tomás Migone]
  • client: init implementation of protocol versions with sink command rework [Tomás Migone]
  • tests: add setup for e2e tests and setup instructions [Tomás Migone]
  • client: bump client protocol version to v35 (pa v15) [Tomás Migone]
  • client: add disconnect method [Tomás Migone]

0.1.12 - 2020-12-24

  • meta: fix deploy workflow [Tomás Migone]
  • meta: use admin token for workflows [Tomás Migone]
  • test [Tomás Migone]

0.1.11 - 2020-12-24

  • meta: fix deploy workflow [Tomás Migone]
  • meta: use admin token for workflows [Tomás Migone]
  • test [Tomás Migone]
  • meta: fix deploy workflow [Tomás Migone]
  • meta: test actions [Tomás Migone]
  • meta: fix deploy workflow [Tomás Migone]
  • meta: add nodejs 10.x test to CI [Tomás Migone]
  • meta: refactor GitHub CI/CD workflows [Tomás Migone]

0.1.10 - 2020-12-20

  • Remove VERSION file [Tomás Migone]
  • versionist: update repo.yml type [Tomás Migone]

v0.1.9

(2020-12-20)

  • meta: fix versionist action [Tomás Migone]
  • meta: Update CD action [Tomás Migone]

v0.1.8

(2020-08-18)

  • client: Make connect public [Tomás Migone]

v0.1.7

(2020-08-17)

  • client: add moveSinkInput and getSinkInputs commands [Tomás Migone]

v0.1.6

(2020-08-12)

  • Allow auth without cookie [Tomás Migone]

v0.1.5

(2020-08-10)

  • Add u8 tag [Tomás Migone]

v0.1.4

(2020-08-07)

  • Fix PAPacket bug that resulted in lost events [Tomás Migone]

v0.1.3

(2020-08-07)

  • Fix Format tag [Tomás Migone]

v0.1.2

(2020-07-03)

  • lib: remove lib test [Tomás Migone]

v0.1.1

(2020-07-03)

  • export types through index [Tomás Migone]

v0.1.0

(2020-07-03)

  • types: rework outward pulseaudio types [Tomás Migone]

v0.0.12

(2020-07-01)

  • Changes: [Tomás Migone]

v0.0.11

(2020-07-01)

  • changes: [Tomás Migone]

v0.0.10

(2020-06-30)

  • commands: getSinks allow multiple sinks returned [Tomás Migone]
  • proplist: fix bug where empty strings on proplist broke tag parsing [Tomás Migone]

v0.0.9

(2020-06-26)

  • npm: publish all files in build/ [Tomás Migone]

v0.0.8

(2020-06-26)

  • meta: rework npm scripts [Tomás Migone]

v0.0.7

(2020-06-26)

  • npm: require node 12.4.x [Tomás Migone]

v0.0.6

(2020-06-26)

  • Test [Tomás Migone]

v0.0.5

(2020-06-26)

  • Test [Tomás Migone]

v0.0.4

(2020-06-26)

  • Test [Tomás Migone]

v0.0.3

(2020-06-26)

  • meta: Replace prepublish script with prepare [Tomás Migone]

v0.0.2

(2020-06-26)

  • meta: add versionist [Tomás Migone]
  • meta: update test command [Tomás Migone]