Registry / web-framework / node-red-contrib-play-audio

node-red-contrib-play-audio

JSON →
library2.5.0jsnpmunverified

The node-red-contrib-play-audio package (current stable version 2.5.0) provides a Node-RED node designed for playing audio directly within the client-side browser context where the Node-RED dashboard or editor is viewed. It specifically leverages the Web Audio API to play raw audio buffers, making it suitable for integrations with other nodes that output audio data, such as Text-to-Speech (TTS) services (e.g., the Watson Text to Speech node). Additionally, it offers basic browser-native Text-to-Speech capabilities for simple string inputs, provided the browser supports this feature. This node is a key component for adding client-side audio feedback or announcements to Node-RED applications, operating exclusively in the browser environment rather than on the Node.js server. Its release cadence follows contributions and updates to Node-RED compatibility.

npm install node-red-contrib-play-audio
INSTALL
IMPORT
SIG · NODE-RED-CONTRIB-P
N
node-red-contrib-play-audio
web-frameworkjavascriptv2.5.0
Install
Import
Disk
Pass rate
0/ 6
Env Coverage0 / 6
glibc
1822
musl
1822
Install & Compatibility
Where this runs
tested against v? · npm install
Install × environment matrix
Each cell = how many times install + import succeeded across repeated harness runs. Partial = flaky.
glibc = Debian/Ubuntu slim · musl = Alpine Linux
musl
node 18226 runs
build_error
glibc
node 18226 runs
build_error
Code
Verified usage

Verified import paths — ran on the pinned version, not inferred.

node-red-contrib-play-audio
npm install node-red-contrib-play-audio
import { PlayAudioNode } from 'node-red-contrib-play-audio'
Node-RED nodes are installed via npm into the Node-RED user directory, typically `~/.node-red`, not imported directly into application code. Once installed, the 'Play Audio' node appears in the Node-RED editor palette.

This flow demonstrates installing the node and a basic Text-to-Speech (TTS) example. Install the node via `npm install node-red-contrib-play-audio` in your Node-RED user directory (`~/.node-red`). Then, import this JSON flow, deploy it, and click the 'Trigger TTS' inject node to hear 'Hello from Node-RED!' spoken in your browser.

[ { "id": "a1b2c3d4e5f6g7h8", "type": "inject", "z": "z9y8x7w6v5u4t3s2", "name": "Trigger TTS", "props": [ { "p": "payload", "v": "Hello from Node-RED!", "vt": "str" }, { "p": "topic", "vt": "msg" } ], "repeat": "", "crontab": "", "once": true, "onceDelay": 0.1, "topic": "", "x": 140, "y": 100, "wires": [ [ "h1g2f3e4d5c6b7a8" ] ] }, { "id": "h1g2f3e4d5c6b7a8", "type": "play-audio", "z": "z9y8x7w6v5u4t3s2", "name": "Play Audio", "voice": "default", "lang": "en-US", "x": 340, "y": 100, "wires": [] } ]
Debug
Known issues
gotchaThis node performs audio playback exclusively in the client-side browser where the Node-RED editor or dashboard is accessed. It does not play audio on the Node.js server.
fix
Ensure the browser tab running Node-RED is open and has focus for audio to play. For server-side audio, a different Node-RED node designed for server OS audio playback is required.
affects: >=1.0.0
gotchaPlayback relies on the Web Audio API, which may have browser compatibility differences or security restrictions, especially regarding autoplay.
fix
Users may need to interact with the browser page (e.g., click a button) before audio can autoplay due to browser policies. Check browser console for Web Audio API related errors or warnings.
affects: >=1.0.0
gotchaWhen using the Text-to-Speech (TTS) feature, voice quality and availability are dependent on the client browser's native speech synthesis capabilities, which vary significantly across browsers and operating systems.
fix
Test TTS output across target browsers. For consistent high-quality speech, consider using an external TTS API service (like IBM Watson, Google Cloud TTS, etc.) that outputs raw audio, and then feed that buffer into this node.
affects: >=1.0.0
Errors
Common errors & fixes
Error: Cannot find module 'node-red-contrib-play-audio'
The Node-RED node package was not installed correctly or in the correct directory for Node-RED to discover it.
fix
Run `npm install node-red-contrib-play-audio` in your Node-RED user directory (typically `~/.node-red`). Restart Node-RED after installation.
Audio not playing in browser / 'Play Audio' node appears green but no sound
Browser autoplay policies are blocking the audio, or the browser does not support the Web Audio API, or the browser tab is not active.
fix
Interact with the browser page (e.g., click an inject button) to satisfy autoplay policies. Ensure your browser is up-to-date and supports the Web Audio API. Keep the Node-RED tab active.
'Play Audio' node missing from palette after installation.
Node-RED was not restarted, or the installation occurred in a different directory than Node-RED's active user directory.
fix
Ensure Node-RED is restarted after `npm install`. Verify you installed the package in the directory where your Node-RED instance is configured to look for nodes (often `~/.node-red`).
Upgrade
Version history
2.5.0latest on npm
Audit
Dependencies

No dependency data recorded yet.

Agent activity
2 hits · last 30 days
node
2
Resources
node-red-contrib-play-audio — npm install node-red-contrib-play-audio · libregistry