# @tmigone/pulseaudio

> A TypeScript based client library for PulseAudio.

Latest version **1.0.5** (published 2022-08-25) · MIT license · 0 weekly downloads

## Install

```sh
npm install @tmigone/pulseaudio
pnpm add @tmigone/pulseaudio
yarn add @tmigone/pulseaudio
bun add @tmigone/pulseaudio
```

## Health

**Score 25/100 (F)** — status: abandoned.

Positive: has types; no vulnerabilities; high quality score.

Warnings: low downloads; no esm support.

Negative: abandoned; low maintenance score.

## Facts

| | |
|---|---|
| Version | 1.0.5 |
| Published | 2022-08-25 |
| First published | 2020-06-26 |
| Weekly downloads | 0 |
| License | MIT |
| TypeScript types | bundled |
| Module format | CommonJS |
| Node | >=10.0.0 <17.0.0 |
| Dependencies | 0 |
| Unpacked size | 194.9 KB |
| Known vulnerabilities | 0 |
| Install scripts | no |
| GitHub stars | 18 |
| Author | Tomás Migone |
| Maintainers | tmigone |
| Keywords | pulseaudio, pulse, audio, paclient, palib, client |

## Links

- npm: https://www.npmjs.com/package/@tmigone/pulseaudio
- Repository: https://github.com/tmigone/pulseaudio
- Homepage: https://github.com/tmigone/pulseaudio#readme
- Issues: https://github.com/tmigone/pulseaudio/issues
- npm.io page: https://npm.io/package/@tmigone/pulseaudio

## Alternatives

- [launchdarkly-js-client-sdk](https://npm.io/package/launchdarkly-js-client-sdk.md) — 2.5M weekly downloads
- [@elastic/elasticsearch](https://npm.io/package/@elastic/elasticsearch.md) — 2.1M weekly downloads
- [@c8y/client](https://npm.io/package/@c8y/client.md) — 15.3K weekly downloads
- [@signaldb/maverickjs](https://npm.io/package/@signaldb/maverickjs.md) — 1.7K weekly downloads
- [@bbc/http-transport-cache](https://npm.io/package/@bbc/http-transport-cache.md) — 1.2K weekly downloads

## Recent versions

- 1.0.5 (latest) — 2022-08-25
- 1.0.4 — 2022-01-26
- 1.0.3 — 2022-01-26
- 1.0.2 — 2022-01-25
- 1.0.1 — 2022-01-20
- 1.0.0 — 2022-01-20
- 0.1.12 — 2020-12-24
- 0.1.11 — 2020-12-24
- 0.1.10 — 2020-12-20
- 0.1.8 — 2020-08-18
- 0.1.7 — 2020-08-17
- 0.1.6 — 2020-08-12
- 0.1.5 — 2020-08-10
- 0.1.4 — 2020-08-07
- 0.1.3 — 2020-08-07
- … 8 more at https://npm.io/package/@tmigone/pulseaudio/versions

## README

# 🎶 @tmigone/pulseaudio 🎶
 ![NPM](https://img.shields.io/npm/v/@tmigone/pulseaudio.svg?logo=npm&logoColor=fff&label=NPM+package&color=limegreen&link=https://www.npmjs.com/package/@tmigone/pulseaudio) ![CI](https://github.com/tmigone/pulseaudio/workflows/ci/badge.svg) [![Coverage Status](https://coveralls.io/repos/github/tmigone/pulseaudio/badge.svg?branch=refactor)](https://coveralls.io/github/tmigone/pulseaudio?branch=refactor)

`@tmigone/pulseaudio` is a TypeScript based client library for [PulseAudio](https://www.freedesktop.org/wiki/Software/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](https://www.npmjs.com/):
```bash
npm install @tmigone/pulseaudio
```

## Usage

```ts
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](http://pulseaudio.tmigone.com) for in depth documentation on the library API's.

---
_Source: https://npm.io/package/@tmigone/pulseaudio · Machine-readable twin of the npm.io package page. Health data is recomputed on every publish._
