Bugzilla – Bug 428
Export Multiple/Export allow exporting minimal audio file(s) with no audio data
Last modified: 2018-08-20 11:45:55 UTC
Export Multiple allows exporting empty (minimal) WAV files when the exported track or region contains no audio data. No warning is given that the exported file contains no audio data. No warning is given if all tracks are muted.
We have an "All the audio is muted" message" in the code which we could show if all export multiple tracks are muted. If only some tracks are muted or if any labels lack audio, these should not be exported. We could either throw a message or probably better, the export multiple success dialogue could state the files that were not exported. Additionally (even if users can more obviously see it's their mistake) straight export is allowed with no audio as long as an empty track is present.
Promoted to P3 so it can be release noted.
If you time shift a track from time zero by e.g. 10 seconds then select part of the white space before the start of the track e.g. 5 seconds and export selection, this exports about 50 ms of silence irrespective of the length selected.
Created attachment 338 [details] patches ExportMultiple.cpp Prevents exporting zero length files that result from muted tracks. (as here: http://forum.audacityteam.org/viewtopic.php?p=200758#p200758) For Export Multiple based on tracks there must be more than 1 non-muted track. Muted track are exported as silence, hopefully of the correct duration, so if this is not what the user wants then they are better positioned to see what they have done wrong. In one way it may be better to not export muted tracks at all, but for Export Multiple that may leave the user confused about why some tracks are "missing". I'm not sure that there is a really good solution to this unless we disallow Export Multiple if *any* tracks are muted (but that is not ideal either).
(In reply to comment #4) Scrap that. It's still running into problems with bug 430 which is tied into the same problem. I've made some progress, but not there yet.
Created attachment 339 [details] patches ExportMultiple.cpp and ExportMultiple.h I think this fixes bug 428 and 430. It does not address attempting to export an empty track. As with the normal "File > Export", an empty track will create a file with no audio (as expected).
Thanks, Steve. (In reply to comment #3) > If you time shift a track from time zero by e.g. 10 seconds then select part of > the white space before the start of the track e.g. 5 seconds and export > selection, this exports about 50 ms of silence irrespective of the length selected. I am not seeing that "problem" any more. (In reply to comment #6) > patches ExportMultiple.cpp and ExportMultiple.h > It does not address attempting to export an empty track. > > As with the normal "File > Export", an empty track will create a file with no > audio (as expected). I can live with that, though you seemed to regard it as a bug when you created the report, and I followed your lead. I had not seen the user reports that you had seen so was only guessing what the problem was. If a user labels white space that is not after the end of the audio track, then the length is exported as silence (or if the white space overlaps audio, there is an appropriate length of silence and audio). This seems acceptable. On Windows I tried your fix that deals with Cases 2 and 4 in the steps to repro. It is successful in preventing export multiple of muted tracks AFAICT. I don't think we need your new message box "Error. Nothing to export. The audio may be muted". Case 2 1 Open Audacity 2 Add a label track and a label, then step 4. This routes to your new message box. I suggest it may be better to either route this to the existing "Can't export multiple files" message (or possibly grey out export multiple in the same way straight export is greyed out if there is no audio track). Showing "Can't export multiple files" is more informative/less confusing IMO than an "audio may be muted" message. I prefer this to greying out export multiple, given we have the custom export multiple message. Case 4 1 Open Audacity 2 Generate tone and add any label 3 Mute the track then step 4 This also routes to your new message box. If we follow my above suggestion we can use the existing message box "Unable to export - all the audio is muted" instead of creating a new, very similar message box. This is then consistent with what happens when you attempt straight export. Or route this case to "Can't export multiple files" to which your patch has added text that muted tracks are not exported. I prefer routing to "Unable to export - all the audio is muted" as this is unambiguous.
(In reply to comment #7) > Case 2 > 1 Open Audacity > 2 Add a label track and a label, then step 4. <snip> > I suggest it may be better to either route this to the existing "Can't > export multiple files" message (or possibly grey out export multiple in > the same way straight export is greyed out if there is no audio track). > > Showing "Can't export multiple files" is more informative/less confusing > IMO than an "audio may be muted" message. I prefer this to greying out > export multiple, given we have the custom export multiple message. In this case I think the "correct" behaviour is to grey out the menu option as this would be consistent with "Export" and "Export Selection" It does not make sense to try and Export Multiple if there are no audio tracks. However, this is a different bug/issue and is unrelated to ExportMultiple.cpp but it looks like an easy fix. If Export Multiple is greyed out when there are no audio tracks, then: Case 4 1 Open Audacity 2 Generate tone and add any label 3 Mute the track then step 4 Case 4 can then lead to "Unable to export - all the audio is muted". While Export Multiple is operable with no audio tracks, we cannot say "all the audio is muted" because of "case 2". I've dealt with bugs 428 and 430 together because both problems are in the same code. I could try and address the "Export Multiple is available when no audio tracks" issue at the same time but I think that it is preferred to deal with one bug at a time?
Created attachment 340 [details] Disables the Export Multiple menu option when no audio tracks This patch must be applied *after* ExportMultiple-2.patch Disables the Export Multiple menu item when there are no audio tracks. It makes no sense to try and export with no audio tracks. If there is a label track: Changes the error message when all tracks are muted to the same as for "Export". In this case I think that it reasonable to assume that the user has just forgotten to unmute the track. If there is no label track: We don't know what the user is trying to do, so the longer, more detailed error message is returned.
I wasn't regarding it as a bug that having a label track (only) enables File > Export Multiple. I thought the idea was to enable that menu item when (partially) invalid in order to educate the user. That was the decision I recall when we discussed it before. The issue I was addressing was that your fix creates an apparently unnecessary (and in one case somewhat confusing) additional message box when we have an appropriate message already. What is this supposed to do? Index: src/export/ExportMultiple.cpp =================================================================== --- src/export/ExportMultiple.cpp (revision 12066) +++ src/export/ExportMultiple.cpp (working copy) 196,197c196,197 < ::wxMessageBox(_("Nothing to export.\nThe audio may be muted."), < _("Error."), --- > ::wxMessageBox(_("All the audio is muted."), > _("Unable to export"), Are you wanting to change the message at line 196 from "Nothing to export.\nThe audio may be muted." to "All the audio is muted." and the message title from "Error" to "Unable to export"? "<" , ">" and "---" doesn't look like an SVN diff and doesn't change the file. Do you want me to patch ExportMultiple.cpp manually?
(In reply to comment #10) > I wasn't regarding it as a bug that having a label track (only) enables > File > Export Multiple. "File > Export" and "File > Export Selection" are disabled if there are no audio tracks. Is there some point to enabling "Export Multiple" when there is clearly nothing o export (no audio tracks)? That seems bizarre to me. > "<" , ">" and "---" doesn't look like an SVN diff Sorry, I'm not sure of the proper way to make a patch against another patch that is not yet committed. The patch worked OK on my (Linux) machine. > Are you wanting to change the message at line 196 from > "Nothing to export.\nThe audio may be muted." > to "All the audio is muted." and the message title from > "Error" to "Unable to export"? Yes, the same as for "File > Export".
Created attachment 341 [details] combined changes in ExportMultiple-2.patch and ExportMultiple-menu.patch To make it easier to apply, this patch combines the previous two patches.
(In reply to comment #12) Case 2 1 Open Audacity 2 Add a label track and a label, then step 4. OK File > Export Multiple is now greyed out. I can certainly live with that and it's better than the potentially confusing message in your first patch. Case 4 1 Open Audacity 2 Generate tone and add any label 3 Mute the track then step 4 OK this now leads to the same "Unable to export All the audio is muted" message as File > Export and Export Selection does. But what about the case when there are only muted audio tracks on screen (no label track)? File > Export and Export Selection go to "Unable to export All the audio is muted" as expected. But File > Export Multiple is available and leads to the "Can't export multiple files" message. This does not seem logical when Case 4 (correctly) goes to "Unable to export All the audio is muted".
(In reply to comment #13) > what about the case when there are only muted audio tracks on screen (no > label track)? I'm thinking about how a user could get into this situation: * Perhaps they accidentally clicked "Export Multiple" when they meant to click "Export". * Perhaps they accidentally muted all tracks and accidentally deleted the label track. * Probably they have no idea what they are doing and need all the help they can get. Taking these into consideration I think that more extensive error message is more helpful. > what about the case when there are only muted audio tracks on screen (no > label track)? In a case where there is one muted audio track and no label track, the user has made multiple mistakes: * Export Multiple is not possible because there is only one audio track and no labels. * Export Multiple is not possible because all audio tracks are muted. The "Can't export multiple files" message is appropriate in this case. I don't think it is necessary to change the message if there is more than one muted audio track and no label track - the user probably still needs as much help as they can get.
Created attachment 342 [details] don't count muted tracks in TrackList::GetNumExportChannels Simplified previous patch by reinstating use of TrackList::GetNumExportChannels. GetNumExportChannels is only used in Export Multiple and we never export muted tracks, so I have fixed the problem there rather than replacing it in ExportMultiple.cpp
(In reply to comment #15) This should also fix bug 430.
Modified version of patch applied, r12128.
Thanks, Steve. Things still seem to be working (also now tested on Mac). > But what about the case when there are only muted audio tracks on screen (no > label track)? File > Export and Export Selection go to "Unable to export All > the audio is muted" as expected. Especially now we have an Export Multiple specific message "All the audio is muted" it would still seem more logical to me to use that message for the above case where there are: - no label tracks - more than one audio track - all those audio tracks are muted. In other words, the requirement for export multiple is met, except that all the tracks are muted. This is also true for a muted audio track (or more than one) and a label track containing at least one label, in which case they do get "Export Multiple: All the audio is muted". They thus get a clearer indication what the problem actually is. Still, it's only a point of view.
(In reply to comment #18) >> But what about the case when there are only muted audio tracks on screen (no >> label track)? File > Export and Export Selection go to "Unable to export All >> the audio is muted" as expected. > Especially now we have an Export Multiple specific message "All the audio is > muted" it would still seem more logical to me to use that message for the above > case where there are: > - no label tracks > - more than one audio track > - all those audio tracks are muted. > > In other words, the requirement for export multiple is met, except that all the > tracks are muted. This is also true for a muted audio track (or more than one) > and a label track containing at least one label, in which case they do get > "Export Multiple: All the audio is muted". They thus get a clearer indication > what the problem actually is. Scanning the code, I cannot see what you're talking about. Please give steps for this vs what you are suggesting. This thread is another that's too long.
And please, Gale, don't work against your own opinions. It confuses me as to what you think is right. If you still have issues with this, it's not RESOLVED-FIXED.
Vaughan, my point is merely an opinion. The bug as we decided to address it is fixed, even if not fixed exactly as I might personally have liked it. My point... Case 1 1 New project, add one or more audio tracks. 2 Mute all the audio tracks. 3 CTRL + B to add a label somewhere. 4 File > Export Multiple. You see a clear indication "Export Multiple: All audio is muted" that the only reason you cannot export multiple is that all the audio is muted. Case 2 1 New project, add two or more audio tracks. 2 Mute all of the audio tracks. 3 File > Export Multiple. As in case 1 you have met the requirements for export multiple, except that all the audio is muted. But instead of the clear Case 1 indication that the problem is the muted tracks, you get the entire "Cannot Export Multiple Files" text dialogue to wade through. That full "Cannot Export Multiple Files" dialogue correctly (IMO) appears when you have one muted or unmuted audio track and no labels, because you can never export multiple with only one audio track. I would argue it would be more helpful and consistent if we special-cased Case 2 to go to an "Export Multiple: All audio is muted" message. However if I'm reading it aright, your r12131 means there we don't now have an "Export Multiple: All audio is muted" message. If so I mildly disagree with that, because I think it may be handy for the user to see that they had pressed File > Export Multiple rather than the other export commands. But it's not a biggie.
> Vaughan, my point is merely an opinion. The bug as we decided to address it is > fixed, even if not fixed exactly as I might personally have liked it. I don't think it's mere opinion at all, it's a flaw in the patch, and very much a part of this bug. The problem you have clarified is a matter of where Steve chose to check for all audio being muted. The existing conditional checked for all-muted as well, and Steve put the new one after it, so if the other parts of the existing conditional were met, it went with that message instead of the one Steve added. I have changed the order of the conditionals, and think this solves the problem you pointed out. Even if it were unrelated, you'd have doomed your point to future obscurity and inattention with the RESOLVED-FIXED. Good thing I bothered to read your comment as carefully as I could. > > My point... > > Case 1 > 1 New project, add one or more audio tracks. > 2 Mute all the audio tracks. > 3 CTRL + B to add a label somewhere. > 4 File > Export Multiple. You see a clear indication "Export Multiple: All > audio is muted" that the only reason you cannot export multiple is that all the > audio is muted. > > Case 2 > 1 New project, add two or more audio tracks. > 2 Mute all of the audio tracks. > 3 File > Export Multiple. As in case 1 you have met the requirements for export > multiple, except that all the audio is muted. But instead of the clear Case 1 > indication that the problem is the muted tracks, you get the entire "Cannot > Export Multiple Files" text dialogue to wade through. I've pared that alert down substantially, because * It was absurdly wordy. * There's no point in it saying "Muted tracks will not be exported." now, because that will be caught before checking the other cited conditions for failure, my having moved the check for all-muted ahead of that one. So I removed that sentence. * Changed the sense -- i.e., rather than saying what's allowed, explain why it's not currently going to work. That's the user's concern at the time. * And the last sentence ("This project does not meet the above criteria for exporting multiple files.") was totally unnecessary given the "Cannot Export" caption. > > That full "Cannot Export Multiple Files" dialogue correctly (IMO) appears when > you have one muted or unmuted audio track and no labels, because you can never > export multiple with only one audio track. I would argue it would be more > helpful and consistent if we special-cased Case 2 to go to an "Export > Multiple: All audio is muted" message. Check it, please, and let me know if that's not the case with the new commit. Gale, I think part of why I couldn't find what you were talking about before is that when I see text in quotes, I expect it to be an actual quote. When you quote something but it's nowhere in the code, it adds a lot of overhead to me trying to figure out what you mean. Please be careful to report quotes accurately. There's no string in Audacity code that contains "Export Multiple: All Audio is muted" string in Audacity code. The alert was captioned "Cannot Export" and the message was "All the audio is muted." But hey, I'm all for reducing verbosity, so I've removed the "the"(s). :-) > > However if I'm reading it aright, your r12131 means there we don't now have an > "Export Multiple: All audio is muted" message. I had to read that one several times to figure out what you were getting at, because if you look at the mods in that rev, there's nothing about removing the "All the audio is muted" message. Rather I removed "Multiple Files" from the captions, for that alert *and* the other one. Please don't abbreviate a caption and message all in one quote string -- they're separate strings. And you were actually referring to two alerts but mentioned only the specific all-muted. Confusing. >If so I mildly disagree with > that, because I think it may be handy for the user to see that they had pressed > File > Export Multiple rather than the other export commands. But it's not a > biggie. Okay, I see your point, and added back "Multiple" rather than "Multiple Files" to both those alerts.
(In reply to comment #22) Vaughan, I like it! Thanks. The conditions under which you see the two different "Cannot Export Multiple" messages are very logical now. I'm ready to RESOLVE-FIX again, except for one point. In ExportMultiple.cpp lines 188-9 we have: \n\nIf you have more than one Label Track, Export Multiple is \ \nbased only on labels in the uppermost Label Track."), Do we need that, now we've pared the message down? AFAICT having more than one label track is never going to trigger that message, so it's just "on the side" information about how Export Multiple works rather than why the message is showing. I'm happy for you to remove that if you want, and I'll add it to the Manual. > you'd have doomed your point to future obscurity and inattention with the > RESOLVED-FIXED. As events happened, I made the same complaint about Steve's previous patch, but he disagreed with me. Then you committed Steve's next patch which had the same problem, so I thought you also disagreed with me and it would be crass to withhold resolution given the core problem was fixed (from user perspective which is my concern). Had I got to the patch before you did, I would have made my point again, and possibly it would have been easier to see why I was not marking it as "patch_ready". > There's no string in Audacity code that contains "Export Multiple: All Audio is > muted" string in Audacity code. The alert was captioned "Cannot Export" and > the message was "All the audio is muted." OK, sorry that bit was wrong. The caption was titled "Cannot Export Multiple Files" before the change in r12131. > > However if I'm reading it aright, your r12131 means there we don't now have > > an "Export Multiple: All audio is muted" message. > [...] Rather I removed "Multiple Files" from the captions, for that alert *and* the > other one. True, but the result of r12131 in the interface was to remove the dialogue captioned "Cannot Export Multiple Files" that said "All audio is muted". But thanks for reinstating "Multiple" of "Multiple Files". All this communication stuff is hard, because it's overhead for me to go into the code and point you to the spot I mean, and make sure I've understood it, just like it's overhead to you if I don't.
(In reply to comment #23) > I'm ready to > RESOLVE-FIX again, except for one point. > > In ExportMultiple.cpp lines 188-9 we have: > > \n\nIf you have more than one Label Track, Export Multiple is \ > \nbased only on labels in the uppermost Label Track."), > > Do we need that, now we've pared the message down? AFAICT having more than one > label track is never going to trigger that message, I suggest that we mark this as "fixed" because that issue is different from the bug description and this discussion is already extremely long. I agree this is a valid point, but I think it should be raised as a separate bug/enhancement and we can discus on @quality if we actually want Export Multiple to use only the first label track or all label tracks.
(In reply to comment #23) On 1/11/2013 7:34 AM, bugzilla-daemon@audacityteam.org wrote:> http://bugzilla.audacityteam.org/show_bug.cgi?id=428 > > > > --- Comment #23 from Gale Andrews <gale@audacityteam.org> 2013-01-11 15:34:52 GMT --- > (In reply to comment #22) > Vaughan, I like it! Thanks. The conditions under which you see the two > different "Cannot Export Multiple" messages are very logical now. I'm ready to > RESOLVE-FIX again, except for one point. > > In ExportMultiple.cpp lines 188-9 we have: > > \n\nIf you have more than one Label Track, Export Multiple is \ > \nbased only on labels in the uppermost Label Track."), > > Do we need that, now we've pared the message down? AFAICT having more than one > label track is never going to trigger that message, so it's just "on the side" > information about how Export Multiple works rather than why the message is > showing. I'm happy for you to remove that if you want, and I'll add it to the > Manual. Good point. I had just pared it down from the previous wording saying the same thing. Done. Thanks for your comment, Steve, but it was a half-minute change, and all 3 of us agreed. > > [...] > As events happened, I made the same complaint about Steve's previous patch, but > he disagreed with me. Then you committed Steve's next patch which had the same > problem, so I thought you also disagreed with me [...] No, I hadn't caught up on that history of the discussion. > [...] >>> However if I'm reading it aright, your r12131 means there we don't now have >>> an "Export Multiple: All audio is muted" message. >> [...] Rather I removed "Multiple Files" from the captions, for that alert *and* the >> other one. > True, but the result of r12131 in the interface was to remove the dialogue > captioned "Cannot Export Multiple Files" that said "All audio is muted". It was not removed, it was re-captioned. And you were actually talking about both alerts, so "All audio is muted" was only one of them, and therefore misleading. > > All this communication stuff is hard, because it's overhead for me to go into > the code and point you to the spot I mean, and make sure I've understood it, > just like it's overhead to you if I don't. > Did not ask you to go into the code, just asked you to be accurate when you put strings in quotes. And to talk about two alerts when you mean two alerts. Both can be done without looking at the code.
Back to RESOLVED-FIXED. :=)