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-audioVerified import paths — ran on the pinned version, not inferred.
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.
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.
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.
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.
Run `npm install node-red-contrib-play-audio` in your Node-RED user directory (typically `~/.node-red`). Restart Node-RED after installation.
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.
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`).
No dependency data recorded yet.