Is there a simple list of options one can use with "do_command"?
Forum rules
This forum is for Audacity on Windows.
Please state which version of Windows you are using,
and the exact three-section version number of Audacity from "Help menu > About Audacity".
Audacity 1.2.x and 1.3.x are obsolete and no longer supported. If you still have those versions, please upgrade at https://www.audacityteam.org/download/.
The old forums for those versions are now closed, but you can still read the archives of the 1.2.x and 1.3.x forums.
Please state which version of Windows you are using,
and the exact three-section version number of Audacity from "Help menu > About Audacity".
Audacity 1.2.x and 1.3.x are obsolete and no longer supported. If you still have those versions, please upgrade at https://www.audacityteam.org/download/.
The old forums for those versions are now closed, but you can still read the archives of the 1.2.x and 1.3.x forums.
Is there a simple list of options one can use with "do_command"?
I have been looking throughout the scripting guides supplies by Audacity but they all seem to describe options that are normally activated in audacity menu items. They are not in any kind of format that can be used in scripting.
I accidentally entered "do_command("NEW") which opens a new track if Audacity is open. Also: "do_command("Close") which closes Audacity. I have spent at lease an hour looking for any other commands to use.
At the moment, I need to program creating a label, naming a label, Start and end record.
Is there a list?
Can someone send the do-command for the ones I listed?
I accidentally entered "do_command("NEW") which opens a new track if Audacity is open. Also: "do_command("Close") which closes Audacity. I have spent at lease an hour looking for any other commands to use.
At the moment, I need to program creating a label, naming a label, Start and end record.
Is there a list?
Can someone send the do-command for the ones I listed?
Re: Is there a simple list of options one can use with "do_command"?
I assume that you are referring to "do_command" from "pipe_test.py"?
That Python script is really only intended for testing (as the name suggests). To build a Python app that will do something useful, I'd suggest using the "pipeclient.py" module.
Here's a direct link to pipeclient.py: https://raw.githubusercontent.com/audac ... eclient.py
pipeclient.py is fully documented - open it in your favourite text / code editor to read the docstrings.
If you've not used pipeclient.py before, I'd suggest that you try the command line interface first (also a good way to test individual commands).
There's a full list of supported commands in the Audacity manual here: https://manual.audacityteam.org/man/scr ... rence.html
(The easy way to get to that page is from the "All Commands" link in the "Reference" section in the left column of each page of the manual)
That Python script is really only intended for testing (as the name suggests). To build a Python app that will do something useful, I'd suggest using the "pipeclient.py" module.
Here's a direct link to pipeclient.py: https://raw.githubusercontent.com/audac ... eclient.py
pipeclient.py is fully documented - open it in your favourite text / code editor to read the docstrings.
If you've not used pipeclient.py before, I'd suggest that you try the command line interface first (also a good way to test individual commands).
There's a full list of supported commands in the Audacity manual here: https://manual.audacityteam.org/man/scr ... rence.html
(The easy way to get to that page is from the "All Commands" link in the "Reference" section in the left column of each page of the manual)
9/10 questions are answered in the FREQUENTLY ASKED QUESTIONS (FAQ)
Re: Is there a simple list of options one can use with "do_command"?
After making three corrections in the command line interface code, I finally got it to work. I can now see a request to enter Q to quit and it works. I also see that a READ_NAME and a WRITE_NAME files have been added to my folder and are empty.
Then I looked at the scripting URL and it sent me right back to the same page that has not made sense all along. I see not one example on how to create the command. In the test program, I saw the "do_command" line and guessed to use "NEW" and "Close". It worked. No information from the scripting docs helped. I probably have to keep on digging.
"I assume that you are referring to "do_command" from "pipe_test.py"?
That Python script is really only intended for testing (as the name suggests). To build a Python app that will do something useful, I'd suggest using the "pipeclient.py" module."
Well, I was able to achieve the execution of two commands using pipe_test.py and none with command line interface program from github.
This is starting to look like "Why do it in 65 lines of code when 298, with significant rework, will do?"
Again, I find that "do_command(New)" and "do_command(close)" work in the test program.
All I want is the do-command lines for record, stop, create label, name label.
Can anyone help me?
Then I looked at the scripting URL and it sent me right back to the same page that has not made sense all along. I see not one example on how to create the command. In the test program, I saw the "do_command" line and guessed to use "NEW" and "Close". It worked. No information from the scripting docs helped. I probably have to keep on digging.
"I assume that you are referring to "do_command" from "pipe_test.py"?
That Python script is really only intended for testing (as the name suggests). To build a Python app that will do something useful, I'd suggest using the "pipeclient.py" module."
Well, I was able to achieve the execution of two commands using pipe_test.py and none with command line interface program from github.
This is starting to look like "Why do it in 65 lines of code when 298, with significant rework, will do?"
Again, I find that "do_command(New)" and "do_command(close)" work in the test program.
All I want is the do-command lines for record, stop, create label, name label.
Can anyone help me?
I need help with do_command in the pipe_test.py program.
I have finally managed to get two commands to work but only because I guessed how to use them.
do_command(NEW) where I can open a new track and
do_command(Close) where I can close Audacity.
I still need a command for Record, Stop recording, create label, and name a label.
Guesses gleaned from the audacity scripting page are not helping.
Can you help me?
do_command(NEW) where I can open a new track and
do_command(Close) where I can close Audacity.
I still need a command for Record, Stop recording, create label, and name a label.
Guesses gleaned from the audacity scripting page are not helping.
Can you help me?
Re: Is there a simple list of options one can use with "do_command"?
What were they?
9/10 questions are answered in the FREQUENTLY ASKED QUESTIONS (FAQ)
Re: Is there a simple list of options one can use with "do_command"?
How about Play, Stop, SelectAll, Record1stChoice, Record2ndChoice, or other commands from https://manual.audacityteam.org/man/scr ... rence.html
9/10 questions are answered in the FREQUENTLY ASKED QUESTIONS (FAQ)
Re: Is there a simple list of options one can use with "do_command"?
1, and 2) Both references to opening the text files need to have quotes around the file name. Near line 160, and line 209.
3) The program is going to crash until "WRITE_NAME" file exists. I would add code to see if it exists then, if it doesn't, create it.
Re: Is there a simple list of options one can use with "do_command"?
How do I have a track record for a specific duration?
I found
do_command(" 'Start Time' = 0, 'End Time' = 1")
but it fails. I believe as syntax error, command missing.
I found
do_command(" 'Start Time' = 0, 'End Time' = 1")
but it fails. I believe as syntax error, command missing.
Re: Is there a simple list of options one can use with "do_command"?
I don't know what you mean.
Lines 158 to 166:
Code: Select all
def _write_pipe_open(self):
"""Open _write_pipe."""
self._write_pipe = open(WRITE_NAME, 'w')
def _read_thread_start(self):
"""Start read_pipe thread."""
read_thread = threading.Thread(target=self._reader)
read_thread.daemon = True
read_thread.start()
Code: Select all
while pipe_ok:
line = read_pipe.readline()
# Stop timer as soon as we get first line of response.
stop_time = time.time()
If "WRITE_NAME" file does not exist, "_write_pipe_open" will wait until it does, but that is non-blocking because it is a separate thread. "_write_thread_start" will then throw an error: "PipeClientError: Write pipe cannot be opened."
"WRITE_NAME" is the "pipe" that allows Python to connect to Audacity (https://en.wikipedia.org/wiki/Named_pipe). It must be created by Audacity. If Python creates it, then it's just a file, not a pipe into Audacity.
9/10 questions are answered in the FREQUENTLY ASKED QUESTIONS (FAQ)
Re: Is there a simple list of options one can use with "do_command"?
1. Start the recording
2. After the specified time, send the "Stop:" command.
9/10 questions are answered in the FREQUENTLY ASKED QUESTIONS (FAQ)