# Play Sound from USB Microphone

**URL:** https://discourse.nodered.org/t/play-sound-from-usb-microphone/2551
**Category:** Dashboard
**Created:** [25 August 2018 09:25 UTC](https://discourse.nodered.org/t/play-sound-from-usb-microphone/2551 "2018-08-25T09:25:09Z")
**Posts on this page:** 20
**Page:** 1

<div class="post-metadata">

### Author: ![GChapo](https://avatars.discourse-cdn.com/v4/letter/g/2acd7d/32.png) [@GChapo](https://discourse.nodered.org/u/GChapo)
#### Post date: [25 August 2018 09:25 UTC](https://discourse.nodered.org/t/play-sound-from-usb-microphone/2551/1 "2018-08-25T09:25:09Z")

</div>

Hello,

Can anybody tell me if it's possible to play the sound received from a USB microphone attached to a Raspberry PI and play it through the Dashboard UI? I have tried several microphone and play sound node combinations, where .wav files are recorded and replayed but no sound has been received?

Thanks in advance

Glenn

---

<div class="post-metadata">

### Author: ![Colin](https://sea2.discourse-cdn.com/flex026/user_avatar/discourse.nodered.org/colin/32/17040_2.png) [@Colin](https://discourse.nodered.org/u/Colin)
#### Post date: [25 August 2018 10:10 UTC](https://discourse.nodered.org/t/play-sound-from-usb-microphone/2551/2 "2018-08-25T10:10:24Z")

</div>

Is it the recording or replaying that is not working?

---

<div class="post-metadata">

### Author: ![GChapo](https://avatars.discourse-cdn.com/v4/letter/g/2acd7d/32.png) [@GChapo](https://discourse.nodered.org/u/GChapo)
#### Post date: [25 August 2018 10:24 UTC](https://discourse.nodered.org/t/play-sound-from-usb-microphone/2551/3 "2018-08-25T10:24:10Z")

</div>

![image](https://us1.discourse-cdn.com/flex026/uploads/nodered/original/2X/d/d2ed59906b03edb01fb5bb88138de8bb8aa6830c.png)

Hi Colin,

All seems to be working, but the bit I'm confused about is how to deliver the sound through to Dashboard. I have put a template on to try and deliver to my intended endpoint group.

Thanks

Glenn

---

<div class="post-metadata">

### Author: ![zenofmud](https://sea2.discourse-cdn.com/flex026/user_avatar/discourse.nodered.org/zenofmud/32/316_2.png) [@zenofmud](https://discourse.nodered.org/u/zenofmud)
#### Post date: [25 August 2018 10:35 UTC](https://discourse.nodered.org/t/play-sound-from-usb-microphone/2551/4 "2018-08-25T10:35:52Z")

</div>

Are you connecting to NR using a browser on the Pi or on another machine?  
What node are you using to play the audio?  
What version of NR?  
What version of Node.js?  
What browser?

---

<div class="post-metadata">

### Author: ![dceejay](https://sea2.discourse-cdn.com/flex026/user_avatar/discourse.nodered.org/dceejay/32/38_2.png) [@dceejay](https://discourse.nodered.org/u/dceejay)
#### Post date: [25 August 2018 10:48 UTC](https://discourse.nodered.org/t/play-sound-from-usb-microphone/2551/5 "2018-08-25T10:48:07Z")

</div>

The dashboard has an audio out node.... why not feed the wav (as a buffer) to that.

---

<div class="post-metadata">

### Author: ![GChapo](https://avatars.discourse-cdn.com/v4/letter/g/2acd7d/32.png) [@GChapo](https://discourse.nodered.org/u/GChapo)
#### Post date: [25 August 2018 11:40 UTC](https://discourse.nodered.org/t/play-sound-from-usb-microphone/2551/6 "2018-08-25T11:40:29Z")

</div>

NR connecting as a browser (chrome) from phone  
Play\_Audio\_File  
NR Version/node.js 8.11.4

---

<div class="post-metadata">

### Author: ![GChapo](https://avatars.discourse-cdn.com/v4/letter/g/2acd7d/32.png) [@GChapo](https://discourse.nodered.org/u/GChapo)
#### Post date: [25 August 2018 11:41 UTC](https://discourse.nodered.org/t/play-sound-from-usb-microphone/2551/7 "2018-08-25T11:41:15Z")

</div>

Thanks for coming back to me,

which node is this please?  
The wav file buffer node I have has no output node

---

<div class="post-metadata">

### Author: ![Colin](https://sea2.discourse-cdn.com/flex026/user_avatar/discourse.nodered.org/colin/32/17040_2.png) [@Colin](https://discourse.nodered.org/u/Colin)
#### Post date: [25 August 2018 12:23 UTC](https://discourse.nodered.org/t/play-sound-from-usb-microphone/2551/8 "2018-08-25T12:23:06Z")

</div>

In the nodes panel scroll down to the Dashboard nodes and there you should see Audio Out.

---

<div class="post-metadata">

### Author: ![GChapo](https://avatars.discourse-cdn.com/v4/letter/g/2acd7d/32.png) [@GChapo](https://discourse.nodered.org/u/GChapo)
#### Post date: [25 August 2018 12:32 UTC](https://discourse.nodered.org/t/play-sound-from-usb-microphone/2551/9 "2018-08-25T12:32:52Z")

</div>

Is that node more for text to speech?

---

<div class="post-metadata">

### Author: ![Colin](https://sea2.discourse-cdn.com/flex026/user_avatar/discourse.nodered.org/colin/32/17040_2.png) [@Colin](https://discourse.nodered.org/u/Colin)
#### Post date: [25 August 2018 12:42 UTC](https://discourse.nodered.org/t/play-sound-from-usb-microphone/2551/10 "2018-08-25T12:42:42Z")

</div>

> [@GChapo](#):
>
> Is that node more for text to speech?

Either, as it says in the info panel.

---

<div class="post-metadata">

### Author: ![GChapo](https://avatars.discourse-cdn.com/v4/letter/g/2acd7d/32.png) [@GChapo](https://discourse.nodered.org/u/GChapo)
#### Post date: [25 August 2018 13:03 UTC](https://discourse.nodered.org/t/play-sound-from-usb-microphone/2551/11 "2018-08-25T13:03:28Z")

</div>

![image](https://us1.discourse-cdn.com/flex026/uploads/nodered/original/2X/8/84f753063904775d461fac92f331f676b9d364b6.png)

Thanks Colin,

Still no joy though. Nodes are as above. I am a little confused as to how the usb port for the microphone is assigned as the first node doesn't seem to require this information and I am getting no sound out when I go from my phone to the assigned group.

Glenn

---

<div class="post-metadata">

### Author: ![Colin](https://sea2.discourse-cdn.com/flex026/user_avatar/discourse.nodered.org/colin/32/17040_2.png) [@Colin](https://discourse.nodered.org/u/Colin)
#### Post date: [25 August 2018 13:47 UTC](https://discourse.nodered.org/t/play-sound-from-usb-microphone/2551/12 "2018-08-25T13:47:06Z")

</div>

You indicated previously that you were getting the wav file ok.

---

<div class="post-metadata">

### Author: ![Colin](https://sea2.discourse-cdn.com/flex026/user_avatar/discourse.nodered.org/colin/32/17040_2.png) [@Colin](https://discourse.nodered.org/u/Colin)
#### Post date: [25 August 2018 13:49 UTC](https://discourse.nodered.org/t/play-sound-from-usb-microphone/2551/13 "2018-08-25T13:49:31Z")

</div>

If not then which node are you using for the microphone (node-red-contrib-something)?

---

<div class="post-metadata">

### Author: ![GChapo](https://avatars.discourse-cdn.com/v4/letter/g/2acd7d/32.png) [@GChapo](https://discourse.nodered.org/u/GChapo)
#### Post date: [25 August 2018 14:04 UTC](https://discourse.nodered.org/t/play-sound-from-usb-microphone/2551/14 "2018-08-25T14:04:28Z")

</div>

Hi Colin,

node-red-contrib-micropi

I used their example flow and on the "micropi" node, if I browse to the [http://localhost:1880/getAudio](http://localhost:1880/getAudio) url it will immediately download a wav file which I have played on my windows pc using VLC. So I assume the deom.wav file is working ok. However, I want it to buffer the sound through the dashboard ui.

Hope that makes sense.

Glenn

---

<div class="post-metadata">

### Author: ![dceejay](https://sea2.discourse-cdn.com/flex026/user_avatar/discourse.nodered.org/dceejay/32/38_2.png) [@dceejay](https://discourse.nodered.org/u/dceejay)
#### Post date: [25 August 2018 14:51 UTC](https://discourse.nodered.org/t/play-sound-from-usb-microphone/2551/15 "2018-08-25T14:51:28Z")

</div>

If it's already giving you a wav file in a buffer then feeding it direct to the audio out node should work

 ![image](https://us1.discourse-cdn.com/flex026/uploads/nodered/original/2X/1/1415eb793adb136dd3950d04f1f40faa8311ace6.png)

---

<div class="post-metadata">

### Author: ![GChapo](https://avatars.discourse-cdn.com/v4/letter/g/2acd7d/32.png) [@GChapo](https://discourse.nodered.org/u/GChapo)
#### Post date: [25 August 2018 15:03 UTC](https://discourse.nodered.org/t/play-sound-from-usb-microphone/2551/16 "2018-08-25T15:03:26Z")

</div>

Hi dceejay,

I don't recognise your middle node.

Are you able to export the clipboard and tell me the node please?

Glen

---

<div class="post-metadata">

### Author: ![dceejay](https://sea2.discourse-cdn.com/flex026/user_avatar/discourse.nodered.org/dceejay/32/38_2.png) [@dceejay](https://discourse.nodered.org/u/dceejay)
#### Post date: [25 August 2018 15:11 UTC](https://discourse.nodered.org/t/play-sound-from-usb-microphone/2551/17 "2018-08-25T15:11:58Z")

</div>

Thats just a file in node (from Node-RED v 0.19) to read a test wav file I had on my pc - set to output contents as a single buffer. You may not need it if you are already getting a wav buffer direct from the mic

---

<div class="post-metadata">

### Author: ![GChapo](https://avatars.discourse-cdn.com/v4/letter/g/2acd7d/32.png) [@GChapo](https://discourse.nodered.org/u/GChapo)
#### Post date: [25 August 2018 15:46 UTC](https://discourse.nodered.org/t/play-sound-from-usb-microphone/2551/18 "2018-08-25T15:46:21Z")

</div>

Ok, looks different on your node red version. Set up as stated and I get no sound what-so-ever. I've tried the absolute path - home/pi/audio/demo.wav and audio/demo.wav to no avail. I've looked at the demo.wav file and it hasn't been updated for sometime.

---

<div class="post-metadata">

### Author: ![dceejay](https://sea2.discourse-cdn.com/flex026/user_avatar/discourse.nodered.org/dceejay/32/38_2.png) [@dceejay](https://discourse.nodered.org/u/dceejay)
#### Post date: [25 August 2018 15:55 UTC](https://discourse.nodered.org/t/play-sound-from-usb-microphone/2551/19 "2018-08-25T15:55:14Z")

</div>

path must start with / to be absolute so `/home/pi/audio/demo.wav` etc

---

<div class="post-metadata">

### Author: ![GChapo](https://avatars.discourse-cdn.com/v4/letter/g/2acd7d/32.png) [@GChapo](https://discourse.nodered.org/u/GChapo)
#### Post date: [25 August 2018 16:21 UTC](https://discourse.nodered.org/t/play-sound-from-usb-microphone/2551/20 "2018-08-25T16:21:09Z")

</div>

sorry, that is how I have it.

Still confused by how the node picks up which USB the microphone is attached to?

[Next page](https://discourse.nodered.org/t/play-sound-from-usb-microphone/2551.md?page=2)
