# Sending "s" key press or CTRL+C to Daemon process

**URL:** <https://discourse.nodered.org/t/sending-s-key-press-or-ctrl-c-to-daemon-process/56748>\
**Category:** General\
**Created:** [16 January 2022 13:45 UTC](https://discourse.nodered.org/t/sending-s-key-press-or-ctrl-c-to-daemon-process/56748 "2022-01-16T13:45:59Z")\
**Posts on this page:** 5\
**Page:** 1

<div class="post-metadata">

**Author:** ![cedschmidt](https://avatars.discourse-cdn.com/v4/letter/c/258eb7/32.png) [@cedschmidt](https://discourse.nodered.org/u/cedschmidt)\
**Post date:** [16 January 2022 13:46 UTC](https://discourse.nodered.org/t/sending-s-key-press-or-ctrl-c-to-daemon-process/56748/1 "2022-01-16T13:46:00Z")

</div>

Hi everyone,

I'm trying to run fmedia from node red under windows 10 to record speeches.  
I can easily start recording from a Daemon node, but to stop recording I need to press S key or CTRL+C command (in terminal) and I'm unable to this from node red. The kill command just kill the process bus the recorded file is not correct saved.  
Is there a proper way to send CTRL+C to daemon node or simulate a S key press?  
Thanks for helping,

Best

---

<div class="post-metadata">

**Author:** ![cedschmidt](https://avatars.discourse-cdn.com/v4/letter/c/258eb7/32.png) [@cedschmidt](https://discourse.nodered.org/u/cedschmidt)\
**Post date:** [18 January 2022 16:37 UTC](https://discourse.nodered.org/t/sending-s-key-press-or-ctrl-c-to-daemon-process/56748/2 "2022-01-18T16:37:28Z")

</div>

Hi,  
I'm really stuck there. Should I give more info? Maybe this is super easy and I just miss something 😉  
Best,

---

<div class="post-metadata">

**Author:** ![UnborN](https://avatars.discourse-cdn.com/v4/letter/u/4491bb/32.png) [@UnborN](https://discourse.nodered.org/u/UnborN)\
**Post date:** [18 January 2022 18:28 UTC](https://discourse.nodered.org/t/sending-s-key-press-or-ctrl-c-to-daemon-process/56748/3 "2022-01-18T18:28:33Z")

</div>

Is this of any help ?

> <https://github.com/stsaz/fmedia/issues/53>
>
> If you \`--globcmd=pause\` and then \`--globcmd=stop\`, the recording gets destroyed….
> 
> Steps to reproduce:
> 
> 1. \`C:\\Portable\\fmedia\\fmedia.exe --record -o D:\\Capture\\REC\\audiofile.wav --dev-loopback=0 --format=int16 --channels=stereo --rate=44100 --globcmd=listen\`
> 2. \`C:\\Portable\\fmedia\\fmedia.exe --globcmd=pause\`
> 3. \`C:\\Portable\\fmedia\\fmedia.exe --globcmd=stop\`
> 
> Crossing my fingers this is not impossible to fix ...

---

<div class="post-metadata">

**Author:** ![cedschmidt](https://avatars.discourse-cdn.com/v4/letter/c/258eb7/32.png) [@cedschmidt](https://discourse.nodered.org/u/cedschmidt)\
**Post date:** [18 January 2022 23:21 UTC](https://discourse.nodered.org/t/sending-s-key-press-or-ctrl-c-to-daemon-process/56748/4 "2022-01-18T23:21:05Z")

</div>

Hey @UnborN,  
Thanks a lot for your answer. Of course it helps... I will try tomorrow at work but the linked text should solve it:

> When you want to stop recording, you execute fmedia once again (i.e. you start instance #2):
> 
> ```auto
> fmedia --globcmd=stop
> 
> ```
> 
> fmedia will find out that instance #1 is currently running and will issue a command to it to stop recording. Both fmedia processes will now exit, with the first one correctly finishing its recording file (flushing all cached data and finalizing file header). In other words, this command will simulate an "S" key-press action for the first instance.  
> from [https://stsaz.github.io/fmedia/recording/](https://stsaz.github.io/fmedia/recording/)

I will keep you posted.  
Best,

---

<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:** [19 March 2022 23:21 UTC](https://discourse.nodered.org/t/sending-s-key-press-or-ctrl-c-to-daemon-process/56748/5 "2022-03-19T23:21:36Z")

</div>

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