https://forum.audacityteam.org/t/pipeclient/65283/1
Opero con Audacity 3.2.1 en windows 11 con python 3.10.6
Trato de localizar silencios en un track desde un script python utilizando test.py. (En interactivo funciona perfectamente).
No sé si es un problema de sintaxis o el comando no existe en Python.
Los comandos que envío son:
do_command(“Import2: Filename=C:\users\isaac\downloads\knico.mp3”) OK
do_command(“SelectAll:”) Ok
time.sleep(2)
do_command (“LabelSounds:treshold=0.0,measurement=‘avg’,sil-dur=0.4,snd-dur=0.01,type=‘between’,pre-offset=0,post-offset=0,text=‘nosound’”) Fail
do_command(“LabelSounds:type=‘between’”) Fail
Otra prueba:
do_command(‘Help: Command=“LabelSounds”’)
Send: >>>
Help: Command=“LabelSounds”
Rcvd: <<<
Command not found
BatchCommand finished: OK
Si ejecuto analizar etiquetas de sonidos interactivamente en el menú, audacity genera los tramos de silencio que le he solicitado y entonces si ejecuto desde el script python la siguiente línea, obtengo con éxito una cadena perfectamente procesable.
kk=do_command(“GetInfo: Type=Labels”) OK
I use Audacity 3.2.1 on windows 11 with python 3.10.6
I’m trying to locate silences in a track from a python script using test.py. (In interactive mode it works perfectly and I locate the silences).
I don’t know if it’s a syntax issue or the command doesn’t exist in Python.
The commands I send are:
do_command(“Import2: Filename=C:\users\isaac\downloads\knico.mp3”) It works OK
do_command(“SelectAll:”) It works OK
time.sleep(2)
do_command ("LabelSounds:treshold=0.0,measurement=‘avg’,sil-dur=0.4,snd-dur=0.01,type=‘between’,pre-offset=0,post-offset=0,text=‘nosound’ ") Fail
do_command(“LabelSounds:type=‘between’”) Fail
Another test:
do_command(‘Help: Command=“LabelSounds”’)
Send: >>>
Help: Command=“LabelSounds”
Rcvd: <<<
Command not found
BatchCommand finished: OK
If I select analyze - sound label - interactively from the menu, audacity generates the silent chunks I’ve asked for, and then if I run the following line from the python script, I successfully get a perfectly processable string.
kk=do_command(“GetInfo: Type=Labels”) Works, OK
Is there any command or method to generate the sections of silence from Python?