Re: [Audacity-quality] Not saving projects >= 2^31 samples
A free multi-track audio editor and recorder
Brought to you by:
aosiniao
From: Steve t. F. <ste...@gm...> - 2013-10-30 14:15:29
|
On 30 October 2013 09:40, Peter Sampson <pet...@ya...> wrote: > I'm not convinced the proposed error message is entirely sensible > > telling the user that: > " No saved track may exceed 2,147,483,647 samples" > > I can see the poor user saying "2,147,483,647, two and bit billion - WTF" > > Now we all know that this number is (2^31)-1, and the reason for that, > but otherwise it just looks like some abstruse random number. > > Surely we can com up with a more meaningful error message > based, say, on the length of the recording at current settings? That's similar to my original error message, but unfortunately it gets a bit complicated because the project may contain tracks with different sample rates. A user could have one track that is 16 hours duration at 22050 Hz sample rate, and another at 7 hours duration at 96000 Hz sample rate. The project cannot be safely saved because the 7 hour track is too long (the 16 hour track is OK because of the low sample rate). Either we need to have quite a detailed message that says which track is too long, what its sample rate is, and why that is too long (because the length in samples is too great), or a brief message that says it's too long and document the issue and what to do about it in the manual. If the user does not RTM, then they can ask on the forum or feedback@, but how often does this issue come up? Using the Repeat effect on really long tracks must be pretty rare - out of the millions of Audacity users it's come up a small handful of times. We can limit the maximum length to anything we like. The "(2^31) -1" is chosen because we know that Audacity cannot open a project longer than that. Ironically we could pick a number out of the air, such as 2 billion samples, and the user will probably be happy because it seems like a "reasonable" number. There may be 2 users in the world that complain that previously they could save projects that were 2.1 billion samples long and now they can't. I agree that "2,147,483,647" looks like "WTF", but for many users, so would "(2^31) - 1". How about: "The project is too long to save. All tracks must be less than 2^31 samples (about 2.15 billion). The track may be exported instead, or cut and paste sufficient audio into a new project." > Just my 2c worth. > > Peter > > Peter Sampson > Tel: +44 (0)1625 524 780 > Mob: +44 (0)7732 278 299 > > From: Gale Andrews <ga...@au...> > To: audacity-quality <aud...@li...> > Sent: > Subject: Re: [Audacity-quality] Not saving projects >= 2^31 samples > > > | From Steve the Fiddle <ste...@gm...> > | Tue, 29 Oct 2013 01:42:47 +0000 > | Subject: [Audacity-quality] Not saving projects >= 2^31 samples >> Here's a revised (simplified) patch for preventing saving projects >> with tracks >= 2^31 samples with an error message based on Gale's >> suggestion, > > Thanks. Steve. That patch worked well for me. 2147483647 samples > in a track or tracks were allowed to save as a project and 2147483648 > samples triggered the error. > > For the error text I prefer: > > "The project is too long to save.\nNo saved track may exceed 2,147,483,647 > samples.\n\nExport the track(s) instead, or cut and paste\nsufficient > audio into a new project." > > to > > "The project is too long to save.\nNo track may exceed 2,147,483,647 > samples.\n\nThe track may be exported instead, or cut\nand paste > sufficient audio into a new project." > > Clearer in the second sentence. And perhaps less of a grammatical > mix in the third sentence. Yes I prefer that, but with due consideration to Peter's comment above. > >> I've also attached a patch for the "Repeat" effect issue that Gale raised. > > That seems to have fixed the issue, thanks. Good, I'll put that on bugzilla. > I don't know if the following issue in Repeat can be handled better > (Repeat as currently committed does it too). > > 1 New 44100 Hz project. > 2 Generate tone 30 seconds, Effect > Repeat... 10 times. > 3 New track, Generate tone 2 hours. > 4 Effect > Repeat and you are offered the last number of > repeats (10) for a total new selection length of 22 hours > but running the effect of course only gives you five repeats > for a total of 12 hours. > > Personally I would prefer step 4 to modify the displayed number > of repeats to those it can provide, if the last number of repeats > would exceed the length limit. I noticed that and wasn't overly impressed either, so I've already had a quick look and it's not straightforward to fix. From a programming standpoint I think that the best "fix" would be to use Leland's new validation code, but that would be worse from a user perspective because if the user tried to enter a number that is too big then it would just beep at them. I think that the plug-in needs to display a message in the plug-in GUI indicating the maximum number of repeats allowed, whenever the number of requested repeats is greater than the number of allowed repeats. Thus, in your example, the previous number of repeats was 10, so that counts as "requested number" and is changed automatically to 5 and the message displayed. I think this is possible, but would require quite extensive changes to the "Repeat" code. I'd rate this as a P5 enhancement. It could go on bugzilla or the forum FR board so that it does not get forgotten, but let's get these other two enhancements done first. Steve > > Gale > > >> On 29 October 2013 00:46, Steve the Fiddle <ste...@gm...> >> wrote: >> > On 28 October 2013 23:43, Gale Andrews <ga...@au...> wrote: >> >> >> >> | From Steve the Fiddle <ste...@gm...> >> >> | Mon, 28 Oct 2013 20:56:47 +0000 >> >> | Subject: [Audacity-quality] Not saving projects >= 2^31 samples >> >>> On 28 October 2013 20:09, Gale Andrews <ga...@au...> wrote: >> >>> > >> >>> > | From Steve the Fiddle <ste...@gm...> >> >>> > | Mon, 28 Oct 2013 19:15:23 +0000 >> >>> > | Subject: [Audacity-quality] Not saving projects >= 2^31 samples >> >>> >> It was suggested on the forum that it could be beneficial for >> >>> >> Audacity >> >>> >> to refuse to save projects that are longer than 2147483647 samples >> >>> >> and >> >>> >> show an appropriate error message (since Audacity is currently >> >>> >> unable >> >>> >> to open the project again). >> >>> >> >> >>> >> I've written a patch to do this. >> >>> > >> >>> > Thanks for that. >> >>> > >> >>> > >> >>> >> 1) is it agreed that this is a good idea (until such time as the >> >>> >> problems with longer projects are resolved)? >> >>> > >> >>> > +1 (it was my suggestion). I've spent long hours helping users >> >>> > recover recordings that were over the above sample count >> >>> > but not exported before saving and closing the project. >> >>> > >> >>> > >> >>> >> 2) What should the error message be? >> >>> > >> >>> > Something like: >> >>> > >> >>> > "Audacity cannot save projects containing more than >> >>> > 2,147,483,647 audio samples. >> >>> > >> >>> > Please export the audio instead, or copy and paste >> >>> > sufficient audio to a new project window." >> >>> >> >>> Thanks Gale, >> >>> The patch will probably need a bit of tweaking depending on the exact >> >>> error message and how rigorous we want to be with the checking. >> >>> >> >>> The limitation of 2,147,483,647 samples I believe refers to the >> >>> maximum number of samples _in_a_waveclip_. >> >>> Checking each waveclip may be more rigorous than we actually need, and >> >>> certainly makes the error message more complicated if we want the >> >>> message to be accurate. >> >>> >> >>> Audacity projects with more than 2^31 samples can be opened _provided_ >> >>> that there are no single audio clips with greater than (2^31 - 1) >> >>> samples. >> >> >> >> OK, thanks for looking into that. >> >> >> >> I don't know if you've done so, but I tested two 8 hour tracks in a >> >> 44100 Hz project. I crashed that project deliberately before saving, >> >> and it recovered correctly, and I saved and reopened it correctly. >> >> >> >> The reason I still assumed the problem was with total audio in the >> >> project was because the warning message for Repeat works on >> >> the basis of total project audio. >> >> >> >> 1 New project 44100 Hz. >> >> 2 Create a 3.5 hours tone. >> >> 3 Repeat one time, giving 7 hours in that track. >> >> 4 Double-click the first 3.5 hours clip, Edit > Duplicate. >> >> 5 Effect > Repeat... >> >> 6 Result: "Tracks are too long to repeat the selection." >> >> >> >> That message at step 6 seems wrong given the project reopening >> >> restriction is only per track. I should be allowed to repeat the >> >> second track once. >> > >> > Yes, the error is incorrect on 2 counts: >> > 1) It assumes that the repeat will affect the longest track, which is >> > only true if either the longest track is selected or Sync Lock is >> > active. >> > 2) It is checking to see if the "maximum number of repeats" is >> > "maxCount <= 1", but should be checking if "maxCount < 1". >> > >> > If you want to raise a bug for this, I think I can make a fix. >> > >> > >> >> >> >> >> >>> Do we want to go into that much detail or just base the restriction >> >>> on the total length of the project, or the total length of the longest >> >>> track (in samples)? >> >>> >> >>> Perhaps something like: >> >>> ------------------------------ >> >>> The project is too long to save. >> >>> The longest track in the project is hh:mm:ss >> >>> >> >>> For a sample rate of <track rate> Hz, the longest >> >>> allowed track is hh:mm:ss. >> >>> >> >>> The track may be exported instead, or cut >> >>> and paste sufficient audio into a new project. >> >>> ------------------------------ >> >>> >> >>> "<track rate>" would be the sample rate of the track >> >>> that has the greatest length (in samples). >> >> >> >> I thought of mentioning track rate even when I thought total audio >> >> was the problem, but it seems complex to mention it. >> >> >> >> If the user has two tracks at different rates, both over the (2^31- 1) >> >> count, then your suggested message could be misinterpreted. That's >> >> unless we itemise each track that is too long and the maximum length >> >> it can have at its current rate. >> >> >> >> I don't get a lot of user misunderstanding if I mention audio samples >> >> when this problem occurs. It may be better just to say that no >> >> track may exceed 2,147,483,647 samples. >> > >> > That makes the patch a lot more simple. >> > I'll rework the patch to that effect. >> > >> > Steve >> > >> > >> >> >> >> And have a FAQ explaining in more detail what to do and what >> >> format you can export to. >> >> >> >> >> >> >> >> Gale >> >> >> >>> > We could add text about this being just over 13.5 hours at 44100 >> >>> > Hz project rate, and less time for higher rates. But probably >> >>> > better to have this as an "Opening and saving files" FAQ in the >> >>> > Manual. >> >>> > >> >>> > The FAQ could give help on what format to export to. Most people >> >>> > seem happy with MP3. I've not tested extensively, but FLAC should >> >>> > not have length limits AFAIK, and for PCM, I believe RF64 in "Other >> >>> > uncompressed files" can be used. Have I got that right? >> >>> > >> >>> > As a possible tweak, could Audacity display the total length of >> >>> > audio in the project, possibly in the Status Bar? Users have asked >> >>> > for this, for other reasons. Would that be <current selection >> >>> > format>( n samples), omitting <current selection format> if that >> >>> > was already samples? >> >>> > >> >>> > >> >>> > >> >>> > Gale >> >> |