# Playing a .mp3 flie

**URL:** <https://discourse.nodered.org/t/playing-a-mp3-flie/18030>\
**Category:** General\
**Created:** [16 November 2019 07:25 UTC](https://discourse.nodered.org/t/playing-a-mp3-flie/18030 "2019-11-16T07:25:57Z")\
**Posts on this page:** 20\
**Page:** 1

<div class="post-metadata">

**Author:** ![Trying\_to\_learn](https://sea2.discourse-cdn.com/flex026/user_avatar/discourse.nodered.org/trying_to_learn/32/28400_2.png) [@Trying\_to\_learn](https://discourse.nodered.org/u/Trying_to_learn)\
**Post date:** [16 November 2019 07:25 UTC](https://discourse.nodered.org/t/playing-a-mp3-flie/18030/1 "2019-11-16T07:25:57Z")

</div>

I've read a few posts about playing MP3 files and that browsers are blocking sounds.

Taking that on, I decided to try another way but still to no avail.

Ubuntu.  
NR 0.20.5

Putting aside the nodes to play sounds, I decided to do it _old school_ and opened a shell and entered the command:  
`play (path to MP3 file)`  
and it plays/I hear the sound.

So, if I put it in a flow:

```auto
[{"id":"badf7b6a.fcb05","type":"exec","z":"9245b569.9f881","command":"play /home/me/Music/DontTouchTheButton.mp3","addpay":false,"append":"","useSpawn":"false","timer":"","oldrc":false,"name":"","x":660,"y":2310,"wires":[[],[],[]]},{"id":"95671573.d5767","type":"inject","z":"9245b569.9f881","name":"","topic":"","payload":"/home/me/Music/DontTouchTheButton.mp3","payloadType":"str","repeat":"","crontab":"","once":false,"onceDelay":0.1,"x":210,"y":2310,"wires":[["badf7b6a.fcb05"]]}]

```

Press the button and nothing is heard.

Why?

This way would/should get around the browser blocking sounds being played, and if I do it from a terminal, it works.

---

<div class="post-metadata">

**Author:** ![bakman2](https://sea2.discourse-cdn.com/flex026/user_avatar/discourse.nodered.org/bakman2/32/6207_2.png) [@bakman2](https://discourse.nodered.org/u/bakman2)\
**Post date:** [16 November 2019 07:37 UTC](https://discourse.nodered.org/t/playing-a-mp3-flie/18030/2 "2019-11-16T07:37:40Z")

</div>

I would start by using the full path of the play command.  
On commandline enter `which play` and use that path in the exec node.

Then comes the question, does node-red have permission to execute `play` and does it have permission to use the audio device.

---

<div class="post-metadata">

**Author:** ![Trying\_to\_learn](https://sea2.discourse-cdn.com/flex026/user_avatar/discourse.nodered.org/trying_to_learn/32/28400_2.png) [@Trying\_to\_learn](https://discourse.nodered.org/u/Trying_to_learn)\
**Post date:** [16 November 2019 07:53 UTC](https://discourse.nodered.org/t/playing-a-mp3-flie/18030/3 "2019-11-16T07:53:41Z")

</div>

> [@bakman2](#):
>
> Then comes the question, does node-red have permission to execute `play` and does it have permission to use the audio device.

Thanks.

`which play`  
yields  
`/usr/bin/play`

So I modified the command.

Still nothing.

How do I find out if NR has permission, etc?

---

<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:** [16 November 2019 08:01 UTC](https://discourse.nodered.org/t/playing-a-mp3-flie/18030/4 "2019-11-16T08:01:38Z")

</div>

Just checking that you realise that would play it on the device running node-red, not on the machine running the browser, if they are different.

---

<div class="post-metadata">

**Author:** ![Trying\_to\_learn](https://sea2.discourse-cdn.com/flex026/user_avatar/discourse.nodered.org/trying_to_learn/32/28400_2.png) [@Trying\_to\_learn](https://discourse.nodered.org/u/Trying_to_learn)\
**Post date:** [16 November 2019 08:10 UTC](https://discourse.nodered.org/t/playing-a-mp3-flie/18030/5 "2019-11-16T08:10:46Z")

</div>

They are one in the same.

Sorry. Mind is all over the place.

For the sake of getting something working I am just wanting to get NR to play a sound file on this machine when I press a button on NR on this machine.

When I get that working, I can expand what is happening.  
Any remote triggering would all be on this machine. So I think I have got around the problem of "which machine" is being used.

---

<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:** [16 November 2019 08:30 UTC](https://discourse.nodered.org/t/playing-a-mp3-flie/18030/6 "2019-11-16T08:30:56Z")

</div>

Do you get an error from the exec node (check all the outputs of the node to see what it says).

---

<div class="post-metadata">

**Author:** ![Trying\_to\_learn](https://sea2.discourse-cdn.com/flex026/user_avatar/discourse.nodered.org/trying_to_learn/32/28400_2.png) [@Trying\_to\_learn](https://discourse.nodered.org/u/Trying_to_learn)\
**Post date:** [16 November 2019 08:35 UTC](https://discourse.nodered.org/t/playing-a-mp3-flie/18030/7 "2019-11-16T08:35:09Z")

</div>

Stupid me forgot to add debug nodes on the output of the `exe` node.

Did it.

All looks good, but this is what I see:

```auto
/home/me/Music/DontTouchTheButton.mp3: File Size: 36.2k Bit Rate: 173k Encoding: MPEG audio Channels: 2 @ 16-bit Samplerate: 44100Hz Replaygain: off Duration: 00:00:01.67 In:0.00% 00:00:00.00 [00:00:01.67] Out:0 [|] Clip:0 In:11.1% 00:00:00.19 [00:00:01.49] Out:8.19k [====|====] Clip:0 In:22.2% 00:00:00.37 [00:00:01.30] Out:16.4k [====|====] Clip:0 In:27.8% 00:00:00.46 [00:00:01.21] Out:20.5k [-==|===] Clip:0 In:38.9% 00:00:00.65 [00:00:01.02] Out:28.7k [====|====] Clip:0 In:44.5% 00:00:00.74 [00:00:00.93] Out:32.8k [====|====] Clip:0 In:55.6% 00:00:00.93 [00:00:00.74] Out:41.0k [====|====] Clip:0 In:61.1% 00:00:01.02 [00:00:00.65] Out:45.1k [-==|==] Clip:0 In:72.3% 00:00:01.21 [00:00:00.46] Out:53.2k [====|====] Clip:0 In:77.8% 00:00:01.30 [00:00:00.37] Out:57.3k [====|====] Clip:0 ...

```

(oh, that is from the `error` output. But it doesn't say what the error is.

Fair enough.

But no sound.

From the CLI I get:

```auto
me@me-desktop:~/Music$ play DontTouchTheButton.mp3 

DontTouchTheButton.mp3:

 File Size: 36.2k Bit Rate: 173k
  Encoding: MPEG audio    
  Channels: 2 @ 16-bit   
Samplerate: 44100Hz      
Replaygain: off         
  Duration: 00:00:01.67  

In:100% 00:00:01.67 [00:00:00.00] Out:73.7k [|] Clip:0    
Done.
me@me-desktop:~/Music$ 

```

And I hear the sound.

---

<div class="post-metadata">

**Author:** ![bakman2](https://sea2.discourse-cdn.com/flex026/user_avatar/discourse.nodered.org/bakman2/32/6207_2.png) [@bakman2](https://discourse.nodered.org/u/bakman2)\
**Post date:** [16 November 2019 08:56 UTC](https://discourse.nodered.org/t/playing-a-mp3-flie/18030/8 "2019-11-16T08:56:03Z")

</div>

I suspect you need to specify the audio out device and/or node-red does not have access to it.  
should be in /dev/audio or /dev/dsp or something similar. Look for the permissions on the relevant file.

---

<div class="post-metadata">

**Author:** ![Trying\_to\_learn](https://sea2.discourse-cdn.com/flex026/user_avatar/discourse.nodered.org/trying_to_learn/32/28400_2.png) [@Trying\_to\_learn](https://discourse.nodered.org/u/Trying_to_learn)\
**Post date:** [16 November 2019 08:58 UTC](https://discourse.nodered.org/t/playing-a-mp3-flie/18030/9 "2019-11-16T08:58:52Z")

</div>

Sorry @bakman2, I am not understanding.

The file (sample) is in /home/me/Music/......

`play` in in `usr/bin/play`

> [@bakman2](#):
>
> Look for the permissions on the relevant file.

Sorry, but which _relevant_ file?

Seems I have a big dose of blonde lately.

---

<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:** [16 November 2019 10:22 UTC](https://discourse.nodered.org/t/playing-a-mp3-flie/18030/10 "2019-11-16T10:22:24Z")

</div>

back to basics. I see from your first post NR v0.20.5 but

1. what version of node.js
2. what type of machine?
3. what OS is it running
4. what does  
`ls -al usr/bin/play`  
show?
5. what does  
`ls -al /home/me/Music/DontTouchTheButton.mp3`  
show

---

<div class="post-metadata">

**Author:** ![Trying\_to\_learn](https://sea2.discourse-cdn.com/flex026/user_avatar/discourse.nodered.org/trying_to_learn/32/28400_2.png) [@Trying\_to\_learn](https://discourse.nodered.org/u/Trying_to_learn)\
**Post date:** [16 November 2019 10:29 UTC](https://discourse.nodered.org/t/playing-a-mp3-flie/18030/11 "2019-11-16T10:29:56Z")

</div>

```auto
me@me-desktop:~/Music$ node -v
v8.16.2
me@me-desktop:~/Music$ 

```

NUC I7

Ubuntu 18.04 LTS

(I think this is where the problem is)

```auto
me@me-desktop:~/Music$ ls -al /usr/bin/play
lrwxrwxrwx 1 root root 3 Aug 2 01:27 /usr/bin/play -> sox
me@me-desktop:~/Music$ 

```

(you missed the leading `/` from the path. No problems)

```auto
me@me-desktop:~/Music$ ls -al /home/me/Music/DontTouchTheButton.mp3
-rw-rw-r-- 1 me me 36211 Nov 16 18:02 /home/me/Music/DontTouchTheButton.mp3
me@me-desktop:~/Music$ 

```

I tried it with `sox` in the CLI and it is worse. It is expecting other inputs.

(For help/clarity)

This is what happens:

```auto
me@me-desktop:~/Music$ ls -al /usr/bin/play
lrwxrwxrwx 1 root root 3 Aug 2 01:27 /usr/bin/play -> sox
me@me-desktop:~/Music$ play DontTouchTheButton.mp3 

DontTouchTheButton.mp3:

 File Size: 36.2k Bit Rate: 173k
  Encoding: MPEG audio    
  Channels: 2 @ 16-bit   
Samplerate: 44100Hz      
Replaygain: off         
  Duration: 00:00:01.67  

In:100% 00:00:01.67 [00:00:00.00] Out:73.7k [|] Clip:0    
Done.
me@me-desktop:~/Music$ sox DontTouchTheButton.mp3 
sox: SoX v14.4.2

sox FAIL sox: Not enough input filenames specified

Usage summary: [gopts] [[fopts] infile]... [fopts] outfile [effect [effopt]]...

SPECIAL FILENAMES (infile, outfile):
- Pipe/redirect input/output (stdin/stdout); may need -t
-d, --default-device Use the default audio device (where available)
-n, --null Use the `null' file handler; e.g. with synth effect
-p, --sox-pipe Alias for `-t sox -'

SPECIAL FILENAMES (infile only):
"|program [options] ..." Pipe input from external program (where supported)
http://server/file Use the given URL as input file (where supported)

GLOBAL OPTIONS (gopts) (can be specified at any point before the first effect):
--buffer BYTES Set the size of all processing buffers (default 8192)
--clobber Don't prompt to overwrite output file (default)
--combine concatenate Concatenate all input files (default for sox, rec)
--combine sequence Sequence all input files (default for play)
-D, --no-dither Don't dither automatically
--dft-min NUM Minimum size (log2) for DFT processing (default 10)
--effects-file FILENAME File containing effects and options
-G, --guard Use temporary files to guard against clipping
-h, --help Display version number and usage information
--help-effect NAME Show usage of effect NAME, or NAME=all for all
--help-format NAME Show info on format NAME, or NAME=all for all
--i, --info Behave as soxi(1)
--input-buffer BYTES Override the input buffer size (default: as --buffer)
--no-clobber Prompt to overwrite output file
-m, --combine mix Mix multiple input files (instead of concatenating)
--combine mix-power Mix to equal power (instead of concatenating)
-M, --combine merge Merge multiple input files (instead of concatenating)
--magic Use `magic' file-type detection
--multi-threaded Enable parallel effects channels processing
--norm Guard (see --guard) & normalise
--play-rate-arg ARG Default `rate' argument for auto-resample with `play'
--plot gnuplot|octave Generate script to plot response of filter effect
-q, --no-show-progress Run in quiet mode; opposite of -S
--replay-gain track|album|off Default: off (sox, rec), track (play)
-R Use default random numbers (same on each run of SoX)
-S, --show-progress Display progress while processing audio data
--single-threaded Disable parallel effects channels processing
--temp DIRECTORY Specify the directory to use for temporary files
-T, --combine multiply Multiply samples of corresponding channels from all
                         input files (instead of concatenating)
--version Display version number of SoX and exit
-V[LEVEL] Increment or set verbosity level (default 2); levels:
                           1: failure messages
                           2: warnings
                           3: details of processing
                           4-6: increasing levels of debug messages
FORMAT OPTIONS (fopts):
Input file format options need only be supplied for files that are headerless.
Output files will have the same format as the input file where possible and not
overridden by any of various means including providing output format options.

-v|--volume FACTOR Input file volume adjustment factor (real number)
--ignore-length Ignore input file length given in header; read to EOF
-t|--type FILETYPE File type of audio
-e|--encoding ENCODING Set encoding (ENCODING may be one of signed-integer,
                         unsigned-integer, floating-point, mu-law, a-law,
                         ima-adpcm, ms-adpcm, gsm-full-rate)
-b|--bits BITS Encoded sample size in bits
-N|--reverse-nibbles Encoded nibble-order
-X|--reverse-bits Encoded bit-order
--endian little|big|swap Encoded byte-order; swap means opposite to default
-L/-B/-x Short options for the above
-c|--channels CHANNELS Number of channels of audio data; e.g. 2 = stereo
-r|--rate RATE Sample rate of audio
-C|--compression FACTOR Compression factor for output format
--add-comment TEXT Append output file comment
--comment TEXT Specify comment text for the output file
--comment-file FILENAME File containing comment text for the output file
--no-glob Don't `glob' wildcard match the following filename

AUDIO FILE FORMATS: 8svx aif aifc aiff aiffc al amb amr-nb amr-wb anb au avr awb caf cdda cdr cvs cvsd cvu dat dvms f32 f4 f64 f8 fap flac fssd gsm gsrt hcom htk ima ircam la lpc lpc10 lu mat mat4 mat5 maud mp2 mp3 nist ogg paf prc pvf raw s1 s16 s2 s24 s3 s32 s4 s8 sb sd2 sds sf sl sln smp snd sndfile sndr sndt sou sox sph sw txw u1 u16 u2 u24 u3 u32 u4 u8 ub ul uw vms voc vorbis vox w64 wav wavpcm wv wve xa xi
PLAYLIST FORMATS: m3u pls
AUDIO DEVICE DRIVERS: alsa ao oss ossdsp pulseaudio

EFFECTS: allpass band bandpass bandreject bass bend biquad chorus channels compand contrast dcshift deemph delay dither divide+ downsample earwax echo echos equalizer fade fir firfit+ flanger gain highpass hilbert input# ladspa loudness lowpass mcompand noiseprof noisered norm oops output# overdrive pad phaser pitch rate remix repeat reverb reverse riaa silence sinc spectrogram speed splice stat stats stretch swap synth tempo treble tremolo trim upsample vad vol
  * Deprecated effect + Experimental effect # LibSoX-only effect
EFFECT OPTIONS (effopts): effect dependent; see --help-effect
me@me-desktop:~/Music$ 

```

---

<div class="post-metadata">

**Author:** ![bakman2](https://sea2.discourse-cdn.com/flex026/user_avatar/discourse.nodered.org/bakman2/32/6207_2.png) [@bakman2](https://discourse.nodered.org/u/bakman2)\
**Post date:** [16 November 2019 11:40 UTC](https://discourse.nodered.org/t/playing-a-mp3-flie/18030/12 "2019-11-16T11:40:51Z")

</div>

As said: in /dev

```auto
cd /dev
ls -l 

```

Look for a file `audio`, `alsa`, `dsp` - something that could resemble an audio driver.  
Then look for the permissions on those files.

If they are `crw------- 1 root root` - node-red cannot access them and you will need to modify the permissions.

---

<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:** [16 November 2019 12:32 UTC](https://discourse.nodered.org/t/playing-a-mp3-flie/18030/13 "2019-11-16T12:32:38Z")

</div>

Just for your info, I have been using node-red-contrib-play-sound quite successfully on a rpi for quite some time. I'll post the flow in `Share Your Projects` in a little bit.

---

<div class="post-metadata">

**Author:** ![Trying\_to\_learn](https://sea2.discourse-cdn.com/flex026/user_avatar/discourse.nodered.org/trying_to_learn/32/28400_2.png) [@Trying\_to\_learn](https://discourse.nodered.org/u/Trying_to_learn)\
**Post date:** [16 November 2019 21:53 UTC](https://discourse.nodered.org/t/playing-a-mp3-flie/18030/14 "2019-11-16T21:53:24Z")

</div>

@bakman2,

> [@bakman2](#):
>
> As said: in /dev

I missed that and can't find it in this thread.

Ok, sorry did find it.

> I suspect you need to specify the audio out device and/or node-red does not have access to it.  
> should be in /dev/audio or /dev/dsp or something similar. Look for the permissions on the  
> relevant file

But doing that I get this and there is no `audio`, `alas` or `dsp`.

However, I'm not sure I get it. If run from the CLI it works, so the required thing/s are in there somewhere.

```auto
me@me-desktop:~$ cd /dev
me@me-desktop:/dev$ ls -l
total 0
crw-r--r-- 1 root root 10, 235 Nov 17 08:45 autofs
drwxr-xr-x 2 root root 820 Nov 17 08:45 block
drwxr-xr-x 2 root root 80 Nov 17 08:45 bsg
crw------- 1 root root 10, 234 Nov 17 08:45 btrfs-control
drwxr-xr-x 3 root root 60 Nov 17 08:44 bus
lrwxrwxrwx 1 root root 3 Nov 17 08:45 cdrom -> sr0
lrwxrwxrwx 1 root root 3 Nov 17 08:45 cdrw -> sr0
drwxr-xr-x 2 root root 4300 Nov 17 08:46 char
crw------- 1 root root 5, 1 Nov 17 08:45 console
lrwxrwxrwx 1 root root 11 Nov 17 08:44 core -> /proc/kcore
drwxr-xr-x 2 root root 60 Nov 17 08:44 cpu
crw------- 1 root root 10, 59 Nov 17 08:45 cpu_dma_latency
crw------- 1 root root 10, 203 Nov 17 08:45 cuse
drwxr-xr-x 6 root root 120 Nov 17 08:45 disk
drwxr-xr-x 3 root root 100 Nov 17 08:45 dri
crw------- 1 root root 239, 0 Nov 17 08:45 drm_dp_aux0
crw------- 1 root root 239, 1 Nov 17 08:45 drm_dp_aux1
lrwxrwxrwx 1 root root 3 Nov 17 08:45 dvd -> sr0
crw------- 1 root root 10, 61 Nov 17 08:45 ecryptfs
crw-rw---- 1 root video 29, 0 Nov 17 08:45 fb0

```

---

<div class="post-metadata">

**Author:** ![Trying\_to\_learn](https://sea2.discourse-cdn.com/flex026/user_avatar/discourse.nodered.org/trying_to_learn/32/28400_2.png) [@Trying\_to\_learn](https://discourse.nodered.org/u/Trying_to_learn)\
**Post date:** [16 November 2019 21:54 UTC](https://discourse.nodered.org/t/playing-a-mp3-flie/18030/15 "2019-11-16T21:54:01Z")

</div>

> [@zenofmud](#):
>
> Just for your info, I have been using node-red-contrib-play-sound quite successfully on a rpi for quite some time. I'll post the flow in `Share Yor Projects` in a little bit.

Thanks.

I'll download it and see what happens.

---

<div class="post-metadata">

**Author:** ![Trying\_to\_learn](https://sea2.discourse-cdn.com/flex026/user_avatar/discourse.nodered.org/trying_to_learn/32/28400_2.png) [@Trying\_to\_learn](https://discourse.nodered.org/u/Trying_to_learn)\
**Post date:** [16 November 2019 23:22 UTC](https://discourse.nodered.org/t/playing-a-mp3-flie/18030/16 "2019-11-16T23:22:08Z")

</div>

Yikes! That is a lot of work.

I guess that a bit of congrats on the effort put in to the flow.

For the sake of testing, I ported it to my RPI for music playing.

Edited the path and tried it.

SILENCE.

Looking into that it is probably because of this:

```auto
numid=1,iface=MIXER,name='PCM Playback Volume' ; type=INTEGER,access=rw---R--,values=1,min=-10239,max=400,step=0 : values=125 | dBscale-min=-102.39dB,step=0.01dB,mute=1

```

I use HDMI output.

I see the _name_ of what is playing. Though all I see is the directory name/artist rather than the actual song.

The buttons maybe do something but as there is no audio I can't say. But the _name_ changes if I press the next/previous enough times.

(though that is a whole other issue in a lot of ways.)

I don't know if the flow needs a specific player installed to work.  
I know I had to install the `play sound` node.

---

<div class="post-metadata">

**Author:** ![Trying\_to\_learn](https://sea2.discourse-cdn.com/flex026/user_avatar/discourse.nodered.org/trying_to_learn/32/28400_2.png) [@Trying\_to\_learn](https://discourse.nodered.org/u/Trying_to_learn)\
**Post date:** [16 November 2019 23:36 UTC](https://discourse.nodered.org/t/playing-a-mp3-flie/18030/17 "2019-11-16T23:36:41Z")

</div>

Bug report on the flow:

On the first page of the flow there are two nodes in which you must enter the path to the music.

That caught me out as I only edited one and that may be why the music isn't playing.  
And the node with this in needs to be changed to what I have:  
`amixer cset numid=3 2`

 ![Screenshot%20from%202019-11-17%2010-34-08](https://us1.discourse-cdn.com/flex026/uploads/nodered/original/2X/2/228a8545d6de039c3966f93ea20d99d2d5ede42c.png)

---

<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:** [16 November 2019 23:36 UTC](https://discourse.nodered.org/t/playing-a-mp3-flie/18030/18 "2019-11-16T23:36:42Z")

</div>

As it says in the description, I use the HiFiBerry MiniAmp to output the sound. If you are using another rocess to play the sound, you are going to have to make some changes.

---

<div class="post-metadata">

**Author:** ![Trying\_to\_learn](https://sea2.discourse-cdn.com/flex026/user_avatar/discourse.nodered.org/trying_to_learn/32/28400_2.png) [@Trying\_to\_learn](https://discourse.nodered.org/u/Trying_to_learn)\
**Post date:** [16 November 2019 23:41 UTC](https://discourse.nodered.org/t/playing-a-mp3-flie/18030/19 "2019-11-16T23:41:52Z")

</div>

Yeah, ok sorry about that.

It looks great and I do accept the work you put in to it.

It also doesn't seem to like MP3 files.

After editing the paths (plural) to where I have the MP3 files on the RPI, it see this in the debug window from a node:

```auto
{"_msgid":"ae32970c.01f888","topic":"","fileURL":"/home/pi/Music/MP3","song_count":57}

```

Just a few more than 57.  
On reflection that may be how many directories are in that folder. Dunno. But 57 is a rough approximation of the directories.

But is that because it is looking for .WAV files and not MP3?

Again, I do appreciate the flow and how it looks.

Alas it has taken me on a weird journey from **why I can't play MP3 files on a NUC running NR** to **playing .WAV files on a RPI**.

It isn't really helping me work out what is going on.

---

<div class="post-metadata">

**Author:** ![Trying\_to\_learn](https://sea2.discourse-cdn.com/flex026/user_avatar/discourse.nodered.org/trying_to_learn/32/28400_2.png) [@Trying\_to\_learn](https://discourse.nodered.org/u/Trying_to_learn)\
**Post date:** [23 November 2019 06:16 UTC](https://discourse.nodered.org/t/playing-a-mp3-flie/18030/20 "2019-11-23T06:16:33Z")

</div>

If anyone is still reading this:

I am not further down the track of understanding why:  
`play /home/me/Music/DontTouchTheButton.mp3`  
from a terminal/CLI works. All things on THIS machine.

If I put that into a NR `exec` node it doesn't.

Yet, with `debug` nodes on all three outputs of the node, it would seem it works/ed.

Output #1:`""`  
Output #2:`/home/me/Music/DontTouchTheButton.mp3: File Size: 36.2k Bit Rate: 173k Encoding: MPEG audio Channels: 2 @ 16-bit Samplerate: 44100Hz Replaygain: off Duration: 00:00:01.67 In:0.00% 00:00:00.00 [00:00:01.67] Out:0 [|] Clip:0 In:11.1% 00:00:00.19 [00:00:01.49] Out:8.19k [====|====] Clip:0 In:22.2% 00:00:00.37 [00:00:01.30] Out:16.4k [====|====] Clip:0 In:27.8% 00:00:00.46 [00:00:01.21] Out:20.5k [-==|===] Clip:0 In:38.9% 00:00:00.65 [00:00:01.02] Out:28.7k [====|====] Clip:0 In:44.5% 00:00:00.74 [00:00:00.93] Out:32.8k [====|====] Clip:0 In:55.6% 00:00:00.93 [00:00:00.74] Out:41.0k [====|====] Clip:0 In:61.1% 00:00:01.02 [00:00:00.65] Out:45.1k [-==|==] Clip:0 In:72.3% 00:00:01.21 [00:00:00.46] Out:53.2k [====|====] Clip:0 In:77.8% 00:00:01.30 [00:00:00.37] Out:57.3k [====|====] Clip:0 ...`  
Output #3: {"code":0}

So, where now?

Oh, I have also looked at this:  
[Someone with similar problems](https://discourse.nodered.org/t/playing-mp3-audio/8188/11)

That flow works. I hear the sound.

Further complicating the issue - for me at least.

[Next page](https://discourse.nodered.org/t/playing-a-mp3-flie/18030.md?page=2)
