Request "mono" and "optimal output" on MP3 export screen

This read-only archive contains discussions from the Adding Feature forum.
New feature request may be posted to the Adding Feature forum.
Technical support is available via the Help forum.
rhajdaj
Posts: 4
Joined: Sun Feb 09, 2014 8:02 pm
Operating System: Please select

Request "mono" and "optimal output" on MP3 export screen

Post by rhajdaj » Mon Feb 10, 2014 11:55 pm

I'd like to request support for two things in the export MP3 (LAME encoder) window. Both of these things are supported by command line LAME and are useful for things like long speech files when a low bitrate is desired to keep files small while keeping decent sound quality.

1) Support for a "mono" option for output channel mode
This option would pass the "-m m" option to LAME to downmix a stereo (multichannel) file into a single channel mp3. Again, useful in situations such as when a stereo speech file (e.g, 44100 16 bit stereo) is encoded to mp3.

2) Support for a different output sample rate than input sample rate
This allows for a much better sounding mp3 if (using same example) a 44100 wav file is compressed to an mp3 with a bitrate of 32. The default behavior of command line LAME is to choose the optimal output sample rate based on the specified bitrate. It would be useful for me if this was selectable as an option (such as "auto") in addition to possibly providing a selectable manual bitrate for other uses.

See related topic:
http://bugzilla.audacityteam.org/show_bug.cgi?id=285

kozikowski
Forum Staff
Posts: 69357
Joined: Thu Aug 02, 2007 5:57 pm
Operating System: macOS 10.13 High Sierra

Re: Request "mono" and "optimal output" on MP3 export screen

Post by kozikowski » Tue Feb 11, 2014 1:25 am

Tracks > Stereo Track to Mono.
File > Export > MP3 Files: Options: 32.

Edit > Undo

Did that cover it? Yes 32 is the minimum to make a mono show barely passable. Lower than that it sounds funny to just about everybody.

Koz

rhajdaj
Posts: 4
Joined: Sun Feb 09, 2014 8:02 pm
Operating System: Please select

Re: Request "mono" and "optimal output" on MP3 export screen

Post by rhajdaj » Tue Feb 11, 2014 4:27 am

Thanks for the response.

The problem with the setting of the 32 bitrate as Audacity works today is that the output sample rate is forced to be the same as the input sample rate. For example, if I have a 44100 (mono) input wav file, and I want to export to a 32 bps mp3, the result is a 44100 (mono) mp3 file. The sound quality of this file is noticeably lower than if I were to run LAME from command line on the same wav file specifying a 32 bitrate:
lame -b 32 myMono44100file.wav
This produces a 22050 (mono) mp3 file. I'd encourage you to do a test - I think you'll notice a difference in quality (esp with a speech file).

In regards to the mono option, your suggestion to split from stereo to mono would work for me. That being said - as a preference, I would still suggest offering the mono option in the export MP3 window. It's a pretty easy change and I believe this is a cleaner approach long term (requires fewer clicks) and is offered by other LAME frontends (such as CDex and Audiograbber). This one's not as urgent to me though.

steve
Site Admin
Posts: 81609
Joined: Sat Dec 01, 2007 11:43 am
Operating System: Linux *buntu

Re: Request "mono" and "optimal output" on MP3 export screen

Post by steve » Tue Feb 11, 2014 5:19 am

rhajdaj wrote:2) Support for a different output sample rate than input sample rate
This allows for a much better sounding mp3 if (using same example) a 44100 wav file is compressed to an mp3 with a bitrate of 32. The default behavior of command line LAME is to choose the optimal output sample rate based on the specified bitrate. It would be useful for me if this was selectable as an option (such as "auto") in addition to possibly providing a selectable manual bitrate for other uses.
The other difference is that lame -b 32 myMono44100file.wav will encode as Mpeg audio version 2 layer 3, whereas the "normal" Audacity MP3 export encodes as Mpeg audio version 1 layer 3.

Here's a sample comparing Audacity's default 32 kbps MP3 export of a 44100 Hz mono WAV with the command line export.
I agree that the default Audacity export is noticeably worse.
gui-vs-cli.flac
(203.48 KiB) Downloaded 96 times
9/10 questions are answered in the FREQUENTLY ASKED QUESTIONS (FAQ)

Gale Andrews
Quality Assurance
Posts: 41761
Joined: Fri Jul 27, 2007 12:02 am
Operating System: Windows 10

Re: Request "mono" and "optimal output" on MP3 export screen

Post by Gale Andrews » Sun Mar 02, 2014 7:00 pm

