audacity / audacity

Audio Editor
https://wiki.audacityteam.org/wiki/For_Developers
Other
12.59k stars 2.26k forks source link

New Export: if no extension is specified, export no longer supplies the appropriate extension #5007

Closed petersampsonaudacity closed 1 year ago

petersampsonaudacity commented 1 year ago

Bug description

With the new Export, if no extension is specified, export no longer supplies the appropriate extension.

This is a regression on 3.3.3 and earlier

Steps to reproduce

  1. launch 3.4.0 latest alpha
  2. generate a 30 second chirp
  3. File > Export Audio
  4. specify a filename without and extension, test say
  5. Observe the file is exported without a file extension

Expected behavior

Appropriate file extension to be added for the exported file type

Actual behavior

No extension added on export - and no warning message

Audacity Version

3.4.0 alpha

Operating system

Windows 10 - but assume all OS

Additional context

See also #5005

petersampsonaudacity commented 1 year ago

The Manual specifies that this should indeed be the case: image

LWinterberg commented 1 year ago

We probably have 3 option to handle this:

  1. Just let the user do their thing; if they didn't say .wav, they didn't say .wav.
  2. Warn the user before export if they messed up (#5005)
  3. Always auto-complete to the appropriate file type as soon as the user goes into another field or clicks export.

Out of these options, option 3 probably is the only one worth going for, given that Windows just can't do anything with the files otherwise. It fixes #5005 automatically as there just never can be wrong extension.

The other options feel weaker to me. If we go for option 2, album numberings like "4.Blossom" would show a "your wav has a .Blossom extension, do you want to go back and fix that?", which feels more annoying. And option 1 just would produce "broken" files for most users.

lededev commented 1 year ago

I need extension automatic completion back, when in v3.3.3, the export dialog, I input a filename out, if type is WAV (Microsoft), it will export out.wav, but on v3.4-alpha, it export out file no extension.

lededev commented 1 year ago

In order to facilitate my own use, I made a temporary modification, hoping to see the official fix for this problem in the v3.4 official version. image

petersampsonaudacity commented 1 year ago

@LWinterberg of your options Leo, like you I am minded to favour option 3: Always auto-complete to the appropriate file type as soon as the user goes into another field or clicks export.

dozzzzer commented 1 year ago

Related https://github.com/audacity/audacity/issues/5416

petersampsonaudacity commented 1 year ago

@LWinterberg @dozzzzer

See this recent Forum thread: https://forum.audacityteam.org/t/can-not-export-as-mp3-with-new-update/88893

dozzzzer commented 1 year ago

@LWinterberg I wonder if we also should auto-complete with a proper extension when "Custom FFmpeg Export" is selected and the Format and the Codec are specified? In its current state, #5482 doesn't allow for this.

crsib commented 1 year ago

According to the comment from @vsverchinsky - ffmpeg doesn't return such information

petersampsonaudacity commented 1 year ago

@LWinterberg I wonder if we also should auto-complete with a proper extension when "Custom FFmpeg Export" is selected and the Format and the Codec are specified?

I think you also need to auto-complete for ALL File types when the user specifies a filename with no extension

See these STRs that I wrote in the recent forum thread complaining about this:

Try these steps:

  1. import a WAV file or record some audio
  2. File > Export Audio
  3. Change the export Format to be MP3 Files
  4. Observe: offered File Name is: .mp3 - with the .mp3 extension
  5. Export button to export it
  6. Observe you have a proper MP3 file
  7. File > Export Audio
  8. Observe: Format remains as MP3 Files and offered File Name remains as before
  9. change the File Name - but do NOT add the extension
  10. Export button to export the audio
  11. Observe: a file is exported but it is NOT identified as and MP3 file and it carries no extension.

The simple workaround is: a) add the .mp3 extension manually, or b) click the Format dropdown and re-select MP3 files

BTW this affects not just MP3 but all the other export formats in the same way.

LWinterberg commented 1 year ago

With the exceptions of custom ffmpeg export and external program, it should autocomplete the file name as soon as you click off the text field. Is that not the case in the build?

dozzzzer commented 1 year ago

It is the case for anything except custom FFmpeg export and the external program one.

petersampsonaudacity commented 1 year ago

Doesn't work for me in the STRs is listed above!

That was testing on 3.4.0 - is there a branch build or Beta build to test?

LWinterberg commented 1 year ago

ah, I see the distinction: When clicking "export" directly after the name, the extension is not appended. This really needs to be fixed

dozzzzer commented 1 year ago

@petersampsonaudacity Peter, chances are you're looking at the wrong build: I've just re-checked that particular use case you mentioned in the PR linked to this issue and it works perfectly for me.

petersampsonaudacity commented 1 year ago

@dozzzzer

Sergey, testing on W10 with the latest 3.4.1 Beta test build: audacity-win-3.4.1-beta-20231106+3897888-x64-msvc2022

Following my steps above O still get the same prob;em at steps 9-11

Though as Leo points out if I add Steps 9.1 change the Folder location 9.2: Observe: the file extension is then added to the name.

And of course all is fine after that.

petersampsonaudacity commented 1 year ago

Ah, but branch build testing

Testing on W10 with @vsverchinsky 's branch build for this fix: audacity-win-3.4.1-alpha-20231103+b08b1c7-x64

This now appears to work fine on Vitaly's branch

If the user has a Filename without an appropriate extension and then presses the Export button a) the appropriate file extension is added in the dialog b) a file of the identifiably correct format is exported

Also if the user adds a wrong/inappropriate extension c) then Audacity now corrects that with the appropriate extension.

BUT note that if a user has a filename with dots/periods in it (say "green.and.pleasant.land") and no extension then the final text after the last dot/period will be stripped off and be replaced with the appropriate file extension.
E.g. "green.and.pleasant.mp3" - this destroying some of the user's carefully constructed filename. Is this desirable behavior?

@crsib @LWinterberg @dozzzzer : perhaps the fix PR #5482 could be pulled into the 3.4.1 Beta?

dozzzzer commented 1 year ago

perhaps the fix PR https://github.com/audacity/audacity/pull/5482 could be pulled into the 3.4.1 Beta?

yes, we plan to include it in 3.4.1