Multithreading plx

None the following uses more than one CPU core, which would otherwise improve Audacity greatly:

  • effect: noise reduction,
  • effect: normalize,
  • export to MP3.

Audacity can’t export to MP3. Ask LAME developers.

Audacity already exports to MP3 via LAME lib. It could easily split the job into pieces and feed the pieces to the lib instead of one big chunk for one processor. The same solution for applying effects.

Multi-threading LAME is problematic because the “Bit Reservoir” requires that LAME runs as a single thread. Disabling the Bit Reservoir negatively affect encoding quality.
There was a project a few years ago (https://hydrogenaud.io/index.php/topic,73790.0.html) that claimed to provide multithreading without disabling the bit reservoir (using exactly the same encoding algorithm as the single threaded LAME), but links to that project now appear to be dead.

Splitting the track into parts then concatenating the parts after encoding is also problematic because it creates non-standard files. That can be fixed by a second pass of processing to fix the stream errors, but then you’ve probably lost more time than you’ve saved.

In the case of Export Multiple, encoding could be made considerably faster by processing multiple files simultaneously (running multiple instances of LAME). The audio player and transcoder “Foobar2000” already does this.

For effect processing, a multi-threading strategy that has been considered by Audacity’s developers is to process stereo tracks as two threads, one per channel. Currently there are no developers working on this, though I think there’s a good chance that this approach could be taken at some future time.