asweigart / asweigart/pyaudacity
Audacity pipe not available as fast as do() wants it to be
- Dominant language
- Python
- Stars
- 38
- Forks
- 8
- PR merge metrics
- No merged PRs in 30d
Description
I've just started experimenting with this code as a quieter drop-in for `pipeclient.py` from the Audacity source. I'd found, when using that code, that sometimes I needed to wait longer than the suggested time for the pipe to be ready. It doesn't seem like the 0.0001s waits in `do()` are long enough
```
% python3 scripts/splitexport.py tmp/metadata.txt
Initializing Audacity
Traceback (most recent call last):
File "scripts/splitexport.py", line 364, in
main(args)
File "scripts/splitexport.py", line 259, in main
audinit()
File "scripts/splitexport.py", line 80, in audinit
jdata = pa.get_info(info_type='Clips')
¦ ¦ ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^
File "pyaudacity/src/pyaudacity/__init__.py", line 4253, in get_info
return do('GetInfo: Type="{}" Format="{}"'.format(info_type, format))
¦ ¦ ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^
File "pyaudacity/src/pyaudacity/__init__.py", line 111, in do
raise PyAudacityException(
pyaudacity.PyAudacityException: /tmp/audacity_script_pipe.from.501 does not
exist. Ensure Audacity is running and mod-script-pipe is set to Enabled in
the Preferences window.
```
(Note I am using @bwagner's fork of your code, but the issue is in your main branch too)
I have a [fix](https://github.com/trjh/pyaudacity/commit/b1c5fada941f4fcdbf7cd9a03c3fd3202cbd1d10) for this in my fork.
Contributor guide
No contributing guide indexed for this repository
Research direction
Start in pyaudacity/src/pyaudacity/__init__.py at do(), where the 0.0001s waits are used, and reproduce the startup failure with scripts/splitexport.py. Compare the behavior with the fix referenced in the issue. Done means Audacity's pipe is available before the initial get_info call and the reported exception no longer occurs.
Written by the indexing model from the issue text.
Assessment
- Tech stack
- python
- Domain
- api
- Issue type
- Bug
- Difficulty
- 2/5
- Estimated time
- 1-3 hours
- Activity status
- Stale
- Clarity
- Clearly specified
- Newbie friendliness
- 35/100