Save path info when using Import2?

Hi, I’m opening a file using a Python script calling Import2. That works fine. However, after manually editing the file in Audacity, I want to export it but Audacity defaults to the last saved location.

Is there a way to tell Audacity, via scripting, the default directory for exporting a file?

Use the “Export2” command and enter the full file path and name.

Thank you. However, when I try Export2, I get a ‘success’ message (‘Exported to MP3 format: /tmp/testdata/isaout.mp3\nBatchCommand finished: OK\n’) but the file is corrupt:

$ audacious isaout.mp3
ERROR [DecodeState]: mpg123 error in file:///tmp/testdata/isaout.mp3: Error reading the stream. (code 18)

All that’s been done is the file loaded and immediately exported.

Any pointers as to what might be wrong?

It’s working OK for me on Linux.

This is the MP3 information (using “MediaInfo”) that I’m getting.

Format                                   : MPEG Audio
File size                                : 80.6 KiB
Duration                                 : 2 s 37 ms
Overall bit rate mode                    : Constant
Overall bit rate                         : 320 kb/s
Writing library                          : LAME3.100

Format                                   : MPEG Audio
Format version                           : Version 1
Format profile                           : Layer 3
Duration                                 : 2 s 38 ms
Bit rate mode                            : Constant
Bit rate                                 : 320 kb/s
Channel(s)                               : 1 channel
Sampling rate                            : 44.1 kHz
Frame rate                               : 38.281 FPS (1152 SPF)
Compression mode                         : Lossy
Stream size                              : 79.6 KiB (99%)
Writing library                          : LAME3.100
Encoding settings                        : -m m -V 4 -q 3 -lowpass 20.5

Maybe try exporting that same project manually and check that you are getting a valid MP3.

That was helpful, thank you. Turns out my problem was that, after editing a track, it needs to be selected before Export2 is run. My script fixed now.

Thanks for your help.

This topic was automatically closed after 30 days. New replies are no longer allowed.