beep on completion of batch processing

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.
Edgar
Forum Crew
Posts: 2041
Joined: Thu Sep 03, 2009 9:13 pm
Operating System: Windows 10

beep on completion of batch processing

Post by Edgar » Mon May 20, 2013 11:55 pm

Since Batch Processing does not use the default Progress Dialog it does not give an audible signal when it is done processing. The attached patch adds this ability when applying a chain to a file list; I chose not to add the signal when applying a chain to a single project, if this feature is desired I could add it.

The patch is a tiny bit complicated because it adds a new source and header file; only the Windows project is patched to include these new files Mac and Linux users will need to add the files to the build scripts.
Attachments
BoC01.patch
(144.89 KiB) Downloaded 235 times

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

Re: beep on completion of batch processing

Post by Gale Andrews » Tue May 21, 2013 6:15 am

Edgar wrote:Since Batch Processing does not use the default Progress Dialog it does not give an audible signal when it is done processing. The attached patch adds this ability when applying a chain to a file list; I chose not to add the signal when applying a chain to a single project, if this feature is desired I could add it.

The patch is a tiny bit complicated because it adds a new source and header file; only the Windows project is patched to include these new files Mac and Linux users will need to add the files to the build scripts.
Does beep work on your machine, Ed? It doesn't work for me on my Windows 7 laptop or Ubuntu 13.04 netbook (yes I know the progress dialogue has to last 60 seconds or longer and the beep has to be turned on in Preferences). The last time I switched on the beep and heard it, I had an old Desktop model that still did a beep on boot.

Setting BeepFileName in audacity.cfg does not help either. There is no sound played according to the Windows or Ubuntu playback meters.

Apart from that, I'm not clear why the beep does not already happen for progress dialogues for a particular step of the Chain which last longer than 60 seconds (or whatever is set in .cfg). These dialogues look like normal progress dialogues.

Also I see you give the beep on removing tracks, but what if there is another file to come in the file list? Is there a beep for each file completed?

If we wanted this, yes I think it should beep at the end of a Chain applied to the project as well. But we want to find out why beep is not audible first.



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

Edgar
Forum Crew
Posts: 2041
Joined: Thu Sep 03, 2009 9:13 pm
Operating System: Windows 10

Re: beep on completion of batch processing

Post by Edgar » Tue May 21, 2013 4:56 pm

Gale Andrews wrote: Does beep work on your machine
Setting BeepFileName in audacity.cfg does not help either.
"Hardware beep" works on my machine but the "beep" that Audacity uses has nothing to do with that it is a wxWidgets function that just plays a sound; in the Audacity default the sound is made up as an array, as you know you can also play a wave file. The Audacity "beep" works just fine here on my machine tested against 2.0 release and SVN HEAD.
Gale Andrews wrote: I'm not clear why the beep does not already happen for progress dialogues for a particular step of the Chain which last longer than 60 seconds (or whatever is set in .cfg). These dialogues look like normal progress dialogues.
Within any chain any Effect which throws up a default Progress Dialog will Beep if the duration exceeds the limit; however, the chain itself, when finished, does not Beep.
Gale Andrews wrote: Also I see you give the beep on removing tracks, but what if there is another file to come in the file list? Is there a beep for each file completed?
Mine actually only Beeps after deleting the final track in a list of tracks.
Gale Andrews wrote: If we wanted this, yes I think it should beep at the end of a Chain applied to the project as well. But we want to find out why beep is not audible first.
I have never used chains when applied to only a single project so had not given that one any thought; in my experience (probably unusual) the chains I use only apply one effect and then save the result so doing so to a project makes little sense. It would be easy to add this kind of beep but I will not have time today to mess with it.

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

Re: beep on completion of batch processing

Post by Gale Andrews » Wed May 22, 2013 8:48 am

Edgar wrote:
Gale Andrews wrote: Does beep work on your machine
Setting BeepFileName in audacity.cfg does not help either.
"Hardware beep" works on my machine but the "beep" that Audacity uses has nothing to do with that it is a wxWidgets function that just plays a sound; in the Audacity default the sound is made up as an array, as you know you can also play a wave file. The Audacity "beep" works just fine here on my machine tested against 2.0 release and SVN HEAD.
Hmm, I know the Audacity beep is not supposed to be a hardware beep, but you have hardware beep like I used to, and for you it works...
Edgar wrote:
Gale Andrews wrote:I'm not clear why the beep does not already happen for progress dialogues for a particular step of the Chain which last longer than 60 seconds (or whatever is set in .cfg). These dialogues look like normal progress dialogues.
Within any chain any Effect which throws up a default Progress Dialog will Beep if the duration exceeds the limit; however, the chain itself, when finished, does not Beep.
You mean, unless it's the Chain for the last file in the list?

Ideally I would have thought that for Chains, you don't want to hear beeps for individual progress dialogues within the Chain, otherwise that rather defeats the purpose - you'd be running back to Audacity erroneously thinking the Chain had completed.
Edgar wrote:
Gale Andrews wrote: Also I see you give the beep on removing tracks, but what if there is another file to come in the file list? Is there a beep for each file completed?
Mine actually only Beeps after deleting the final track in a list of tracks.
Odd, if there is no distinction in the code between remove tracks at the end of an individual processing of a file and at the last file processing in the series, but beeping only after the last file seems to be much more intuitive.
Edgar wrote:I have never used chains when applied to only a single project so had not given that one any thought; in my experience (probably unusual) the chains I use only apply one effect and then save the result so doing so to a project makes little sense. It would be easy to add this kind of beep but I will not have time today to mess with it.
I am sure it would be useful to those who run a large number of effects on their project chain, but less so if individual dialogues within the Chain beep.


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

