Win 11 / audacity 3.1.3 / python 3
I’m trying to get a python script running that processes a bunch of files in a bunch of different folders in mp3s.
I haven’t done any work previously with macros or pipes, but I’m been making fair progress.
My problem is that sometimes when I run pipe-test.py, I get one of 2 errors, and sometimes it gets through and runs the rest of my script (which doesnt quite work but first I’m trying to get the test to work consistently.
My best chance at getting it to run throught the test and move on is to run it off a fresh restart, otherwise sometimes if i restart audacity it will work, but most times i get one of these errors, and sometimes a restart doesnt give a success either:
"C:\Program Files\Python310\python.exe" C:/Users/herin/Documents/GitHub/audacity/scripts/piped-work/pipe_test.py
pipe-test.py, running on windows
Write to "\\.\pipe\ToSrvPipe"
Read from "\\.\pipe\FromSrvPipe"
-- Both pipes exist. Good.
Traceback (most recent call last):
File "C:\Users\herin\Documents\GitHub\audacity\scripts\piped-work\pipe_test.py", line 46, in <module>
TOFILE = open(TONAME, 'w')
FileNotFoundError: [Errno 2] No such file or directory: '\\\\.\\pipe\\ToSrvPipe'
Process finished with exit code 1
or this one (while audacity is still definitely running, and pipe is definitely enabled)
"C:\Program Files\Python310\python.exe" C:/Users/herin/Documents/GitHub/audacity/scripts/piped-work/pipe_test.py
pipe-test.py, running on windows
Write to "\\.\pipe\ToSrvPipe"
..does not exist. Ensure Audacity is running with mod-script-pipe.
Process finished with exit code 0
I’m not changing anything in the script, just closing and reopening audacity trying to get a success.
I’ve clones the entire audacity github repo and am working straight out of the pipe-test.py, the only changes I’ve made are adding sleep:
print("-- Both pipes exist. Good.")
sleep(0.01)
TOFILE = open(TONAME, 'w')
as well as my code following the pipe check that does sometimes get reached :
baseDirectory = "C:\\Users\\herin\\Desktop\\PollyGVH\\"
files = GetAllFiles()
for file in files:
mp3Dir = os.path.splitext(file)[0]
wavDir = mp3Dir + "_wav"
if not os.path.exists(mp3Dir):
os.makedirs(mp3Dir)
if not os.path.exists(wavDir):
os.makedirs(wavDir)
mp3s = GetAllMP3s()
for mp3 in mp3s:
#do_command(f"Open: Filename={mp3}") # should be .mp3
#do_command(f"ExportWav: Filename = {mp3}")
Any idea what could be causing such unpredictability?