steve wrote:
rhajdaj wrote:2) Support for a different output sample rate than input sample rate
This allows for a much better sounding mp3 if (using same example) a 44100 wav file is compressed to an mp3 with a bitrate of 32. The default behavior of command line LAME is to choose the optimal output sample rate based on the specified bitrate. It would be useful for me if this was selectable as an option (such as "auto") in addition to possibly providing a selectable manual bitrate for other uses.
The other difference is that lame -b 32 myMono44100file.wav will encode as Mpeg audio version 2 layer 3, whereas the "normal" Audacity MP3 export encodes as Mpeg audio version 1 layer 3.
The only difference that makes as far as I know is that MPEG-1 Layer3 has two granules per frame
and MPEG-2 and -2.5 Layer3 have one granule per frame, where a "granule" is 576 samples.
steve wrote:Here's a sample comparing Audacity's default 32 kbps MP3 export of a 44100 Hz mono WAV with the command line export.I agree that the default Audacity export is noticeably worse.
The attachment gui-vs-cli.flac is no longer available
There is some counter-evidence. Using -b32 at the command-line (LAME command-line or Audacity command-line exporter) sets output sample rate of 22050 Hz for mono and 16000 Hz for stereo. Particularly for stereo, this introduces visible waveform deformation and audible degradation in a DTMF tone:
32 kbps 16000 Hz deformed MP3.png
32 kbps 16000 Hz deformed MP3.png (18.86 KiB) Viewed 5170 times
compared to 32 kbps at 44100 Hz:
32 kbps 44100 Hz.png
32 kbps 44100 Hz.png (18.87 KiB) Viewed 5170 times
As you can also see, using 16000 Hz introduces more start padding (using Audacity GUI or command-line).

CDex and other front ends may have an output sample rate choice, but Audacity already has that (project rate). I think it will be too confusing to have an extra sample rate choice in the MP3 Export Options. Developers have opposed sample rate export options in the past.

It may be an idea to have such a sample rate option for the ExportMP3 and other export commands in a Chain, but that is a separate use case and would not confuse novice users because novice users would not use chains.

Having an "automatic" option that lets LAME reduce sample rate when bit rate is low and reduce bit rate when sample rate is low is not a bad idea, but users can already make these changes for themselves manually, or use Audacity's command-line exporter. If you want LAME to change the sample rate then I think Audacity's Invalid Sample Rate dialogue must be suppressed.

The most popular request we've had over the years is that Audacity should by default automatically encode to mono at 64 kbps (at the current project rate) if the input track is mono . Some of these people "might" also have been asking for automatic bit rate reduction at low sample rates, but that is only an inference.

There is also a clear case for a "Mono" radio button that does -m m.

In my view, automatic sample rate and bit rate reduction come behind an option for "128 kbps stereo, 64 kbps mono" and behind a "Mono" button. Any "auto" option must not create confusion with the implementation of those.


Gale
________________________________________FOR INSTANT HELP: (Click on Link below)
* * * * * Tips * * * * * Tutorials * * * * * Quick Start Guide * * * * * Audacity Manual

steve
Site Admin
Posts: 81609
Joined: Sat Dec 01, 2007 11:43 am
Operating System: Linux *buntu

Re: Request "mono" and "optimal output" on MP3 export screen

Post by steve » Sun Mar 02, 2014 7:51 pm

Gale Andrews wrote:Having an "automatic" option that lets LAME reduce sample rate when bit rate is low and reduce bit rate when sample rate is low is not a bad idea, but users can already make these changes for themselves manually, or use Audacity's command-line exporter. If you want LAME to change the sample rate then I think Audacity's Invalid Sample Rate dialogue must be suppressed.

The most popular request we've had over the years is that Audacity should by default automatically encode to mono at 64 kbps (at the current project rate) if the input track is mono . Some of these people "might" also have been asking for automatic bit rate reduction at low sample rates, but that is only an inference.

There is also a clear case for a "Mono" radio button that does -m m.
An option to select "exporting as mono" is the one that does not have a one click alternative.
The sample rate can be set in the Project Rate box.
The bit rate can be set in the "Quality" selection.
Mono can only be set by manually converting all stereo tracks to mono and manually ensuring that all pan sliders are set to centre.

In my opinion we should at least have an export mono (m -m) option, but if we do that, why only for MP3 export? Would it not make sense to have an "export mono" option for all formats?
9/10 questions are answered in the FREQUENTLY ASKED QUESTIONS (FAQ)

Gale Andrews
Quality Assurance
Posts: 41761
Joined: Fri Jul 27, 2007 12:02 am
Operating System: Windows 10

Re: Request "mono" and "optimal output" on MP3 export screen

Post by Gale Andrews » Mon Mar 03, 2014 9:28 pm

steve wrote:
Gale Andrews wrote:Having an "automatic" option that lets LAME reduce sample rate when bit rate is low and reduce bit rate when sample rate is low is not a bad idea, but users can already make these changes for themselves manually, or use Audacity's command-line exporter. If you want LAME to change the sample rate then I think Audacity's Invalid Sample Rate dialogue must be suppressed.

