# \[SOLVED\]Not hearing sound using aplay via exec when running as service

**URL:** https://discourse.nodered.org/t/solved-not-hearing-sound-using-aplay-via-exec-when-running-as-service/52924
**Category:** General
**Created:** [29 October 2021 04:05 UTC](https://discourse.nodered.org/t/solved-not-hearing-sound-using-aplay-via-exec-when-running-as-service/52924 "2021-10-29T04:05:50Z")
**Posts on this page:** 3
**Page:** 1

<div class="post-metadata">

### Author: ![cymplecy](https://sea2.discourse-cdn.com/flex026/user_avatar/discourse.nodered.org/cymplecy/32/2773_2.png) [@cymplecy](https://discourse.nodered.org/u/cymplecy)
#### Post date: [29 October 2021 04:05 UTC](https://discourse.nodered.org/t/solved-not-hearing-sound-using-aplay-via-exec-when-running-as-service/52924/1 "2021-10-29T04:05:50Z")

</div>

Following on from how to get Node-RED to run as a service on a Pi I'm having trouble playing a sound via exec node

So I'm trying to play a wav file out thru the Pi audio jack

It works fine when I run Node-RED directly from a terminal

As I was typing this I suddenly thought that the sound is probably defaulting to going out thru HDMI and with a bit of googling and experimenting I came up with this as my solution

![image](https://us1.discourse-cdn.com/flex026/uploads/nodered/original/3X/9/3/93f641da691985a61119bffdfdc8418218703145.png)

which tells it to explicitly use the audio jack and all good 🙂 😃

---

<div class="post-metadata">

### Author: ![JGKK](https://sea2.discourse-cdn.com/flex026/user_avatar/discourse.nodered.org/jgkk/32/18515_2.png) [@JGKK](https://discourse.nodered.org/u/JGKK)
#### Post date: [29 October 2021 05:52 UTC](https://discourse.nodered.org/t/solved-not-hearing-sound-using-aplay-via-exec-when-running-as-service/52924/2 "2021-10-29T05:52:54Z")

</div>

You could also define the headphone jack as the default in your asound.conf file.  
Although that can be a little bit confusing too 🙈

---

<div class="post-metadata">

### Author: ![system](https://us1.discourse-cdn.com/flex026/uploads/nodered/original/1X/d073cd938eafa2e558d7c2cd59003b3ef4963033.png) [@system](https://discourse.nodered.org/u/system)
#### Post date: [28 December 2021 05:53 UTC](https://discourse.nodered.org/t/solved-not-hearing-sound-using-aplay-via-exec-when-running-as-service/52924/3 "2021-12-28T05:53:25Z")

</div>

This topic was automatically closed 60 days after the last reply. New replies are no longer allowed.
