0

I have been working on a project idea today, and I encountered this issue while attempting to kill an audio task. Here's my code (Problem is after the code block):

:two
ECHO Reading...
start C:\Users\Gigabyte\Documents\Audacity\FDD.wav
timeout /t 24 >nul /nobreak
taskkill FDD.wav
GOTO continue
:three
ECHO Reading
start C:\Users\Gigabyte\Documents\Audacity\HDD.wav
Timeout /t 44 >nul /nobreak
taskkill HDD.wav
:continue

It gave me an error that something was invalid then shut the window. I usually am able to read it word by word but time has taken it's toll on me. All I know is that something in quotes is invalid as of right now. However, I have suspicion that the audio file name is invalid and no such task exists. And this goes back to the main question. 'If an Audio File is Not Playing is it Considered a Task?'.

(If it's a matter of task or process ID's then how do I find them?) (If you need some more code to find out the context of the situation I'll gladly add some)

3rd Battalion
  • 25
  • 1
  • 7
  • 1
    Audio files are data files, not executables. You need to find the thing that is actually playing the audio file and kill that instead. – SomethingDark Dec 07 '18 at 19:13
  • So if it's windows media player then I'd shut windows media player, is that correct? – 3rd Battalion Dec 07 '18 at 19:15
  • 1
    That is correct. – SomethingDark Dec 07 '18 at 19:15
  • @SomethingDark If you would post your answer as an answer so that this question doesn't attract more people since it's answered. Much appreciated if you would. – 3rd Battalion Dec 07 '18 at 19:19
  • You should be using, `Timeout /T 24 /NoBreak >Nul` and `Timeout /T 44 /NoBreak >Nul` – Compo Dec 07 '18 at 19:37
  • I'm afraid it wouldn't be a very good answer, since a proper answer would also programatically determine the application that was going to open (assuming you intend to run this on multiple systems). I know that information is in the registry, but Windows 10 defaults to Groove Music, which is an app instead of an executable and I'm having a hard time extracting the Music.UI.exe executable name from the `AppXqj98qxeaynz6dv4459ayz6bnqxbyaqcs` value in `regedit`. – SomethingDark Dec 07 '18 at 20:00
  • 1
    You can mark your own question as answered. – Nathan Rice Dec 08 '18 at 00:09
  • How does one mark their question as answered I've seen it but I personally don't know how. Do I just answer it myself? – 3rd Battalion Dec 09 '18 at 16:36

1 Answers1

0

Audio files are data files, not executables. You need to find the program that is actually playing the audio file and kill it instead. So if you were using Windows Media Player then kill that. (Groove Music not included)

-SomethingDark

3rd Battalion
  • 25
  • 1
  • 7