Edgar
Forum Crew
Posts: 2041
Joined: Thu Sep 03, 2009 9:13 pm
Operating System: Windows 10

Re: beep on completion of batch processing

Post by Edgar » Wed May 22, 2013 2:57 pm

Gale Andrews wrote:
Edgar wrote:
Gale Andrews wrote: Does beep work on your machine
"Hardware beep" works on my machine
Hmm, I know the Audacity beep is not supposed to be a hardware beep, but you have hardware beep like I used to, and for you it works...
I could write a little tiny app built on wxWidgets which does nothing but play a specifically located wave file to test your hardware…
Gale Andrews wrote:
Edgar wrote:
Gale Andrews wrote:I'm not clear why the beep does not already happen for progress dialogues for a particular step of the Chain which last longer than 60 seconds (or whatever is set in .cfg). These dialogues look like normal progress dialogues.
Within any chain any Effect which throws up a default Progress Dialog will Beep if the duration exceeds the limit; however, the chain itself, when finished, does not Beep.
You mean, unless it's the Chain for the last file in the list?
The current behavior without my patch is that the chain progress dialog (which is different from a default Progress Dialog) never beeps; with the originally posted patch the Progress Dialog would beep during long operations as usual but after completing the final file in the chain the chain progress dialog would beep.
Gale Andrews wrote: Ideally I would have thought that for Chains, you don't want to hear beeps for individual progress dialogues within the Chain, otherwise that rather defeats the purpose - you'd be running back to Audacity erroneously thinking the Chain had completed.
You are very right - I rarely process long files as part of a chain so this had not yet annoyed me enough to change the behavior. I will make this behavior part of the code the next time I touch it.

Edgar
Forum Crew
Posts: 2041
Joined: Thu Sep 03, 2009 9:13 pm
Operating System: Windows 10

beep failure

Post by Edgar » Wed May 22, 2013 7:14 pm

In debugging my code to add Beep to chains I noticed some potentially troubling math in the Progress Dialog code. Here is a very simple patch which might cure the problem:

Code: Select all

===================================================================
--- src/widgets/ProgressDialog.cpp	(revision 12339)
+++ src/widgets/ProgressDialog.cpp	(working copy)
@@ -1500,8 +1500,8 @@
    gPrefs->Read(wxT("/GUI/BeepOnCompletion"), &should, false);
    gPrefs->Read(wxT("/GUI/BeepAfterDuration"), &after, 60);
    gPrefs->Read(wxT("/GUI/BeepFileName"), &name, wxEmptyString);
-
-   if (should && wxGetLocalTimeMillis().GetValue() - mStartTime > after * 1000)
+   wxLongLong longAfter = after;
+   if (should && ((wxGetLocalTimeMillis().GetValue() - mStartTime) > (longAfter * 1000)))
    {
       wxBusyCursor busy;
       wxSound s;
Attachments
beepMath.patch
(684 Bytes) Downloaded 185 times

Edgar
Forum Crew
Posts: 2041
Joined: Thu Sep 03, 2009 9:13 pm
Operating System: Windows 10

Re: beep on completion of batch processing

Post by Edgar » Wed May 22, 2013 7:24 pm

Here is a new patch which I think addresses all the questions and concerns. It works for both "current project" and "to files"; it also honors the "duration" setting in both instances and plays the "named in preferences" soundbite if it is there. It uses the "new math" as per the patch I posted in "Elves".

A word of warning, when testing long duration files do not use Nyquist Effects as part of the Chain as some of the Nyquist Effects seem to crash Audacity when trying to process large files.
Attachments
BoC03.patch
(147.38 KiB) Downloaded 201 times

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

Re: beep failure

Post by steve » Wed May 22, 2013 7:32 pm

Is this likely to have any effect on Linux where currently beeps don't work at all in Audacity?

Edgar
Forum Crew
Posts: 2041
Joined: Thu Sep 03, 2009 9:13 pm
Operating System: Windows 10

Re: beep failure

Post by Edgar » Wed May 22, 2013 9:36 pm

steve wrote:Is this likely to have any effect on Linux where currently beeps don't work at all in Audacity?
It might as I was getting negative values from the math when it should have been positive. Audacity does not use a "system" beep but instead plays a wxSound constructed from an array or wave file. wxSound should work fine on all 2 platforms AFAIK.
From the 2.8 wxDocs:
wxSound
This class represents a short sound (loaded from Windows WAV file), that can be stored in memory and played. Currently this class is implemented on Windows and Unix (and uses either Open Sound System or Simple DirectMedia Layer).

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

Re: beep failure

Post by steve » Wed May 22, 2013 10:29 pm

No beep on Linux with or without your patch.
This looked hopeful as an explanation, but it is marked invalid : http://trac.wxwidgets.org/ticket/14899

Locked