The most popular request we've had over the years is that Audacity should by default automatically encode to mono at 64 kbps (at the current project rate) if the input track is mono . Some of these people "might" also have been asking for automatic bit rate reduction at low sample rates, but that is only an inference.

There is also a clear case for a "Mono" radio button that does -m m.
An option to select "exporting as mono" is the one that does not have a one click alternative.
The sample rate can be set in the Project Rate box.
The bit rate can be set in the "Quality" selection.
Yes, but as I said before - the people who want "128 kbps stereo/64 kbps mono" may not find a "Mono" button intuitive. I am guessing they would select that "Mono" button when they have a mono track (making two steps) even though they could use "Stereo" or "Joint stereo" (it means if a stereo track is available, else mono).

But the point is they want no clicks at all.
steve wrote:In my opinion we should at least have an export mono (m -m) option, but if we do that, why only for MP3 export? Would it not make sense to have an "export mono" option for all formats?
Do all encoders have a downmix to mono and do they all do only that and in the same way without changing sample rate, bit rate or anything else?

Or to be consistent, would Audacity have to buffer a run of Tracks > Stereo Track to Mono and export that?


Gale
________________________________________FOR INSTANT HELP: (Click on Link below)
* * * * * Tips * * * * * Tutorials * * * * * Quick Start Guide * * * * * Audacity Manual

steve
Site Admin
Posts: 81609
Joined: Sat Dec 01, 2007 11:43 am
Operating System: Linux *buntu

Re: Request "mono" and "optimal output" on MP3 export screen

Post by steve » Tue Mar 04, 2014 1:17 am

Gale Andrews wrote:I am guessing they would select that "Mono" button when they have a mono track (making two steps) even though they could use "Stereo" or "Joint stereo"
We usually go to a lot of effort to label things so that even the most "novice" of users can understand them.
Gale Andrews wrote:Do all encoders have a downmix to mono
Possibly not, but we don't usually use encoders directly. When Audacity exports it "renders" the project data to an audio file so we are not limited to the capabilities of specific encoders.

Oggenc, Lame, and FFmpeg all do have a downmix to mono option.
9/10 questions are answered in the FREQUENTLY ASKED QUESTIONS (FAQ)

Gale Andrews
Quality Assurance
Posts: 41761
Joined: Fri Jul 27, 2007 12:02 am
Operating System: Windows 10

Re: Request "mono" and "optimal output" on MP3 export screen

Post by Gale Andrews » Tue Mar 04, 2014 9:29 pm

steve wrote:
Gale Andrews wrote:I am guessing they would select that "Mono" button when they have a mono track (making two steps) even though they could use "Stereo" or "Joint stereo"
We usually go to a lot of effort to label things so that even the most "novice" of users can understand them.
We are also constrained by the number of words we can use.

To avoid duplicating those words, what would you suggest - having the "Stereo", "Joint Stereo" and "Mono" buttons in a panel that had some explanatory text?

It may be neater to grey out "Stereo" and "Joint Stereo" when there is only a mono downmix possible, and to grey out the entire options when a "128 kbps joint stereo/64 kbps mono" option is chosen (or whatever it's called).
steve wrote:
Gale Andrews wrote:Do all encoders have a downmix to mono
Possibly not, but we don't usually use encoders directly. When Audacity exports it "renders" the project data to an audio file so we are not limited to the capabilities of specific encoders.

Oggenc, Lame, and FFmpeg all do have a downmix to mono option.
When we call -m m with a mono button in the MP3 Options we can still force the output sample rate to the input sample rate as now, can't we?

The problem I see is that it is not transparent what a mono downmix option in an encoder does. If the track is already mono before being passed to the encoder, it is transparent.

I think you would perhaps be better to raise the issue on -devel if you propose a mono option for all formats. If it's selectable by format, where would that option go for WAV 16-bit and AIFF 16-bit, which have no options? Or would it just be selectable at export time with a checkbox or similar in the export and export multiple dialogues? Or would it be in the "Import / Export" Preferences, off by default?


Gale
________________________________________FOR INSTANT HELP: (Click on Link below)
* * * * * Tips * * * * * Tutorials * * * * * Quick Start Guide * * * * * Audacity Manual

steve
Site Admin
Posts: 81609
Joined: Sat Dec 01, 2007 11:43 am
Operating System: Linux *buntu

Re: Request "mono" and "optimal output" on MP3 export screen

Post by steve » Tue Mar 04, 2014 11:40 pm

Throwing in another (closely related) item. I recall several topics where users specifically want to export a 2 channel file, even if the project is mono.
Reasons for this include using CD burning software that requires stereo WAV, and another was "my client requires a 2 channel WAV file" (the customer is always right).
9/10 questions are answered in the FREQUENTLY ASKED QUESTIONS (FAQ)

Locked