Compare commits
17 Commits
| Author | SHA1 | Date | |
|---|---|---|---|
| be0f6a9f56 | |||
| 35874f5ca2 | |||
| a7fdfce094 | |||
| 5947c9a020 | |||
| 05408915b1 | |||
| 4635b5af0f | |||
| b362217d75 | |||
| cc48d49b5c | |||
| 391e54b993 | |||
| 49b6a92865 | |||
| fbe05367fa | |||
| eaf3080859 | |||
| 6ceec9ef85 | |||
| ac73711122 | |||
| 3cb0471027 | |||
| 38e7434730 | |||
| d8cd72809c |
@@ -27,6 +27,7 @@ From here on much is controlled by key presses.
|
||||
* Press and hold "R" to record a new phrase - the screen flashes red while it's recording. The phrase is
|
||||
appended to the currently selected chapter, or to the last chapter if none is selected.
|
||||
* Press and hold "T" to record a new phrase that is the start of a new paragraph. This adds the "post paragraph" gap to the previous sentence. Otherwise it does the same as "R".
|
||||
* Press and hold "F" to record a "continuation" phrase. This sets the previous phrase's post-gap to be the "short" gap instead of the normal length gap.
|
||||
* Press "D" to delete the last phrase you recorded.
|
||||
* Press "E" to re-record the currently selected phrase.
|
||||
|
||||
|
||||
76
iircoeff
76
iircoeff
@@ -1,76 +0,0 @@
|
||||
#!/usr/bin/perl
|
||||
|
||||
use Math::Trig;
|
||||
|
||||
my $fs = 96000;
|
||||
|
||||
printCo(0, 20, 25, $fs);
|
||||
printCo(20, 25, 31.5, $fs);
|
||||
printCo(25, 31.5, 40, $fs);
|
||||
printCo(31.5, 40, 50, $fs);
|
||||
printCo(40, 50, 63, $fs);
|
||||
printCo(50, 63, 80, $fs);
|
||||
printCo(63, 80, 100, $fs);
|
||||
printCo(80, 100, 125, $fs);
|
||||
printCo(100, 125, 160, $fs);
|
||||
printCo(125, 160, 200, $fs);
|
||||
printCo(160, 200, 250, $fs);
|
||||
printCo(200, 250, 315, $fs);
|
||||
printCo(250, 315, 400, $fs);
|
||||
printCo(315, 400, 500, $fs);
|
||||
printCo(400, 500, 630, $fs);
|
||||
printCo(500, 630, 800, $fs);
|
||||
printCo(630, 800, 1000, $fs);
|
||||
printCo(800, 1000, 1250, $fs);
|
||||
printCo(1000, 1250, 1600, $fs);
|
||||
printCo(1250, 1600, 2000, $fs);
|
||||
printCo(1600, 2000, 2500, $fs);
|
||||
printCo(2000, 2500, 3150, $fs);
|
||||
printCo(2500, 3150, 4000, $fs);
|
||||
printCo(3150, 4000, 5000, $fs);
|
||||
printCo(4000, 5000, 6300, $fs);
|
||||
printCo(5000, 6300, 8000, $fs);
|
||||
printCo(6300, 8000, 10000, $fs);
|
||||
printCo(8000, 10000, 12500, $fs);
|
||||
printCo(10000, 12500, 16000, $fs);
|
||||
printCo(12500, 16000, 20000, $fs);
|
||||
printCo(16000, 20000, $fs / 2, $fs);
|
||||
|
||||
sub printCo($$$$) {
|
||||
my $fl = shift;
|
||||
my $f0 = shift;
|
||||
my $fh = shift;
|
||||
my $fs = shift;
|
||||
|
||||
my $f1 = $f0 - (($f0 - $fl) / 2);
|
||||
my $f2 = $f0 + (($fh - $f0) / 2);
|
||||
|
||||
@coeff = coefficient($f0, $fs, $f1, $f2);
|
||||
print "/* $f0 Hz */\n";
|
||||
printf("new IIRCoefficients(%.10e, %.10e, %.10e),\n" , $coeff[1] * 2, $coeff[0] * 2, $coeff[2] * 2);
|
||||
}
|
||||
|
||||
|
||||
sub coefficient($$$$) {
|
||||
my $f0 = shift;
|
||||
my $fs = shift;
|
||||
my $f1 = shift;
|
||||
my $f2 = shift;
|
||||
|
||||
my $q = $f0 / ($f2 - $f1);
|
||||
|
||||
my $pi = 3.141592653;
|
||||
|
||||
my $theta0 = 2 * $pi * ($f0 / $fs);
|
||||
|
||||
my $thetaOverTwoQ = $theta0 / (2 * $q);
|
||||
|
||||
my $beta = 0.5 * ((1 - tan($thetaOverTwoQ)) / (1 + tan($thetaOverTwoQ)));
|
||||
|
||||
my $gamma = (0.5 + $beta) * cos($theta0);
|
||||
|
||||
my $alpha = (0.5 - $beta) / 2;
|
||||
|
||||
return ($alpha, $beta, $gamma);
|
||||
}
|
||||
|
||||
133
iircoeff.c
Normal file
133
iircoeff.c
Normal file
@@ -0,0 +1,133 @@
|
||||
/*
|
||||
* Copyright (C) 2002-2006 Felipe Rivera <liebremx at users.sourceforge.net>
|
||||
*
|
||||
* This program is free software; you can redistribute it and/or modify
|
||||
* it under the terms of the GNU General Public License as published by
|
||||
* the Free Software Foundation; either version 2 of the License, or
|
||||
* (at your option) any later version.
|
||||
*
|
||||
* This program is distributed in the hope that it will be useful,
|
||||
* but WITHOUT ANY WARRANTY; without even the implied warranty of
|
||||
* MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
|
||||
* GNU General Public License for more details.
|
||||
*
|
||||
* You should have received a copy of the GNU General Public License
|
||||
* along with this program; if not, write to the Free Software
|
||||
* Foundation, Inc., 675 Mass Ave, Cambridge, MA 02139, USA.
|
||||
*
|
||||
*
|
||||
* Coefficient stuff
|
||||
*
|
||||
* $Id: iir_cfs.c,v 1.2 2006/01/15 00:17:46 liebremx Exp $
|
||||
*/
|
||||
|
||||
#include <stdio.h>
|
||||
#include <stdlib.h>
|
||||
#include <math.h>
|
||||
|
||||
static const double band_f031[] =
|
||||
{ 20,25,31.5,40,50,63,80,100,125,160,200,250,315,400,500,630,800,
|
||||
1000,1250,1600,2000,2500,3150,4000,5000,6300,8000,10000,12500,16000,20000
|
||||
};
|
||||
|
||||
#define GAIN_F0 1.0
|
||||
#define GAIN_F1 GAIN_F0 / M_SQRT2
|
||||
|
||||
#define SAMPLING_FREQ 44100.0
|
||||
#define TETA(f) (2*M_PI*(double)f/sample_frequency)
|
||||
#define TWOPOWER(value) (value * value)
|
||||
|
||||
#define BETA2(tf0, tf) \
|
||||
(TWOPOWER(GAIN_F1)*TWOPOWER(cos(tf0)) \
|
||||
- 2.0 * TWOPOWER(GAIN_F1) * cos(tf) * cos(tf0) \
|
||||
+ TWOPOWER(GAIN_F1) \
|
||||
- TWOPOWER(GAIN_F0) * TWOPOWER(sin(tf)))
|
||||
#define BETA1(tf0, tf) \
|
||||
(2.0 * TWOPOWER(GAIN_F1) * TWOPOWER(cos(tf)) \
|
||||
+ TWOPOWER(GAIN_F1) * TWOPOWER(cos(tf0)) \
|
||||
- 2.0 * TWOPOWER(GAIN_F1) * cos(tf) * cos(tf0) \
|
||||
- TWOPOWER(GAIN_F1) + TWOPOWER(GAIN_F0) * TWOPOWER(sin(tf)))
|
||||
#define BETA0(tf0, tf) \
|
||||
(0.25 * TWOPOWER(GAIN_F1) * TWOPOWER(cos(tf0)) \
|
||||
- 0.5 * TWOPOWER(GAIN_F1) * cos(tf) * cos(tf0) \
|
||||
+ 0.25 * TWOPOWER(GAIN_F1) \
|
||||
- 0.25 * TWOPOWER(GAIN_F0) * TWOPOWER(sin(tf)))
|
||||
|
||||
#define GAMMA(beta, tf0) ((0.5 + beta) * cos(tf0))
|
||||
#define ALPHA(beta) ((0.5 - beta)/2.0)
|
||||
|
||||
/*************
|
||||
* Functions *
|
||||
*************/
|
||||
|
||||
/* Get the band_f031 at both sides of F0. These will be cut at -3dB */
|
||||
static void find_f1_and_f2(double f0, double octave_percent, double *f1, double *f2)
|
||||
{
|
||||
double octave_factor = pow(2.0, octave_percent/2.0);
|
||||
*f1 = f0/octave_factor;
|
||||
*f2 = f0*octave_factor;
|
||||
}
|
||||
|
||||
/* Find the quadratic root
|
||||
* Always return the smallest root */
|
||||
static int find_root(double a, double b, double c, double *x0) {
|
||||
double k = c-((b*b)/(4.*a));
|
||||
double h = -(b/(2.*a));
|
||||
double x1 = 0.;
|
||||
if (-(k/a) < 0.)
|
||||
return -1;
|
||||
*x0 = h - sqrt(-(k/a));
|
||||
x1 = h + sqrt(-(k/a));
|
||||
if (x1 < *x0)
|
||||
*x0 = x1;
|
||||
return 0;
|
||||
}
|
||||
|
||||
void calc_coeffs(double sample_frequency)
|
||||
{
|
||||
int i, n;
|
||||
double f1, f2;
|
||||
double x0;
|
||||
|
||||
printf(" public final static IIRCoefficients iir_cf31_%d[] = {\n", (int)sample_frequency);
|
||||
for (i = 0; i < 31; i++) {
|
||||
|
||||
/* Find -3dB frequencies for the center freq */
|
||||
find_f1_and_f2(band_f031[i], 1.0/3.0, &f1, &f2);
|
||||
/* Find Beta */
|
||||
if ( find_root(
|
||||
BETA2(TETA(band_f031[i]), TETA(f1)),
|
||||
BETA1(TETA(band_f031[i]), TETA(f1)),
|
||||
BETA0(TETA(band_f031[i]), TETA(f1)),
|
||||
&x0) == 0)
|
||||
{
|
||||
/* Got a solution, now calculate the rest of the factors */
|
||||
/* Take the smallest root always (find_root returns the smallest one)
|
||||
*
|
||||
* NOTE: The IIR equation is
|
||||
* y[n] = 2 * (alpha*(x[n]-x[n-2]) + gamma*y[n-1] - beta*y[n-2])
|
||||
* Now the 2 factor has been distributed in the coefficients
|
||||
*/
|
||||
/* Now store the coefficients */
|
||||
printf(" /* %.1f Hz */\n", band_f031[i]);
|
||||
printf(" new IIRCoefficients(%.10e, %010e, %.10e),\n",
|
||||
(double)(2.0 * x0),
|
||||
(double)(2.0 * ALPHA(x0)),
|
||||
(double)(2.0 * GAMMA(x0, TETA(band_f031[i])))
|
||||
);
|
||||
} else {
|
||||
printf(" **** Where are the roots?\n");
|
||||
}
|
||||
}// for i
|
||||
printf(" };\n");
|
||||
}
|
||||
|
||||
int main(int argc, char **argv) {
|
||||
if (argc != 2) {
|
||||
printf("Usage: iircoeff <sample frequency>\n");
|
||||
return -1;
|
||||
}
|
||||
|
||||
double f = strtod(argv[1], NULL);
|
||||
calc_coeffs(f);
|
||||
}
|
||||
76
iircoeff.pl
Executable file
76
iircoeff.pl
Executable file
@@ -0,0 +1,76 @@
|
||||
#!/usr/bin/perl
|
||||
|
||||
use Math::Trig;
|
||||
|
||||
my $fs = 48000;
|
||||
my $q = 1.414;
|
||||
|
||||
printCo(20, $fs, $q);
|
||||
printCo(25, $fs, $q);
|
||||
printCo(31.5, $fs, $q);
|
||||
printCo(40, $fs, $q);
|
||||
printCo(50, $fs, $q);
|
||||
printCo(63, $fs, $q);
|
||||
printCo(80, $fs, $q);
|
||||
printCo(100, $fs, $q);
|
||||
printCo(125, $fs, $q);
|
||||
printCo(160, $fs, $q);
|
||||
printCo(200, $fs, $q);
|
||||
printCo(250, $fs, $q);
|
||||
printCo(315, $fs, $q);
|
||||
printCo(400, $fs, $q);
|
||||
printCo(500, $fs, $q);
|
||||
printCo(630, $fs, $q);
|
||||
printCo(800, $fs, $q);
|
||||
printCo(1000, $fs, $q);
|
||||
printCo(1250, $fs, $q);
|
||||
printCo(1600, $fs, $q);
|
||||
printCo(2000, $fs, $q);
|
||||
printCo(2500, $fs, $q);
|
||||
printCo(3150, $fs, $q);
|
||||
printCo(4000, $fs, $q);
|
||||
printCo(5000, $fs, $q);
|
||||
printCo(6300, $fs, $q);
|
||||
printCo(8000, $fs, $q);
|
||||
printCo(10000, $fs, $q);
|
||||
printCo(12500, $fs, $q);
|
||||
printCo(16000, $fs, $q);
|
||||
printCo(20000, $fs, $q);
|
||||
|
||||
sub printCo($$$$) {
|
||||
my $f0 = shift;
|
||||
my $fs = shift;
|
||||
my $q = shift;
|
||||
|
||||
|
||||
@coeff = coefficient($f0, $fs, $q);
|
||||
print "/* $f0 Hz */\n";
|
||||
printf("new IIRCoefficients(%.10e, %.10e, %.10e),\n" , $coeff[1] * 2, $coeff[0] * 2, $coeff[2] * 2);
|
||||
}
|
||||
|
||||
|
||||
sub coefficient($$$$) {
|
||||
my $f0 = shift;
|
||||
my $fs = shift;
|
||||
my $q = shift;
|
||||
|
||||
my $q2 = $q * $q;
|
||||
|
||||
my $f1 = $f0 * (sqrt(1 + (1 / (4 * $q2))) - (1 / (2 * $q)));
|
||||
my $f2 = $f0 * (sqrt(1 + (1 / (4 * $q2))) + (1 / (2 * $q)));
|
||||
|
||||
my $pi = 3.141592653;
|
||||
|
||||
my $theta0 = 2 * $pi * ($f0 / $fs);
|
||||
|
||||
my $thetaOverTwoQ = $theta0 / (2 * $q);
|
||||
|
||||
my $beta = 0.5 * ((1 - tan($thetaOverTwoQ)) / (1 + tan($thetaOverTwoQ)));
|
||||
|
||||
my $gamma = (0.5 + $beta) * cos($theta0);
|
||||
|
||||
my $alpha = (0.5 - $beta) / 2;
|
||||
|
||||
return ($alpha, $beta, $gamma);
|
||||
}
|
||||
|
||||
504
licenses/jeq/lgpl.txt
Normal file
504
licenses/jeq/lgpl.txt
Normal file
@@ -0,0 +1,504 @@
|
||||
GNU LESSER GENERAL PUBLIC LICENSE
|
||||
Version 2.1, February 1999
|
||||
|
||||
Copyright (C) 1991, 1999 Free Software Foundation, Inc.
|
||||
59 Temple Place, Suite 330, Boston, MA 02111-1307 USA
|
||||
Everyone is permitted to copy and distribute verbatim copies
|
||||
of this license document, but changing it is not allowed.
|
||||
|
||||
[This is the first released version of the Lesser GPL. It also counts
|
||||
as the successor of the GNU Library Public License, version 2, hence
|
||||
the version number 2.1.]
|
||||
|
||||
Preamble
|
||||
|
||||
The licenses for most software are designed to take away your
|
||||
freedom to share and change it. By contrast, the GNU General Public
|
||||
Licenses are intended to guarantee your freedom to share and change
|
||||
free software--to make sure the software is free for all its users.
|
||||
|
||||
This license, the Lesser General Public License, applies to some
|
||||
specially designated software packages--typically libraries--of the
|
||||
Free Software Foundation and other authors who decide to use it. You
|
||||
can use it too, but we suggest you first think carefully about whether
|
||||
this license or the ordinary General Public License is the better
|
||||
strategy to use in any particular case, based on the explanations below.
|
||||
|
||||
When we speak of free software, we are referring to freedom of use,
|
||||
not price. Our General Public Licenses are designed to make sure that
|
||||
you have the freedom to distribute copies of free software (and charge
|
||||
for this service if you wish); that you receive source code or can get
|
||||
it if you want it; that you can change the software and use pieces of
|
||||
it in new free programs; and that you are informed that you can do
|
||||
these things.
|
||||
|
||||
To protect your rights, we need to make restrictions that forbid
|
||||
distributors to deny you these rights or to ask you to surrender these
|
||||
rights. These restrictions translate to certain responsibilities for
|
||||
you if you distribute copies of the library or if you modify it.
|
||||
|
||||
For example, if you distribute copies of the library, whether gratis
|
||||
or for a fee, you must give the recipients all the rights that we gave
|
||||
you. You must make sure that they, too, receive or can get the source
|
||||
code. If you link other code with the library, you must provide
|
||||
complete object files to the recipients, so that they can relink them
|
||||
with the library after making changes to the library and recompiling
|
||||
it. And you must show them these terms so they know their rights.
|
||||
|
||||
We protect your rights with a two-step method: (1) we copyright the
|
||||
library, and (2) we offer you this license, which gives you legal
|
||||
permission to copy, distribute and/or modify the library.
|
||||
|
||||
To protect each distributor, we want to make it very clear that
|
||||
there is no warranty for the free library. Also, if the library is
|
||||
modified by someone else and passed on, the recipients should know
|
||||
that what they have is not the original version, so that the original
|
||||
author's reputation will not be affected by problems that might be
|
||||
introduced by others.
|
||||
|
||||
Finally, software patents pose a constant threat to the existence of
|
||||
any free program. We wish to make sure that a company cannot
|
||||
effectively restrict the users of a free program by obtaining a
|
||||
restrictive license from a patent holder. Therefore, we insist that
|
||||
any patent license obtained for a version of the library must be
|
||||
consistent with the full freedom of use specified in this license.
|
||||
|
||||
Most GNU software, including some libraries, is covered by the
|
||||
ordinary GNU General Public License. This license, the GNU Lesser
|
||||
General Public License, applies to certain designated libraries, and
|
||||
is quite different from the ordinary General Public License. We use
|
||||
this license for certain libraries in order to permit linking those
|
||||
libraries into non-free programs.
|
||||
|
||||
When a program is linked with a library, whether statically or using
|
||||
a shared library, the combination of the two is legally speaking a
|
||||
combined work, a derivative of the original library. The ordinary
|
||||
General Public License therefore permits such linking only if the
|
||||
entire combination fits its criteria of freedom. The Lesser General
|
||||
Public License permits more lax criteria for linking other code with
|
||||
the library.
|
||||
|
||||
We call this license the "Lesser" General Public License because it
|
||||
does Less to protect the user's freedom than the ordinary General
|
||||
Public License. It also provides other free software developers Less
|
||||
of an advantage over competing non-free programs. These disadvantages
|
||||
are the reason we use the ordinary General Public License for many
|
||||
libraries. However, the Lesser license provides advantages in certain
|
||||
special circumstances.
|
||||
|
||||
For example, on rare occasions, there may be a special need to
|
||||
encourage the widest possible use of a certain library, so that it becomes
|
||||
a de-facto standard. To achieve this, non-free programs must be
|
||||
allowed to use the library. A more frequent case is that a free
|
||||
library does the same job as widely used non-free libraries. In this
|
||||
case, there is little to gain by limiting the free library to free
|
||||
software only, so we use the Lesser General Public License.
|
||||
|
||||
In other cases, permission to use a particular library in non-free
|
||||
programs enables a greater number of people to use a large body of
|
||||
free software. For example, permission to use the GNU C Library in
|
||||
non-free programs enables many more people to use the whole GNU
|
||||
operating system, as well as its variant, the GNU/Linux operating
|
||||
system.
|
||||
|
||||
Although the Lesser General Public License is Less protective of the
|
||||
users' freedom, it does ensure that the user of a program that is
|
||||
linked with the Library has the freedom and the wherewithal to run
|
||||
that program using a modified version of the Library.
|
||||
|
||||
The precise terms and conditions for copying, distribution and
|
||||
modification follow. Pay close attention to the difference between a
|
||||
"work based on the library" and a "work that uses the library". The
|
||||
former contains code derived from the library, whereas the latter must
|
||||
be combined with the library in order to run.
|
||||
|
||||
GNU LESSER GENERAL PUBLIC LICENSE
|
||||
TERMS AND CONDITIONS FOR COPYING, DISTRIBUTION AND MODIFICATION
|
||||
|
||||
0. This License Agreement applies to any software library or other
|
||||
program which contains a notice placed by the copyright holder or
|
||||
other authorized party saying it may be distributed under the terms of
|
||||
this Lesser General Public License (also called "this License").
|
||||
Each licensee is addressed as "you".
|
||||
|
||||
A "library" means a collection of software functions and/or data
|
||||
prepared so as to be conveniently linked with application programs
|
||||
(which use some of those functions and data) to form executables.
|
||||
|
||||
The "Library", below, refers to any such software library or work
|
||||
which has been distributed under these terms. A "work based on the
|
||||
Library" means either the Library or any derivative work under
|
||||
copyright law: that is to say, a work containing the Library or a
|
||||
portion of it, either verbatim or with modifications and/or translated
|
||||
straightforwardly into another language. (Hereinafter, translation is
|
||||
included without limitation in the term "modification".)
|
||||
|
||||
"Source code" for a work means the preferred form of the work for
|
||||
making modifications to it. For a library, complete source code means
|
||||
all the source code for all modules it contains, plus any associated
|
||||
interface definition files, plus the scripts used to control compilation
|
||||
and installation of the library.
|
||||
|
||||
Activities other than copying, distribution and modification are not
|
||||
covered by this License; they are outside its scope. The act of
|
||||
running a program using the Library is not restricted, and output from
|
||||
such a program is covered only if its contents constitute a work based
|
||||
on the Library (independent of the use of the Library in a tool for
|
||||
writing it). Whether that is true depends on what the Library does
|
||||
and what the program that uses the Library does.
|
||||
|
||||
1. You may copy and distribute verbatim copies of the Library's
|
||||
complete source code as you receive it, in any medium, provided that
|
||||
you conspicuously and appropriately publish on each copy an
|
||||
appropriate copyright notice and disclaimer of warranty; keep intact
|
||||
all the notices that refer to this License and to the absence of any
|
||||
warranty; and distribute a copy of this License along with the
|
||||
Library.
|
||||
|
||||
You may charge a fee for the physical act of transferring a copy,
|
||||
and you may at your option offer warranty protection in exchange for a
|
||||
fee.
|
||||
|
||||
2. You may modify your copy or copies of the Library or any portion
|
||||
of it, thus forming a work based on the Library, and copy and
|
||||
distribute such modifications or work under the terms of Section 1
|
||||
above, provided that you also meet all of these conditions:
|
||||
|
||||
a) The modified work must itself be a software library.
|
||||
|
||||
b) You must cause the files modified to carry prominent notices
|
||||
stating that you changed the files and the date of any change.
|
||||
|
||||
c) You must cause the whole of the work to be licensed at no
|
||||
charge to all third parties under the terms of this License.
|
||||
|
||||
d) If a facility in the modified Library refers to a function or a
|
||||
table of data to be supplied by an application program that uses
|
||||
the facility, other than as an argument passed when the facility
|
||||
is invoked, then you must make a good faith effort to ensure that,
|
||||
in the event an application does not supply such function or
|
||||
table, the facility still operates, and performs whatever part of
|
||||
its purpose remains meaningful.
|
||||
|
||||
(For example, a function in a library to compute square roots has
|
||||
a purpose that is entirely well-defined independent of the
|
||||
application. Therefore, Subsection 2d requires that any
|
||||
application-supplied function or table used by this function must
|
||||
be optional: if the application does not supply it, the square
|
||||
root function must still compute square roots.)
|
||||
|
||||
These requirements apply to the modified work as a whole. If
|
||||
identifiable sections of that work are not derived from the Library,
|
||||
and can be reasonably considered independent and separate works in
|
||||
themselves, then this License, and its terms, do not apply to those
|
||||
sections when you distribute them as separate works. But when you
|
||||
distribute the same sections as part of a whole which is a work based
|
||||
on the Library, the distribution of the whole must be on the terms of
|
||||
this License, whose permissions for other licensees extend to the
|
||||
entire whole, and thus to each and every part regardless of who wrote
|
||||
it.
|
||||
|
||||
Thus, it is not the intent of this section to claim rights or contest
|
||||
your rights to work written entirely by you; rather, the intent is to
|
||||
exercise the right to control the distribution of derivative or
|
||||
collective works based on the Library.
|
||||
|
||||
In addition, mere aggregation of another work not based on the Library
|
||||
with the Library (or with a work based on the Library) on a volume of
|
||||
a storage or distribution medium does not bring the other work under
|
||||
the scope of this License.
|
||||
|
||||
3. You may opt to apply the terms of the ordinary GNU General Public
|
||||
License instead of this License to a given copy of the Library. To do
|
||||
this, you must alter all the notices that refer to this License, so
|
||||
that they refer to the ordinary GNU General Public License, version 2,
|
||||
instead of to this License. (If a newer version than version 2 of the
|
||||
ordinary GNU General Public License has appeared, then you can specify
|
||||
that version instead if you wish.) Do not make any other change in
|
||||
these notices.
|
||||
|
||||
Once this change is made in a given copy, it is irreversible for
|
||||
that copy, so the ordinary GNU General Public License applies to all
|
||||
subsequent copies and derivative works made from that copy.
|
||||
|
||||
This option is useful when you wish to copy part of the code of
|
||||
the Library into a program that is not a library.
|
||||
|
||||
4. You may copy and distribute the Library (or a portion or
|
||||
derivative of it, under Section 2) in object code or executable form
|
||||
under the terms of Sections 1 and 2 above provided that you accompany
|
||||
it with the complete corresponding machine-readable source code, which
|
||||
must be distributed under the terms of Sections 1 and 2 above on a
|
||||
medium customarily used for software interchange.
|
||||
|
||||
If distribution of object code is made by offering access to copy
|
||||
from a designated place, then offering equivalent access to copy the
|
||||
source code from the same place satisfies the requirement to
|
||||
distribute the source code, even though third parties are not
|
||||
compelled to copy the source along with the object code.
|
||||
|
||||
5. A program that contains no derivative of any portion of the
|
||||
Library, but is designed to work with the Library by being compiled or
|
||||
linked with it, is called a "work that uses the Library". Such a
|
||||
work, in isolation, is not a derivative work of the Library, and
|
||||
therefore falls outside the scope of this License.
|
||||
|
||||
However, linking a "work that uses the Library" with the Library
|
||||
creates an executable that is a derivative of the Library (because it
|
||||
contains portions of the Library), rather than a "work that uses the
|
||||
library". The executable is therefore covered by this License.
|
||||
Section 6 states terms for distribution of such executables.
|
||||
|
||||
When a "work that uses the Library" uses material from a header file
|
||||
that is part of the Library, the object code for the work may be a
|
||||
derivative work of the Library even though the source code is not.
|
||||
Whether this is true is especially significant if the work can be
|
||||
linked without the Library, or if the work is itself a library. The
|
||||
threshold for this to be true is not precisely defined by law.
|
||||
|
||||
If such an object file uses only numerical parameters, data
|
||||
structure layouts and accessors, and small macros and small inline
|
||||
functions (ten lines or less in length), then the use of the object
|
||||
file is unrestricted, regardless of whether it is legally a derivative
|
||||
work. (Executables containing this object code plus portions of the
|
||||
Library will still fall under Section 6.)
|
||||
|
||||
Otherwise, if the work is a derivative of the Library, you may
|
||||
distribute the object code for the work under the terms of Section 6.
|
||||
Any executables containing that work also fall under Section 6,
|
||||
whether or not they are linked directly with the Library itself.
|
||||
|
||||
6. As an exception to the Sections above, you may also combine or
|
||||
link a "work that uses the Library" with the Library to produce a
|
||||
work containing portions of the Library, and distribute that work
|
||||
under terms of your choice, provided that the terms permit
|
||||
modification of the work for the customer's own use and reverse
|
||||
engineering for debugging such modifications.
|
||||
|
||||
You must give prominent notice with each copy of the work that the
|
||||
Library is used in it and that the Library and its use are covered by
|
||||
this License. You must supply a copy of this License. If the work
|
||||
during execution displays copyright notices, you must include the
|
||||
copyright notice for the Library among them, as well as a reference
|
||||
directing the user to the copy of this License. Also, you must do one
|
||||
of these things:
|
||||
|
||||
a) Accompany the work with the complete corresponding
|
||||
machine-readable source code for the Library including whatever
|
||||
changes were used in the work (which must be distributed under
|
||||
Sections 1 and 2 above); and, if the work is an executable linked
|
||||
with the Library, with the complete machine-readable "work that
|
||||
uses the Library", as object code and/or source code, so that the
|
||||
user can modify the Library and then relink to produce a modified
|
||||
executable containing the modified Library. (It is understood
|
||||
that the user who changes the contents of definitions files in the
|
||||
Library will not necessarily be able to recompile the application
|
||||
to use the modified definitions.)
|
||||
|
||||
b) Use a suitable shared library mechanism for linking with the
|
||||
Library. A suitable mechanism is one that (1) uses at run time a
|
||||
copy of the library already present on the user's computer system,
|
||||
rather than copying library functions into the executable, and (2)
|
||||
will operate properly with a modified version of the library, if
|
||||
the user installs one, as long as the modified version is
|
||||
interface-compatible with the version that the work was made with.
|
||||
|
||||
c) Accompany the work with a written offer, valid for at
|
||||
least three years, to give the same user the materials
|
||||
specified in Subsection 6a, above, for a charge no more
|
||||
than the cost of performing this distribution.
|
||||
|
||||
d) If distribution of the work is made by offering access to copy
|
||||
from a designated place, offer equivalent access to copy the above
|
||||
specified materials from the same place.
|
||||
|
||||
e) Verify that the user has already received a copy of these
|
||||
materials or that you have already sent this user a copy.
|
||||
|
||||
For an executable, the required form of the "work that uses the
|
||||
Library" must include any data and utility programs needed for
|
||||
reproducing the executable from it. However, as a special exception,
|
||||
the materials to be distributed need not include anything that is
|
||||
normally distributed (in either source or binary form) with the major
|
||||
components (compiler, kernel, and so on) of the operating system on
|
||||
which the executable runs, unless that component itself accompanies
|
||||
the executable.
|
||||
|
||||
It may happen that this requirement contradicts the license
|
||||
restrictions of other proprietary libraries that do not normally
|
||||
accompany the operating system. Such a contradiction means you cannot
|
||||
use both them and the Library together in an executable that you
|
||||
distribute.
|
||||
|
||||
7. You may place library facilities that are a work based on the
|
||||
Library side-by-side in a single library together with other library
|
||||
facilities not covered by this License, and distribute such a combined
|
||||
library, provided that the separate distribution of the work based on
|
||||
the Library and of the other library facilities is otherwise
|
||||
permitted, and provided that you do these two things:
|
||||
|
||||
a) Accompany the combined library with a copy of the same work
|
||||
based on the Library, uncombined with any other library
|
||||
facilities. This must be distributed under the terms of the
|
||||
Sections above.
|
||||
|
||||
b) Give prominent notice with the combined library of the fact
|
||||
that part of it is a work based on the Library, and explaining
|
||||
where to find the accompanying uncombined form of the same work.
|
||||
|
||||
8. You may not copy, modify, sublicense, link with, or distribute
|
||||
the Library except as expressly provided under this License. Any
|
||||
attempt otherwise to copy, modify, sublicense, link with, or
|
||||
distribute the Library is void, and will automatically terminate your
|
||||
rights under this License. However, parties who have received copies,
|
||||
or rights, from you under this License will not have their licenses
|
||||
terminated so long as such parties remain in full compliance.
|
||||
|
||||
9. You are not required to accept this License, since you have not
|
||||
signed it. However, nothing else grants you permission to modify or
|
||||
distribute the Library or its derivative works. These actions are
|
||||
prohibited by law if you do not accept this License. Therefore, by
|
||||
modifying or distributing the Library (or any work based on the
|
||||
Library), you indicate your acceptance of this License to do so, and
|
||||
all its terms and conditions for copying, distributing or modifying
|
||||
the Library or works based on it.
|
||||
|
||||
10. Each time you redistribute the Library (or any work based on the
|
||||
Library), the recipient automatically receives a license from the
|
||||
original licensor to copy, distribute, link with or modify the Library
|
||||
subject to these terms and conditions. You may not impose any further
|
||||
restrictions on the recipients' exercise of the rights granted herein.
|
||||
You are not responsible for enforcing compliance by third parties with
|
||||
this License.
|
||||
|
||||
11. If, as a consequence of a court judgment or allegation of patent
|
||||
infringement or for any other reason (not limited to patent issues),
|
||||
conditions are imposed on you (whether by court order, agreement or
|
||||
otherwise) that contradict the conditions of this License, they do not
|
||||
excuse you from the conditions of this License. If you cannot
|
||||
distribute so as to satisfy simultaneously your obligations under this
|
||||
License and any other pertinent obligations, then as a consequence you
|
||||
may not distribute the Library at all. For example, if a patent
|
||||
license would not permit royalty-free redistribution of the Library by
|
||||
all those who receive copies directly or indirectly through you, then
|
||||
the only way you could satisfy both it and this License would be to
|
||||
refrain entirely from distribution of the Library.
|
||||
|
||||
If any portion of this section is held invalid or unenforceable under any
|
||||
particular circumstance, the balance of the section is intended to apply,
|
||||
and the section as a whole is intended to apply in other circumstances.
|
||||
|
||||
It is not the purpose of this section to induce you to infringe any
|
||||
patents or other property right claims or to contest validity of any
|
||||
such claims; this section has the sole purpose of protecting the
|
||||
integrity of the free software distribution system which is
|
||||
implemented by public license practices. Many people have made
|
||||
generous contributions to the wide range of software distributed
|
||||
through that system in reliance on consistent application of that
|
||||
system; it is up to the author/donor to decide if he or she is willing
|
||||
to distribute software through any other system and a licensee cannot
|
||||
impose that choice.
|
||||
|
||||
This section is intended to make thoroughly clear what is believed to
|
||||
be a consequence of the rest of this License.
|
||||
|
||||
12. If the distribution and/or use of the Library is restricted in
|
||||
certain countries either by patents or by copyrighted interfaces, the
|
||||
original copyright holder who places the Library under this License may add
|
||||
an explicit geographical distribution limitation excluding those countries,
|
||||
so that distribution is permitted only in or among countries not thus
|
||||
excluded. In such case, this License incorporates the limitation as if
|
||||
written in the body of this License.
|
||||
|
||||
13. The Free Software Foundation may publish revised and/or new
|
||||
versions of the Lesser General Public License from time to time.
|
||||
Such new versions will be similar in spirit to the present version,
|
||||
but may differ in detail to address new problems or concerns.
|
||||
|
||||
Each version is given a distinguishing version number. If the Library
|
||||
specifies a version number of this License which applies to it and
|
||||
"any later version", you have the option of following the terms and
|
||||
conditions either of that version or of any later version published by
|
||||
the Free Software Foundation. If the Library does not specify a
|
||||
license version number, you may choose any version ever published by
|
||||
the Free Software Foundation.
|
||||
|
||||
14. If you wish to incorporate parts of the Library into other free
|
||||
programs whose distribution conditions are incompatible with these,
|
||||
write to the author to ask for permission. For software which is
|
||||
copyrighted by the Free Software Foundation, write to the Free
|
||||
Software Foundation; we sometimes make exceptions for this. Our
|
||||
decision will be guided by the two goals of preserving the free status
|
||||
of all derivatives of our free software and of promoting the sharing
|
||||
and reuse of software generally.
|
||||
|
||||
NO WARRANTY
|
||||
|
||||
15. BECAUSE THE LIBRARY IS LICENSED FREE OF CHARGE, THERE IS NO
|
||||
WARRANTY FOR THE LIBRARY, TO THE EXTENT PERMITTED BY APPLICABLE LAW.
|
||||
EXCEPT WHEN OTHERWISE STATED IN WRITING THE COPYRIGHT HOLDERS AND/OR
|
||||
OTHER PARTIES PROVIDE THE LIBRARY "AS IS" WITHOUT WARRANTY OF ANY
|
||||
KIND, EITHER EXPRESSED OR IMPLIED, INCLUDING, BUT NOT LIMITED TO, THE
|
||||
IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR
|
||||
PURPOSE. THE ENTIRE RISK AS TO THE QUALITY AND PERFORMANCE OF THE
|
||||
LIBRARY IS WITH YOU. SHOULD THE LIBRARY PROVE DEFECTIVE, YOU ASSUME
|
||||
THE COST OF ALL NECESSARY SERVICING, REPAIR OR CORRECTION.
|
||||
|
||||
16. IN NO EVENT UNLESS REQUIRED BY APPLICABLE LAW OR AGREED TO IN
|
||||
WRITING WILL ANY COPYRIGHT HOLDER, OR ANY OTHER PARTY WHO MAY MODIFY
|
||||
AND/OR REDISTRIBUTE THE LIBRARY AS PERMITTED ABOVE, BE LIABLE TO YOU
|
||||
FOR DAMAGES, INCLUDING ANY GENERAL, SPECIAL, INCIDENTAL OR
|
||||
CONSEQUENTIAL DAMAGES ARISING OUT OF THE USE OR INABILITY TO USE THE
|
||||
LIBRARY (INCLUDING BUT NOT LIMITED TO LOSS OF DATA OR DATA BEING
|
||||
RENDERED INACCURATE OR LOSSES SUSTAINED BY YOU OR THIRD PARTIES OR A
|
||||
FAILURE OF THE LIBRARY TO OPERATE WITH ANY OTHER SOFTWARE), EVEN IF
|
||||
SUCH HOLDER OR OTHER PARTY HAS BEEN ADVISED OF THE POSSIBILITY OF SUCH
|
||||
DAMAGES.
|
||||
|
||||
END OF TERMS AND CONDITIONS
|
||||
|
||||
How to Apply These Terms to Your New Libraries
|
||||
|
||||
If you develop a new library, and you want it to be of the greatest
|
||||
possible use to the public, we recommend making it free software that
|
||||
everyone can redistribute and change. You can do so by permitting
|
||||
redistribution under these terms (or, alternatively, under the terms of the
|
||||
ordinary General Public License).
|
||||
|
||||
To apply these terms, attach the following notices to the library. It is
|
||||
safest to attach them to the start of each source file to most effectively
|
||||
convey the exclusion of warranty; and each file should have at least the
|
||||
"copyright" line and a pointer to where the full notice is found.
|
||||
|
||||
<one line to give the library's name and a brief idea of what it does.>
|
||||
Copyright (C) <year> <name of author>
|
||||
|
||||
This library is free software; you can redistribute it and/or
|
||||
modify it under the terms of the GNU Lesser General Public
|
||||
License as published by the Free Software Foundation; either
|
||||
version 2.1 of the License, or (at your option) any later version.
|
||||
|
||||
This library is distributed in the hope that it will be useful,
|
||||
but WITHOUT ANY WARRANTY; without even the implied warranty of
|
||||
MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU
|
||||
Lesser General Public License for more details.
|
||||
|
||||
You should have received a copy of the GNU Lesser General Public
|
||||
License along with this library; if not, write to the Free Software
|
||||
Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA 02111-1307 USA
|
||||
|
||||
Also add information on how to contact you by electronic and paper mail.
|
||||
|
||||
You should also get your employer (if you work as a programmer) or your
|
||||
school, if any, to sign a "copyright disclaimer" for the library, if
|
||||
necessary. Here is a sample; alter the names:
|
||||
|
||||
Yoyodyne, Inc., hereby disclaims all copyright interest in the
|
||||
library `Frob' (a library for tweaking knobs) written by James Random Hacker.
|
||||
|
||||
<signature of Ty Coon>, 1 April 1990
|
||||
Ty Coon, President of Vice
|
||||
|
||||
That's all there is to it!
|
||||
|
||||
|
||||
@@ -1 +1 @@
|
||||
version=0.0.9
|
||||
version=0.1.0
|
||||
|
||||
BIN
resources/uk/co/majenko/audiobookrecorder/icons/dollar.png
Normal file
BIN
resources/uk/co/majenko/audiobookrecorder/icons/dollar.png
Normal file
Binary file not shown.
|
After Width: | Height: | Size: 11 KiB |
@@ -26,453 +26,461 @@ package davaguine.jeq.core;
|
||||
public class IIRBase {
|
||||
/* BETA, ALPHA, GAMMA */
|
||||
public final static IIRCoefficients iir_cf10_11k_11025[] = {
|
||||
/* 31 Hz*/
|
||||
new IIRCoefficients(9.8758524689e-01, 6.2073765555e-03, 1.9872750693e+00),
|
||||
/* 62 Hz*/
|
||||
new IIRCoefficients(9.7532461998e-01, 1.2337690008e-02, 1.9740916593e+00),
|
||||
/* 125 Hz*/
|
||||
new IIRCoefficients(9.5087485437e-01, 2.4562572817e-02, 1.9459267562e+00),
|
||||
/* 250 Hz*/
|
||||
new IIRCoefficients(9.0416308662e-01, 4.7918456688e-02, 1.8848691023e+00),
|
||||
/* 500 Hz*/
|
||||
new IIRCoefficients(8.1751373987e-01, 9.1243130064e-02, 1.7442229115e+00),
|
||||
/* 1k Hz*/
|
||||
new IIRCoefficients(6.6840529852e-01, 1.6579735074e-01, 1.4047189863e+00),
|
||||
/* 2k Hz*/
|
||||
new IIRCoefficients(4.4858358977e-01, 2.7570820511e-01, 6.0517475334e-01),
|
||||
/* 3k Hz*/
|
||||
new IIRCoefficients(3.1012671838e-01, 3.4493664081e-01, -1.8141012760e-01),
|
||||
/* 4k Hz*/
|
||||
new IIRCoefficients(2.4198119087e-01, 3.7900940457e-01, -8.0845085113e-01),
|
||||
/* 5.5k Hz*/
|
||||
new IIRCoefficients(3.3453245058e-01, 3.3273377471e-01, -1.3344985880e+00)
|
||||
/* 31 Hz*/
|
||||
new IIRCoefficients(9.8758524689e-01, 6.2073765555e-03, 1.9872750693e+00),
|
||||
/* 62 Hz*/
|
||||
new IIRCoefficients(9.7532461998e-01, 1.2337690008e-02, 1.9740916593e+00),
|
||||
/* 125 Hz*/
|
||||
new IIRCoefficients(9.5087485437e-01, 2.4562572817e-02, 1.9459267562e+00),
|
||||
/* 250 Hz*/
|
||||
new IIRCoefficients(9.0416308662e-01, 4.7918456688e-02, 1.8848691023e+00),
|
||||
/* 500 Hz*/
|
||||
new IIRCoefficients(8.1751373987e-01, 9.1243130064e-02, 1.7442229115e+00),
|
||||
/* 1k Hz*/
|
||||
new IIRCoefficients(6.6840529852e-01, 1.6579735074e-01, 1.4047189863e+00),
|
||||
/* 2k Hz*/
|
||||
new IIRCoefficients(4.4858358977e-01, 2.7570820511e-01, 6.0517475334e-01),
|
||||
/* 3k Hz*/
|
||||
new IIRCoefficients(3.1012671838e-01, 3.4493664081e-01, -1.8141012760e-01),
|
||||
/* 4k Hz*/
|
||||
new IIRCoefficients(2.4198119087e-01, 3.7900940457e-01, -8.0845085113e-01),
|
||||
/* 5.5k Hz*/
|
||||
new IIRCoefficients(3.3453245058e-01, 3.3273377471e-01, -1.3344985880e+00)
|
||||
};
|
||||
|
||||
public final static IIRCoefficients iir_cf10_22k_22050[] = {
|
||||
/* 31 Hz*/
|
||||
new IIRCoefficients(9.9377323686e-01, 3.1133815717e-03, 1.9936954495e+00),
|
||||
/* 62 Hz*/
|
||||
new IIRCoefficients(9.8758524689e-01, 6.2073765555e-03, 1.9872750693e+00),
|
||||
/* 125 Hz*/
|
||||
new IIRCoefficients(9.7512812040e-01, 1.2435939802e-02, 1.9738753198e+00),
|
||||
/* 250 Hz*/
|
||||
new IIRCoefficients(9.5087485437e-01, 2.4562572817e-02, 1.9459267562e+00),
|
||||
/* 500 Hz*/
|
||||
new IIRCoefficients(9.0416308662e-01, 4.7918456688e-02, 1.8848691023e+00),
|
||||
/* 1k Hz*/
|
||||
new IIRCoefficients(8.1751373987e-01, 9.1243130064e-02, 1.7442229115e+00),
|
||||
/* 2k Hz*/
|
||||
new IIRCoefficients(6.6840529852e-01, 1.6579735074e-01, 1.4047189863e+00),
|
||||
/* 4k Hz*/
|
||||
new IIRCoefficients(4.4858358977e-01, 2.7570820511e-01, 6.0517475334e-01),
|
||||
/* 8k Hz*/
|
||||
new IIRCoefficients(2.4198119087e-01, 3.7900940457e-01, -8.0845085113e-01),
|
||||
/* 11k Hz*/
|
||||
new IIRCoefficients(3.3453245058e-01, 3.3273377471e-01, -1.3344985880e+00)
|
||||
/* 31 Hz*/
|
||||
new IIRCoefficients(9.9377323686e-01, 3.1133815717e-03, 1.9936954495e+00),
|
||||
/* 62 Hz*/
|
||||
new IIRCoefficients(9.8758524689e-01, 6.2073765555e-03, 1.9872750693e+00),
|
||||
/* 125 Hz*/
|
||||
new IIRCoefficients(9.7512812040e-01, 1.2435939802e-02, 1.9738753198e+00),
|
||||
/* 250 Hz*/
|
||||
new IIRCoefficients(9.5087485437e-01, 2.4562572817e-02, 1.9459267562e+00),
|
||||
/* 500 Hz*/
|
||||
new IIRCoefficients(9.0416308662e-01, 4.7918456688e-02, 1.8848691023e+00),
|
||||
/* 1k Hz*/
|
||||
new IIRCoefficients(8.1751373987e-01, 9.1243130064e-02, 1.7442229115e+00),
|
||||
/* 2k Hz*/
|
||||
new IIRCoefficients(6.6840529852e-01, 1.6579735074e-01, 1.4047189863e+00),
|
||||
/* 4k Hz*/
|
||||
new IIRCoefficients(4.4858358977e-01, 2.7570820511e-01, 6.0517475334e-01),
|
||||
/* 8k Hz*/
|
||||
new IIRCoefficients(2.4198119087e-01, 3.7900940457e-01, -8.0845085113e-01),
|
||||
/* 11k Hz*/
|
||||
new IIRCoefficients(3.3453245058e-01, 3.3273377471e-01, -1.3344985880e+00)
|
||||
};
|
||||
public final static IIRCoefficients iir_cf10_44100[] = {
|
||||
/* 31 Hz*/
|
||||
new IIRCoefficients(9.9688176273e-01, 1.5591186337e-03, 1.9968622855e+00),
|
||||
/* 62 Hz*/
|
||||
new IIRCoefficients(9.9377323686e-01, 3.1133815717e-03, 1.9936954495e+00),
|
||||
/* 125 Hz*/
|
||||
new IIRCoefficients(9.8748575691e-01, 6.2571215431e-03, 1.9871705722e+00),
|
||||
/* 250 Hz*/
|
||||
new IIRCoefficients(9.7512812040e-01, 1.2435939802e-02, 1.9738753198e+00),
|
||||
/* 500 Hz*/
|
||||
new IIRCoefficients(9.5087485437e-01, 2.4562572817e-02, 1.9459267562e+00),
|
||||
/* 1k Hz*/
|
||||
new IIRCoefficients(9.0416308662e-01, 4.7918456688e-02, 1.8848691023e+00),
|
||||
/* 2k Hz*/
|
||||
new IIRCoefficients(8.1751373987e-01, 9.1243130064e-02, 1.7442229115e+00),
|
||||
/* 4k Hz*/
|
||||
new IIRCoefficients(6.6840529852e-01, 1.6579735074e-01, 1.4047189863e+00),
|
||||
/* 8k Hz*/
|
||||
new IIRCoefficients(4.4858358977e-01, 2.7570820511e-01, 6.0517475334e-01),
|
||||
/* 16k Hz*/
|
||||
new IIRCoefficients(2.4198119087e-01, 3.7900940457e-01, -8.0845085113e-01)
|
||||
};
|
||||
public final static IIRCoefficients iir_cf10_48000[] = {
|
||||
/* 31 Hz*/
|
||||
new IIRCoefficients(9.9713475915e-01, 1.4326204244e-03, 1.9971183163e+00),
|
||||
/* 62 Hz*/
|
||||
new IIRCoefficients(9.9427771143e-01, 2.8611442874e-03, 1.9942120343e+00),
|
||||
/* 125 Hz*/
|
||||
new IIRCoefficients(9.8849666727e-01, 5.7516663664e-03, 1.9882304829e+00),
|
||||
/* 250 Hz*/
|
||||
new IIRCoefficients(9.7712566171e-01, 1.1437169144e-02, 1.9760670839e+00),
|
||||
/* 500 Hz*/
|
||||
new IIRCoefficients(9.5477456091e-01, 2.2612719547e-02, 1.9505892385e+00),
|
||||
/* 1k Hz*/
|
||||
new IIRCoefficients(9.1159452679e-01, 4.4202736607e-02, 1.8952405706e+00),
|
||||
/* 2k Hz*/
|
||||
new IIRCoefficients(8.3100647694e-01, 8.4496761532e-02, 1.7686164442e+00),
|
||||
/* 4k Hz*/
|
||||
new IIRCoefficients(6.9062328809e-01, 1.5468835596e-01, 1.4641227157e+00),
|
||||
/* 8k Hz*/
|
||||
new IIRCoefficients(4.7820368352e-01, 2.6089815824e-01, 7.3910184176e-01),
|
||||
/* 16k Hz*/
|
||||
new IIRCoefficients(2.5620076154e-01, 3.7189961923e-01, -6.2810038077e-01)
|
||||
};
|
||||
public final static IIRCoefficients iir_cf15_44100[] = {
|
||||
/* 25 Hz*/
|
||||
new IIRCoefficients(9.9834072702e-01, 8.2963648917e-04, 1.9983280505e+00),
|
||||
/* 40 Hz*/
|
||||
new IIRCoefficients(9.9734652663e-01, 1.3267366865e-03, 1.9973140908e+00),
|
||||
/* 63 Hz*/
|
||||
new IIRCoefficients(9.9582396353e-01, 2.0880182333e-03, 1.9957435641e+00),
|
||||
/* 100 Hz*/
|
||||
new IIRCoefficients(9.9337951306e-01, 3.3102434709e-03, 1.9931771947e+00),
|
||||
/* 160 Hz*/
|
||||
new IIRCoefficients(9.8942832039e-01, 5.2858398053e-03, 1.9889114258e+00),
|
||||
/* 250 Hz*/
|
||||
new IIRCoefficients(9.8353109588e-01, 8.2344520610e-03, 1.9822729654e+00),
|
||||
/* 400 Hz*/
|
||||
new IIRCoefficients(9.7378088082e-01, 1.3109559588e-02, 1.9705764276e+00),
|
||||
/* 630 Hz*/
|
||||
new IIRCoefficients(9.5901979676e-01, 2.0490101620e-02, 1.9511333590e+00),
|
||||
/* 1k Hz*/
|
||||
new IIRCoefficients(9.3574903986e-01, 3.2125480071e-02, 1.9161350100e+00),
|
||||
/* 1.6k Hz*/
|
||||
new IIRCoefficients(8.9923630641e-01, 5.0381846793e-02, 1.8501014162e+00),
|
||||
/* 2.5k Hz*/
|
||||
new IIRCoefficients(8.4722457681e-01, 7.6387711593e-02, 1.7312785699e+00),
|
||||
/* 4k Hz*/
|
||||
new IIRCoefficients(7.6755471307e-01, 1.1622264346e-01, 1.4881981417e+00),
|
||||
/* 6.3k Hz*/
|
||||
new IIRCoefficients(6.6125377473e-01, 1.6937311263e-01, 1.0357747868e+00),
|
||||
/* 10k Hz*/
|
||||
new IIRCoefficients(5.2683267950e-01, 2.3658366025e-01, 2.2218349322e-01),
|
||||
/* 16k Hz*/
|
||||
new IIRCoefficients(4.0179628792e-01, 2.9910185604e-01, -9.1248032613e-01)
|
||||
};
|
||||
public final static IIRCoefficients iir_cf15_48000[] = {
|
||||
/* 25 Hz*/
|
||||
new IIRCoefficients(9.9847546664e-01, 7.6226668143e-04, 1.9984647656e+00),
|
||||
/* 40 Hz*/
|
||||
new IIRCoefficients(9.9756184654e-01, 1.2190767289e-03, 1.9975344645e+00),
|
||||
/* 63 Hz*/
|
||||
new IIRCoefficients(9.9616261379e-01, 1.9186931041e-03, 1.9960947369e+00),
|
||||
/* 100 Hz*/
|
||||
new IIRCoefficients(9.9391578543e-01, 3.0421072865e-03, 1.9937449618e+00),
|
||||
/* 160 Hz*/
|
||||
new IIRCoefficients(9.9028307215e-01, 4.8584639242e-03, 1.9898465702e+00),
|
||||
/* 250 Hz*/
|
||||
new IIRCoefficients(9.8485897264e-01, 7.5705136795e-03, 1.9837962543e+00),
|
||||
/* 400 Hz*/
|
||||
new IIRCoefficients(9.7588512657e-01, 1.2057436715e-02, 1.9731772447e+00),
|
||||
/* 630 Hz*/
|
||||
new IIRCoefficients(9.6228521814e-01, 1.8857390928e-02, 1.9556164694e+00),
|
||||
/* 1k Hz*/
|
||||
new IIRCoefficients(9.4080933132e-01, 2.9595334338e-02, 1.9242054384e+00),
|
||||
/* 1.6k Hz*/
|
||||
new IIRCoefficients(9.0702059196e-01, 4.6489704022e-02, 1.8653476166e+00),
|
||||
/* 2.5k Hz*/
|
||||
new IIRCoefficients(8.5868004289e-01, 7.0659978553e-02, 1.7600401337e+00),
|
||||
/* 4k Hz*/
|
||||
new IIRCoefficients(7.8409610788e-01, 1.0795194606e-01, 1.5450725522e+00),
|
||||
/* 6.3k Hz*/
|
||||
new IIRCoefficients(6.8332861002e-01, 1.5833569499e-01, 1.1426447155e+00),
|
||||
/* 10k Hz*/
|
||||
new IIRCoefficients(5.5267518228e-01, 2.2366240886e-01, 4.0186190803e-01),
|
||||
/* 16k Hz*/
|
||||
new IIRCoefficients(4.1811888447e-01, 2.9094055777e-01, -7.0905944223e-01)
|
||||
};
|
||||
public final static IIRCoefficients iir_cf25_44100[] = {
|
||||
/* 20 Hz*/
|
||||
new IIRCoefficients(9.9934037157e-01, 3.2981421662e-04, 1.9993322545e+00),
|
||||
/* 31.5 Hz*/
|
||||
new IIRCoefficients(9.9896129025e-01, 5.1935487310e-04, 1.9989411587e+00),
|
||||
/* 40 Hz*/
|
||||
new IIRCoefficients(9.9868118265e-01, 6.5940867495e-04, 1.9986487252e+00),
|
||||
/* 50 Hz*/
|
||||
new IIRCoefficients(9.9835175161e-01, 8.2412419683e-04, 1.9983010452e+00),
|
||||
/* 80 Hz*/
|
||||
new IIRCoefficients(9.9736411067e-01, 1.3179446674e-03, 1.9972343673e+00),
|
||||
/* 100 Hz*/
|
||||
new IIRCoefficients(9.9670622662e-01, 1.6468866919e-03, 1.9965035707e+00),
|
||||
/* 125 Hz*/
|
||||
new IIRCoefficients(9.9588448566e-01, 2.0577571681e-03, 1.9955679690e+00),
|
||||
/* 160 Hz*/
|
||||
new IIRCoefficients(9.9473519326e-01, 2.6324033689e-03, 1.9942169198e+00),
|
||||
/* 250 Hz*/
|
||||
new IIRCoefficients(9.9178600786e-01, 4.1069960678e-03, 1.9905226414e+00),
|
||||
/* 315 Hz*/
|
||||
new IIRCoefficients(9.8966154150e-01, 5.1692292513e-03, 1.9876580847e+00),
|
||||
/* 400 Hz*/
|
||||
new IIRCoefficients(9.8689036168e-01, 6.5548191616e-03, 1.9836646251e+00),
|
||||
/* 500 Hz*/
|
||||
new IIRCoefficients(9.8364027156e-01, 8.1798642207e-03, 1.9786090689e+00),
|
||||
/* 800 Hz*/
|
||||
new IIRCoefficients(9.7395577681e-01, 1.3022111597e-02, 1.9611472340e+00),
|
||||
/* 1k Hz*/
|
||||
new IIRCoefficients(9.6755437936e-01, 1.6222810321e-02, 1.9476180811e+00),
|
||||
/* 1.25k Hz*/
|
||||
new IIRCoefficients(9.5961458750e-01, 2.0192706249e-02, 1.9286193446e+00),
|
||||
/* 1.6k Hz*/
|
||||
new IIRCoefficients(9.4861481164e-01, 2.5692594182e-02, 1.8982024567e+00),
|
||||
/* 2.5k Hz*/
|
||||
new IIRCoefficients(9.2095325455e-01, 3.9523372724e-02, 1.8003794694e+00),
|
||||
/* 3.15k Hz*/
|
||||
new IIRCoefficients(9.0153642498e-01, 4.9231787512e-02, 1.7132251201e+00),
|
||||
/* 4k Hz*/
|
||||
new IIRCoefficients(8.7685876255e-01, 6.1570618727e-02, 1.5802270232e+00),
|
||||
/* 5k Hz*/
|
||||
new IIRCoefficients(8.4886734822e-01, 7.5566325889e-02, 1.3992391376e+00),
|
||||
/* 8k Hz*/
|
||||
new IIRCoefficients(7.7175298860e-01, 1.1412350570e-01, 7.4018523020e-01),
|
||||
/* 10k Hz*/
|
||||
new IIRCoefficients(7.2627049462e-01, 1.3686475269e-01, 2.5120552756e-01),
|
||||
/* 12.5k Hz*/
|
||||
new IIRCoefficients(6.7674787974e-01, 1.6162606013e-01, -3.4978377639e-01),
|
||||
/* 16k Hz*/
|
||||
new IIRCoefficients(6.2482197550e-01, 1.8758901225e-01, -1.0576558797e+00),
|
||||
/* 20k Hz*/
|
||||
new IIRCoefficients(6.1776148240e-01, 1.9111925880e-01, -1.5492465594e+00)
|
||||
};
|
||||
public final static IIRCoefficients iir_cf25_48000[] = {
|
||||
/* 20 Hz*/
|
||||
new IIRCoefficients(9.9939388451e-01, 3.0305774630e-04, 1.9993870327e+00),
|
||||
/* 31.5 Hz*/
|
||||
new IIRCoefficients(9.9904564663e-01, 4.7717668529e-04, 1.9990286528e+00),
|
||||
/* 40 Hz*/
|
||||
new IIRCoefficients(9.9878827195e-01, 6.0586402557e-04, 1.9987608731e+00),
|
||||
/* 50 Hz*/
|
||||
new IIRCoefficients(9.9848556942e-01, 7.5721528829e-04, 1.9984427652e+00),
|
||||
/* 80 Hz*/
|
||||
new IIRCoefficients(9.9757801538e-01, 1.2109923088e-03, 1.9974684869e+00),
|
||||
/* 100 Hz*/
|
||||
new IIRCoefficients(9.9697343933e-01, 1.5132803374e-03, 1.9968023538e+00),
|
||||
/* 125 Hz*/
|
||||
new IIRCoefficients(9.9621823598e-01, 1.8908820086e-03, 1.9959510180e+00),
|
||||
/* 160 Hz*/
|
||||
new IIRCoefficients(9.9516191728e-01, 2.4190413595e-03, 1.9947243453e+00),
|
||||
/* 250 Hz*/
|
||||
new IIRCoefficients(9.9245085008e-01, 3.7745749576e-03, 1.9913840669e+00),
|
||||
/* 315 Hz*/
|
||||
new IIRCoefficients(9.9049749914e-01, 4.7512504310e-03, 1.9888056233e+00),
|
||||
/* 400 Hz*/
|
||||
new IIRCoefficients(9.8794899744e-01, 6.0255012789e-03, 1.9852245824e+00),
|
||||
/* 500 Hz*/
|
||||
new IIRCoefficients(9.8495930023e-01, 7.5203498850e-03, 1.9807093500e+00),
|
||||
/* 800 Hz*/
|
||||
new IIRCoefficients(9.7604570090e-01, 1.1977149551e-02, 1.9652207158e+00),
|
||||
/* 1k Hz*/
|
||||
new IIRCoefficients(9.7014963927e-01, 1.4925180364e-02, 1.9532947360e+00),
|
||||
/* 1.25k Hz*/
|
||||
new IIRCoefficients(9.6283181641e-01, 1.8584091793e-02, 1.9366149237e+00),
|
||||
/* 1.6k Hz*/
|
||||
new IIRCoefficients(9.5268463224e-01, 2.3657683878e-02, 1.9100137880e+00),
|
||||
/* 2.5k Hz*/
|
||||
new IIRCoefficients(9.2711765003e-01, 3.6441174983e-02, 1.8248457659e+00),
|
||||
/* 3.15k Hz*/
|
||||
new IIRCoefficients(9.0912548757e-01, 4.5437256213e-02, 1.7491177803e+00),
|
||||
/* 4k Hz*/
|
||||
new IIRCoefficients(8.8619860800e-01, 5.6900696000e-02, 1.6334959111e+00),
|
||||
/* 5k Hz*/
|
||||
new IIRCoefficients(8.6010264114e-01, 6.9948679430e-02, 1.4757186436e+00),
|
||||
/* 8k Hz*/
|
||||
new IIRCoefficients(7.8757448309e-01, 1.0621275845e-01, 8.9378724155e-01),
|
||||
/* 10k Hz*/
|
||||
new IIRCoefficients(7.4415362476e-01, 1.2792318762e-01, 4.5142017567e-01),
|
||||
/* 12.5k Hz*/
|
||||
new IIRCoefficients(6.9581428034e-01, 1.5209285983e-01, -1.1091156053e-01),
|
||||
/* 16k Hz*/
|
||||
new IIRCoefficients(6.4120506488e-01, 1.7939746756e-01, -8.2060253244e-01),
|
||||
/* 20k Hz*/
|
||||
new IIRCoefficients(6.0884213704e-01, 1.9557893148e-01, -1.3932981614e+00)
|
||||
};
|
||||
public final static IIRCoefficients iir_cf31_44100[] = {
|
||||
/* 20 Hz*/
|
||||
new IIRCoefficients(9.9934037157e-01, 3.2981421662e-04, 1.9993322545e+00),
|
||||
/* 25 Hz*/
|
||||
new IIRCoefficients(9.9917555233e-01, 4.1222383516e-04, 1.9991628705e+00),
|
||||
/* 31.5 Hz*/
|
||||
new IIRCoefficients(9.9896129025e-01, 5.1935487310e-04, 1.9989411587e+00),
|
||||
/* 40 Hz*/
|
||||
new IIRCoefficients(9.9868118265e-01, 6.5940867495e-04, 1.9986487252e+00),
|
||||
/* 50 Hz*/
|
||||
new IIRCoefficients(9.9835175161e-01, 8.2412419683e-04, 1.9983010452e+00),
|
||||
/* 63 Hz*/
|
||||
new IIRCoefficients(9.9792365217e-01, 1.0381739160e-03, 1.9978431682e+00),
|
||||
/* 80 Hz*/
|
||||
new IIRCoefficients(9.9736411067e-01, 1.3179446674e-03, 1.9972343673e+00),
|
||||
/* 100 Hz*/
|
||||
new IIRCoefficients(9.9670622662e-01, 1.6468866919e-03, 1.9965035707e+00),
|
||||
/* 125 Hz*/
|
||||
new IIRCoefficients(9.9588448566e-01, 2.0577571681e-03, 1.9955679690e+00),
|
||||
/* 160 Hz*/
|
||||
new IIRCoefficients(9.9473519326e-01, 2.6324033689e-03, 1.9942169198e+00),
|
||||
/* 200 Hz*/
|
||||
new IIRCoefficients(9.9342335280e-01, 3.2883236020e-03, 1.9926141028e+00),
|
||||
/* 250 Hz*/
|
||||
new IIRCoefficients(9.9178600786e-01, 4.1069960678e-03, 1.9905226414e+00),
|
||||
/* 315 Hz*/
|
||||
new IIRCoefficients(9.8966154150e-01, 5.1692292513e-03, 1.9876580847e+00),
|
||||
/* 400 Hz*/
|
||||
new IIRCoefficients(9.8689036168e-01, 6.5548191616e-03, 1.9836646251e+00),
|
||||
/* 500 Hz*/
|
||||
new IIRCoefficients(9.8364027156e-01, 8.1798642207e-03, 1.9786090689e+00),
|
||||
/* 630 Hz*/
|
||||
new IIRCoefficients(9.7943153305e-01, 1.0284233476e-02, 1.9714629236e+00),
|
||||
/* 800 Hz*/
|
||||
new IIRCoefficients(9.7395577681e-01, 1.3022111597e-02, 1.9611472340e+00),
|
||||
/* 1k Hz*/
|
||||
new IIRCoefficients(9.6755437936e-01, 1.6222810321e-02, 1.9476180811e+00),
|
||||
/* 1.25k Hz*/
|
||||
new IIRCoefficients(9.5961458750e-01, 2.0192706249e-02, 1.9286193446e+00),
|
||||
/* 1.6k Hz*/
|
||||
new IIRCoefficients(9.4861481164e-01, 2.5692594182e-02, 1.8982024567e+00),
|
||||
/* 2k Hz*/
|
||||
new IIRCoefficients(9.3620971896e-01, 3.1895140519e-02, 1.8581325022e+00),
|
||||
/* 2.5k Hz*/
|
||||
new IIRCoefficients(9.2095325455e-01, 3.9523372724e-02, 1.8003794694e+00),
|
||||
/* 3.15k Hz*/
|
||||
new IIRCoefficients(9.0153642498e-01, 4.9231787512e-02, 1.7132251201e+00),
|
||||
/* 4k Hz*/
|
||||
new IIRCoefficients(8.7685876255e-01, 6.1570618727e-02, 1.5802270232e+00),
|
||||
/* 5k Hz*/
|
||||
new IIRCoefficients(8.4886734822e-01, 7.5566325889e-02, 1.3992391376e+00),
|
||||
/* 6.3k Hz*/
|
||||
new IIRCoefficients(8.1417575446e-01, 9.2912122771e-02, 1.1311200817e+00),
|
||||
/* 8k Hz*/
|
||||
new IIRCoefficients(7.7175298860e-01, 1.1412350570e-01, 7.4018523020e-01),
|
||||
/* 10k Hz*/
|
||||
new IIRCoefficients(7.2627049462e-01, 1.3686475269e-01, 2.5120552756e-01),
|
||||
/* 12.5k Hz*/
|
||||
new IIRCoefficients(6.7674787974e-01, 1.6162606013e-01, -3.4978377639e-01),
|
||||
/* 16k Hz*/
|
||||
new IIRCoefficients(6.2482197550e-01, 1.8758901225e-01, -1.0576558797e+00),
|
||||
/* 20k Hz*/
|
||||
new IIRCoefficients(6.1776148240e-01, 1.9111925880e-01, -1.5492465594e+00)
|
||||
};
|
||||
public final static IIRCoefficients iir_cf31_48000[] = {
|
||||
/* 20 Hz*/
|
||||
new IIRCoefficients(9.9939388451e-01, 3.0305774630e-04, 1.9993870327e+00),
|
||||
/* 25 Hz*/
|
||||
new IIRCoefficients(9.9924247917e-01, 3.7876041632e-04, 1.9992317740e+00),
|
||||
/* 31.5 Hz*/
|
||||
new IIRCoefficients(9.9904564663e-01, 4.7717668529e-04, 1.9990286528e+00),
|
||||
/* 40 Hz*/
|
||||
new IIRCoefficients(9.9878827195e-01, 6.0586402557e-04, 1.9987608731e+00),
|
||||
/* 50 Hz*/
|
||||
new IIRCoefficients(9.9848556942e-01, 7.5721528829e-04, 1.9984427652e+00),
|
||||
/* 63 Hz*/
|
||||
new IIRCoefficients(9.9809219264e-01, 9.5390367779e-04, 1.9980242502e+00),
|
||||
/* 80 Hz*/
|
||||
new IIRCoefficients(9.9757801538e-01, 1.2109923088e-03, 1.9974684869e+00),
|
||||
/* 100 Hz*/
|
||||
new IIRCoefficients(9.9697343933e-01, 1.5132803374e-03, 1.9968023538e+00),
|
||||
/* 125 Hz*/
|
||||
new IIRCoefficients(9.9621823598e-01, 1.8908820086e-03, 1.9959510180e+00),
|
||||
/* 160 Hz*/
|
||||
new IIRCoefficients(9.9516191728e-01, 2.4190413595e-03, 1.9947243453e+00),
|
||||
/* 200 Hz*/
|
||||
new IIRCoefficients(9.9395607757e-01, 3.0219612131e-03, 1.9932727986e+00),
|
||||
/* 250 Hz*/
|
||||
new IIRCoefficients(9.9245085008e-01, 3.7745749576e-03, 1.9913840669e+00),
|
||||
/* 315 Hz*/
|
||||
new IIRCoefficients(9.9049749914e-01, 4.7512504310e-03, 1.9888056233e+00),
|
||||
/* 400 Hz*/
|
||||
new IIRCoefficients(9.8794899744e-01, 6.0255012789e-03, 1.9852245824e+00),
|
||||
/* 500 Hz*/
|
||||
new IIRCoefficients(9.8495930023e-01, 7.5203498850e-03, 1.9807093500e+00),
|
||||
/* 630 Hz*/
|
||||
new IIRCoefficients(9.8108651246e-01, 9.4567437704e-03, 1.9743538683e+00),
|
||||
/* 800 Hz*/
|
||||
new IIRCoefficients(9.7604570090e-01, 1.1977149551e-02, 1.9652207158e+00),
|
||||
/* 1k Hz*/
|
||||
new IIRCoefficients(9.7014963927e-01, 1.4925180364e-02, 1.9532947360e+00),
|
||||
/* 1.25k Hz*/
|
||||
new IIRCoefficients(9.6283181641e-01, 1.8584091793e-02, 1.9366149237e+00),
|
||||
/* 1.6k Hz*/
|
||||
new IIRCoefficients(9.5268463224e-01, 2.3657683878e-02, 1.9100137880e+00),
|
||||
/* 2k Hz*/
|
||||
new IIRCoefficients(9.4122788957e-01, 2.9386055213e-02, 1.8750821533e+00),
|
||||
/* 2.5k Hz*/
|
||||
new IIRCoefficients(9.2711765003e-01, 3.6441174983e-02, 1.8248457659e+00),
|
||||
/* 3.15k Hz*/
|
||||
new IIRCoefficients(9.0912548757e-01, 4.5437256213e-02, 1.7491177803e+00),
|
||||
/* 4k Hz*/
|
||||
new IIRCoefficients(8.8619860800e-01, 5.6900696000e-02, 1.6334959111e+00),
|
||||
/* 5k Hz*/
|
||||
new IIRCoefficients(8.6010264114e-01, 6.9948679430e-02, 1.4757186436e+00),
|
||||
/* 6.3k Hz*/
|
||||
new IIRCoefficients(8.2760520925e-01, 8.6197395374e-02, 1.2405797786e+00),
|
||||
/* 8k Hz*/
|
||||
new IIRCoefficients(7.8757448309e-01, 1.0621275845e-01, 8.9378724155e-01),
|
||||
/* 10k Hz*/
|
||||
new IIRCoefficients(7.4415362476e-01, 1.2792318762e-01, 4.5142017567e-01),
|
||||
/* 12.5k Hz*/
|
||||
new IIRCoefficients(6.9581428034e-01, 1.5209285983e-01, -1.1091156053e-01),
|
||||
/* 16k Hz*/
|
||||
new IIRCoefficients(6.4120506488e-01, 1.7939746756e-01, -8.2060253244e-01),
|
||||
/* 20k Hz*/
|
||||
new IIRCoefficients(6.0884213704e-01, 1.9557893148e-01, -1.3932981614e+00),
|
||||
};
|
||||
public final static IIRCoefficients iir_cf31_96000[] = {
|
||||
/* 20 Hz */
|
||||
new IIRCoefficients(9.9918221139e-01, 4.0889430323e-04, 1.9991804986e+00),
|
||||
/* 25 Hz */
|
||||
new IIRCoefficients(9.9962373418e-01, 1.8813291151e-04, 1.9996210574e+00),
|
||||
/* 31.5 Hz */
|
||||
new IIRCoefficients(9.9950924659e-01, 2.4537670644e-04, 1.9995049971e+00),
|
||||
/* 40 Hz */
|
||||
new IIRCoefficients(9.9939477210e-01, 3.0261394841e-04, 1.9993879203e+00),
|
||||
/* 50 Hz */
|
||||
new IIRCoefficients(9.9924760988e-01, 3.7619506167e-04, 1.9992369047e+00),
|
||||
/* 63 Hz */
|
||||
new IIRCoefficients(9.9901873389e-01, 4.9063305250e-04, 1.9990017403e+00),
|
||||
/* 80 Hz */
|
||||
new IIRCoefficients(9.9878991029e-01, 6.0504485723e-04, 1.9987625114e+00),
|
||||
/* 100 Hz */
|
||||
new IIRCoefficients(9.9852846169e-01, 7.3576915625e-04, 1.9984856565e+00),
|
||||
/* 125 Hz */
|
||||
new IIRCoefficients(9.9803842973e-01, 9.8078513561e-04, 1.9979715632e+00),
|
||||
/* 160 Hz */
|
||||
new IIRCoefficients(9.9754863778e-01, 1.2256811083e-03, 1.9974391109e+00),
|
||||
/* 200 Hz */
|
||||
new IIRCoefficients(9.9705908562e-01, 1.4704571921e-03, 1.9968879927e+00),
|
||||
/* 250 Hz */
|
||||
new IIRCoefficients(9.9624369754e-01, 1.8781512307e-03, 1.9959764762e+00),
|
||||
/* 315 Hz */
|
||||
new IIRCoefficients(9.9510327003e-01, 2.4483649847e-03, 1.9946792773e+00),
|
||||
/* 400 Hz */
|
||||
new IIRCoefficients(9.9396414160e-01, 3.0179291997e-03, 1.9932808599e+00),
|
||||
/* 500 Hz */
|
||||
new IIRCoefficients(9.9250145198e-01, 3.7492740081e-03, 1.9914346418e+00),
|
||||
/* 630 Hz */
|
||||
new IIRCoefficients(9.9023040090e-01, 4.8847995509e-03, 1.9885387521e+00),
|
||||
/* 800 Hz */
|
||||
new IIRCoefficients(9.8796449555e-01, 6.0177522243e-03, 1.9852400593e+00),
|
||||
/* 1000 Hz */
|
||||
new IIRCoefficients(9.8538116034e-01, 7.3094198292e-03, 1.9811303069e+00),
|
||||
/* 1250 Hz */
|
||||
new IIRCoefficients(9.8055531891e-01, 9.7223405432e-03, 1.9739308353e+00),
|
||||
/* 1600 Hz */
|
||||
new IIRCoefficients(9.7575264994e-01, 1.2123675032e-02, 1.9649292702e+00),
|
||||
/* 2000 Hz */
|
||||
new IIRCoefficients(9.7097292946e-01, 1.4513535269e-02, 1.9541109828e+00),
|
||||
/* 2500 Hz */
|
||||
new IIRCoefficients(9.6305712557e-01, 1.8471437214e-02, 1.9368372235e+00),
|
||||
/* 3150 Hz */
|
||||
new IIRCoefficients(9.5207914671e-01, 2.3960426645e-02, 1.9107394812e+00),
|
||||
/* 4000 Hz */
|
||||
new IIRCoefficients(9.4122023318e-01, 2.9389883411e-02, 1.8750747578e+00),
|
||||
/* 5000 Hz */
|
||||
new IIRCoefficients(9.2742950588e-01, 3.6285247058e-02, 1.8251410716e+00),
|
||||
/* 6300 Hz */
|
||||
new IIRCoefficients(9.0634716904e-01, 4.6826415482e-02, 1.7465723184e+00),
|
||||
/* 8000 Hz */
|
||||
new IIRCoefficients(8.8569806727e-01, 5.7150966366e-02, 1.6330624302e+00),
|
||||
/* 10000 Hz */
|
||||
new IIRCoefficients(8.6260593228e-01, 6.8697033860e-02, 1.4777046382e+00),
|
||||
/* 12500 Hz */
|
||||
new IIRCoefficients(8.2067879086e-01, 8.9660604570e-02, 1.2446020061e+00),
|
||||
/* 16000 Hz */
|
||||
new IIRCoefficients(7.8040765969e-01, 1.0979617015e-01, 8.9020383015e-01),
|
||||
/* 20000 Hz */
|
||||
new IIRCoefficients(2.6794919254e-01, 3.6602540373e-01, 3.2816939955e-01),
|
||||
|
||||
public final static IIRCoefficients iir_cf10_44100[] = {
|
||||
/* 31 Hz*/
|
||||
new IIRCoefficients(9.9688176273e-01, 1.5591186337e-03, 1.9968622855e+00),
|
||||
/* 62 Hz*/
|
||||
new IIRCoefficients(9.9377323686e-01, 3.1133815717e-03, 1.9936954495e+00),
|
||||
/* 125 Hz*/
|
||||
new IIRCoefficients(9.8748575691e-01, 6.2571215431e-03, 1.9871705722e+00),
|
||||
/* 250 Hz*/
|
||||
new IIRCoefficients(9.7512812040e-01, 1.2435939802e-02, 1.9738753198e+00),
|
||||
/* 500 Hz*/
|
||||
new IIRCoefficients(9.5087485437e-01, 2.4562572817e-02, 1.9459267562e+00),
|
||||
/* 1k Hz*/
|
||||
new IIRCoefficients(9.0416308662e-01, 4.7918456688e-02, 1.8848691023e+00),
|
||||
/* 2k Hz*/
|
||||
new IIRCoefficients(8.1751373987e-01, 9.1243130064e-02, 1.7442229115e+00),
|
||||
/* 4k Hz*/
|
||||
new IIRCoefficients(6.6840529852e-01, 1.6579735074e-01, 1.4047189863e+00),
|
||||
/* 8k Hz*/
|
||||
new IIRCoefficients(4.4858358977e-01, 2.7570820511e-01, 6.0517475334e-01),
|
||||
/* 16k Hz*/
|
||||
new IIRCoefficients(2.4198119087e-01, 3.7900940457e-01, -8.0845085113e-01)
|
||||
};
|
||||
|
||||
public final static IIRCoefficients iir_cf10_48000[] = {
|
||||
/* 31 Hz*/
|
||||
new IIRCoefficients(9.9713475915e-01, 1.4326204244e-03, 1.9971183163e+00),
|
||||
/* 62 Hz*/
|
||||
new IIRCoefficients(9.9427771143e-01, 2.8611442874e-03, 1.9942120343e+00),
|
||||
/* 125 Hz*/
|
||||
new IIRCoefficients(9.8849666727e-01, 5.7516663664e-03, 1.9882304829e+00),
|
||||
/* 250 Hz*/
|
||||
new IIRCoefficients(9.7712566171e-01, 1.1437169144e-02, 1.9760670839e+00),
|
||||
/* 500 Hz*/
|
||||
new IIRCoefficients(9.5477456091e-01, 2.2612719547e-02, 1.9505892385e+00),
|
||||
/* 1k Hz*/
|
||||
new IIRCoefficients(9.1159452679e-01, 4.4202736607e-02, 1.8952405706e+00),
|
||||
/* 2k Hz*/
|
||||
new IIRCoefficients(8.3100647694e-01, 8.4496761532e-02, 1.7686164442e+00),
|
||||
/* 4k Hz*/
|
||||
new IIRCoefficients(6.9062328809e-01, 1.5468835596e-01, 1.4641227157e+00),
|
||||
/* 8k Hz*/
|
||||
new IIRCoefficients(4.7820368352e-01, 2.6089815824e-01, 7.3910184176e-01),
|
||||
/* 16k Hz*/
|
||||
new IIRCoefficients(2.5620076154e-01, 3.7189961923e-01, -6.2810038077e-01)
|
||||
};
|
||||
|
||||
public final static IIRCoefficients iir_cf15_44100[] = {
|
||||
/* 25 Hz*/
|
||||
new IIRCoefficients(9.9834072702e-01, 8.2963648917e-04, 1.9983280505e+00),
|
||||
/* 40 Hz*/
|
||||
new IIRCoefficients(9.9734652663e-01, 1.3267366865e-03, 1.9973140908e+00),
|
||||
/* 63 Hz*/
|
||||
new IIRCoefficients(9.9582396353e-01, 2.0880182333e-03, 1.9957435641e+00),
|
||||
/* 100 Hz*/
|
||||
new IIRCoefficients(9.9337951306e-01, 3.3102434709e-03, 1.9931771947e+00),
|
||||
/* 160 Hz*/
|
||||
new IIRCoefficients(9.8942832039e-01, 5.2858398053e-03, 1.9889114258e+00),
|
||||
/* 250 Hz*/
|
||||
new IIRCoefficients(9.8353109588e-01, 8.2344520610e-03, 1.9822729654e+00),
|
||||
/* 400 Hz*/
|
||||
new IIRCoefficients(9.7378088082e-01, 1.3109559588e-02, 1.9705764276e+00),
|
||||
/* 630 Hz*/
|
||||
new IIRCoefficients(9.5901979676e-01, 2.0490101620e-02, 1.9511333590e+00),
|
||||
/* 1k Hz*/
|
||||
new IIRCoefficients(9.3574903986e-01, 3.2125480071e-02, 1.9161350100e+00),
|
||||
/* 1.6k Hz*/
|
||||
new IIRCoefficients(8.9923630641e-01, 5.0381846793e-02, 1.8501014162e+00),
|
||||
/* 2.5k Hz*/
|
||||
new IIRCoefficients(8.4722457681e-01, 7.6387711593e-02, 1.7312785699e+00),
|
||||
/* 4k Hz*/
|
||||
new IIRCoefficients(7.6755471307e-01, 1.1622264346e-01, 1.4881981417e+00),
|
||||
/* 6.3k Hz*/
|
||||
new IIRCoefficients(6.6125377473e-01, 1.6937311263e-01, 1.0357747868e+00),
|
||||
/* 10k Hz*/
|
||||
new IIRCoefficients(5.2683267950e-01, 2.3658366025e-01, 2.2218349322e-01),
|
||||
/* 16k Hz*/
|
||||
new IIRCoefficients(4.0179628792e-01, 2.9910185604e-01, -9.1248032613e-01)
|
||||
};
|
||||
|
||||
public final static IIRCoefficients iir_cf15_48000[] = {
|
||||
/* 25 Hz*/
|
||||
new IIRCoefficients(9.9847546664e-01, 7.6226668143e-04, 1.9984647656e+00),
|
||||
/* 40 Hz*/
|
||||
new IIRCoefficients(9.9756184654e-01, 1.2190767289e-03, 1.9975344645e+00),
|
||||
/* 63 Hz*/
|
||||
new IIRCoefficients(9.9616261379e-01, 1.9186931041e-03, 1.9960947369e+00),
|
||||
/* 100 Hz*/
|
||||
new IIRCoefficients(9.9391578543e-01, 3.0421072865e-03, 1.9937449618e+00),
|
||||
/* 160 Hz*/
|
||||
new IIRCoefficients(9.9028307215e-01, 4.8584639242e-03, 1.9898465702e+00),
|
||||
/* 250 Hz*/
|
||||
new IIRCoefficients(9.8485897264e-01, 7.5705136795e-03, 1.9837962543e+00),
|
||||
/* 400 Hz*/
|
||||
new IIRCoefficients(9.7588512657e-01, 1.2057436715e-02, 1.9731772447e+00),
|
||||
/* 630 Hz*/
|
||||
new IIRCoefficients(9.6228521814e-01, 1.8857390928e-02, 1.9556164694e+00),
|
||||
/* 1k Hz*/
|
||||
new IIRCoefficients(9.4080933132e-01, 2.9595334338e-02, 1.9242054384e+00),
|
||||
/* 1.6k Hz*/
|
||||
new IIRCoefficients(9.0702059196e-01, 4.6489704022e-02, 1.8653476166e+00),
|
||||
/* 2.5k Hz*/
|
||||
new IIRCoefficients(8.5868004289e-01, 7.0659978553e-02, 1.7600401337e+00),
|
||||
/* 4k Hz*/
|
||||
new IIRCoefficients(7.8409610788e-01, 1.0795194606e-01, 1.5450725522e+00),
|
||||
/* 6.3k Hz*/
|
||||
new IIRCoefficients(6.8332861002e-01, 1.5833569499e-01, 1.1426447155e+00),
|
||||
/* 10k Hz*/
|
||||
new IIRCoefficients(5.5267518228e-01, 2.2366240886e-01, 4.0186190803e-01),
|
||||
/* 16k Hz*/
|
||||
new IIRCoefficients(4.1811888447e-01, 2.9094055777e-01, -7.0905944223e-01)
|
||||
};
|
||||
|
||||
public final static IIRCoefficients iir_cf25_44100[] = {
|
||||
/* 20 Hz*/
|
||||
new IIRCoefficients(9.9934037157e-01, 3.2981421662e-04, 1.9993322545e+00),
|
||||
/* 31.5 Hz*/
|
||||
new IIRCoefficients(9.9896129025e-01, 5.1935487310e-04, 1.9989411587e+00),
|
||||
/* 40 Hz*/
|
||||
new IIRCoefficients(9.9868118265e-01, 6.5940867495e-04, 1.9986487252e+00),
|
||||
/* 50 Hz*/
|
||||
new IIRCoefficients(9.9835175161e-01, 8.2412419683e-04, 1.9983010452e+00),
|
||||
/* 80 Hz*/
|
||||
new IIRCoefficients(9.9736411067e-01, 1.3179446674e-03, 1.9972343673e+00),
|
||||
/* 100 Hz*/
|
||||
new IIRCoefficients(9.9670622662e-01, 1.6468866919e-03, 1.9965035707e+00),
|
||||
/* 125 Hz*/
|
||||
new IIRCoefficients(9.9588448566e-01, 2.0577571681e-03, 1.9955679690e+00),
|
||||
/* 160 Hz*/
|
||||
new IIRCoefficients(9.9473519326e-01, 2.6324033689e-03, 1.9942169198e+00),
|
||||
/* 250 Hz*/
|
||||
new IIRCoefficients(9.9178600786e-01, 4.1069960678e-03, 1.9905226414e+00),
|
||||
/* 315 Hz*/
|
||||
new IIRCoefficients(9.8966154150e-01, 5.1692292513e-03, 1.9876580847e+00),
|
||||
/* 400 Hz*/
|
||||
new IIRCoefficients(9.8689036168e-01, 6.5548191616e-03, 1.9836646251e+00),
|
||||
/* 500 Hz*/
|
||||
new IIRCoefficients(9.8364027156e-01, 8.1798642207e-03, 1.9786090689e+00),
|
||||
/* 800 Hz*/
|
||||
new IIRCoefficients(9.7395577681e-01, 1.3022111597e-02, 1.9611472340e+00),
|
||||
/* 1k Hz*/
|
||||
new IIRCoefficients(9.6755437936e-01, 1.6222810321e-02, 1.9476180811e+00),
|
||||
/* 1.25k Hz*/
|
||||
new IIRCoefficients(9.5961458750e-01, 2.0192706249e-02, 1.9286193446e+00),
|
||||
/* 1.6k Hz*/
|
||||
new IIRCoefficients(9.4861481164e-01, 2.5692594182e-02, 1.8982024567e+00),
|
||||
/* 2.5k Hz*/
|
||||
new IIRCoefficients(9.2095325455e-01, 3.9523372724e-02, 1.8003794694e+00),
|
||||
/* 3.15k Hz*/
|
||||
new IIRCoefficients(9.0153642498e-01, 4.9231787512e-02, 1.7132251201e+00),
|
||||
/* 4k Hz*/
|
||||
new IIRCoefficients(8.7685876255e-01, 6.1570618727e-02, 1.5802270232e+00),
|
||||
/* 5k Hz*/
|
||||
new IIRCoefficients(8.4886734822e-01, 7.5566325889e-02, 1.3992391376e+00),
|
||||
/* 8k Hz*/
|
||||
new IIRCoefficients(7.7175298860e-01, 1.1412350570e-01, 7.4018523020e-01),
|
||||
/* 10k Hz*/
|
||||
new IIRCoefficients(7.2627049462e-01, 1.3686475269e-01, 2.5120552756e-01),
|
||||
/* 12.5k Hz*/
|
||||
new IIRCoefficients(6.7674787974e-01, 1.6162606013e-01, -3.4978377639e-01),
|
||||
/* 16k Hz*/
|
||||
new IIRCoefficients(6.2482197550e-01, 1.8758901225e-01, -1.0576558797e+00),
|
||||
/* 20k Hz*/
|
||||
new IIRCoefficients(6.1776148240e-01, 1.9111925880e-01, -1.5492465594e+00)
|
||||
};
|
||||
|
||||
public final static IIRCoefficients iir_cf25_48000[] = {
|
||||
/* 20 Hz*/
|
||||
new IIRCoefficients(9.9939388451e-01, 3.0305774630e-04, 1.9993870327e+00),
|
||||
/* 31.5 Hz*/
|
||||
new IIRCoefficients(9.9904564663e-01, 4.7717668529e-04, 1.9990286528e+00),
|
||||
/* 40 Hz*/
|
||||
new IIRCoefficients(9.9878827195e-01, 6.0586402557e-04, 1.9987608731e+00),
|
||||
/* 50 Hz*/
|
||||
new IIRCoefficients(9.9848556942e-01, 7.5721528829e-04, 1.9984427652e+00),
|
||||
/* 80 Hz*/
|
||||
new IIRCoefficients(9.9757801538e-01, 1.2109923088e-03, 1.9974684869e+00),
|
||||
/* 100 Hz*/
|
||||
new IIRCoefficients(9.9697343933e-01, 1.5132803374e-03, 1.9968023538e+00),
|
||||
/* 125 Hz*/
|
||||
new IIRCoefficients(9.9621823598e-01, 1.8908820086e-03, 1.9959510180e+00),
|
||||
/* 160 Hz*/
|
||||
new IIRCoefficients(9.9516191728e-01, 2.4190413595e-03, 1.9947243453e+00),
|
||||
/* 250 Hz*/
|
||||
new IIRCoefficients(9.9245085008e-01, 3.7745749576e-03, 1.9913840669e+00),
|
||||
/* 315 Hz*/
|
||||
new IIRCoefficients(9.9049749914e-01, 4.7512504310e-03, 1.9888056233e+00),
|
||||
/* 400 Hz*/
|
||||
new IIRCoefficients(9.8794899744e-01, 6.0255012789e-03, 1.9852245824e+00),
|
||||
/* 500 Hz*/
|
||||
new IIRCoefficients(9.8495930023e-01, 7.5203498850e-03, 1.9807093500e+00),
|
||||
/* 800 Hz*/
|
||||
new IIRCoefficients(9.7604570090e-01, 1.1977149551e-02, 1.9652207158e+00),
|
||||
/* 1k Hz*/
|
||||
new IIRCoefficients(9.7014963927e-01, 1.4925180364e-02, 1.9532947360e+00),
|
||||
/* 1.25k Hz*/
|
||||
new IIRCoefficients(9.6283181641e-01, 1.8584091793e-02, 1.9366149237e+00),
|
||||
/* 1.6k Hz*/
|
||||
new IIRCoefficients(9.5268463224e-01, 2.3657683878e-02, 1.9100137880e+00),
|
||||
/* 2.5k Hz*/
|
||||
new IIRCoefficients(9.2711765003e-01, 3.6441174983e-02, 1.8248457659e+00),
|
||||
/* 3.15k Hz*/
|
||||
new IIRCoefficients(9.0912548757e-01, 4.5437256213e-02, 1.7491177803e+00),
|
||||
/* 4k Hz*/
|
||||
new IIRCoefficients(8.8619860800e-01, 5.6900696000e-02, 1.6334959111e+00),
|
||||
/* 5k Hz*/
|
||||
new IIRCoefficients(8.6010264114e-01, 6.9948679430e-02, 1.4757186436e+00),
|
||||
/* 8k Hz*/
|
||||
new IIRCoefficients(7.8757448309e-01, 1.0621275845e-01, 8.9378724155e-01),
|
||||
/* 10k Hz*/
|
||||
new IIRCoefficients(7.4415362476e-01, 1.2792318762e-01, 4.5142017567e-01),
|
||||
/* 12.5k Hz*/
|
||||
new IIRCoefficients(6.9581428034e-01, 1.5209285983e-01, -1.1091156053e-01),
|
||||
/* 16k Hz*/
|
||||
new IIRCoefficients(6.4120506488e-01, 1.7939746756e-01, -8.2060253244e-01),
|
||||
/* 20k Hz*/
|
||||
new IIRCoefficients(6.0884213704e-01, 1.9557893148e-01, -1.3932981614e+00)
|
||||
};
|
||||
|
||||
public final static IIRCoefficients iir_cf31_44100[] = {
|
||||
/* 20 Hz*/
|
||||
new IIRCoefficients(9.9934037157e-01, 3.2981421662e-04, 1.9993322545e+00),
|
||||
/* 25 Hz*/
|
||||
new IIRCoefficients(9.9917555233e-01, 4.1222383516e-04, 1.9991628705e+00),
|
||||
/* 31.5 Hz*/
|
||||
new IIRCoefficients(9.9896129025e-01, 5.1935487310e-04, 1.9989411587e+00),
|
||||
/* 40 Hz*/
|
||||
new IIRCoefficients(9.9868118265e-01, 6.5940867495e-04, 1.9986487252e+00),
|
||||
/* 50 Hz*/
|
||||
new IIRCoefficients(9.9835175161e-01, 8.2412419683e-04, 1.9983010452e+00),
|
||||
/* 63 Hz*/
|
||||
new IIRCoefficients(9.9792365217e-01, 1.0381739160e-03, 1.9978431682e+00),
|
||||
/* 80 Hz*/
|
||||
new IIRCoefficients(9.9736411067e-01, 1.3179446674e-03, 1.9972343673e+00),
|
||||
/* 100 Hz*/
|
||||
new IIRCoefficients(9.9670622662e-01, 1.6468866919e-03, 1.9965035707e+00),
|
||||
/* 125 Hz*/
|
||||
new IIRCoefficients(9.9588448566e-01, 2.0577571681e-03, 1.9955679690e+00),
|
||||
/* 160 Hz*/
|
||||
new IIRCoefficients(9.9473519326e-01, 2.6324033689e-03, 1.9942169198e+00),
|
||||
/* 200 Hz*/
|
||||
new IIRCoefficients(9.9342335280e-01, 3.2883236020e-03, 1.9926141028e+00),
|
||||
/* 250 Hz*/
|
||||
new IIRCoefficients(9.9178600786e-01, 4.1069960678e-03, 1.9905226414e+00),
|
||||
/* 315 Hz*/
|
||||
new IIRCoefficients(9.8966154150e-01, 5.1692292513e-03, 1.9876580847e+00),
|
||||
/* 400 Hz*/
|
||||
new IIRCoefficients(9.8689036168e-01, 6.5548191616e-03, 1.9836646251e+00),
|
||||
/* 500 Hz*/
|
||||
new IIRCoefficients(9.8364027156e-01, 8.1798642207e-03, 1.9786090689e+00),
|
||||
/* 630 Hz*/
|
||||
new IIRCoefficients(9.7943153305e-01, 1.0284233476e-02, 1.9714629236e+00),
|
||||
/* 800 Hz*/
|
||||
new IIRCoefficients(9.7395577681e-01, 1.3022111597e-02, 1.9611472340e+00),
|
||||
/* 1k Hz*/
|
||||
new IIRCoefficients(9.6755437936e-01, 1.6222810321e-02, 1.9476180811e+00),
|
||||
/* 1.25k Hz*/
|
||||
new IIRCoefficients(9.5961458750e-01, 2.0192706249e-02, 1.9286193446e+00),
|
||||
/* 1.6k Hz*/
|
||||
new IIRCoefficients(9.4861481164e-01, 2.5692594182e-02, 1.8982024567e+00),
|
||||
/* 2k Hz*/
|
||||
new IIRCoefficients(9.3620971896e-01, 3.1895140519e-02, 1.8581325022e+00),
|
||||
/* 2.5k Hz*/
|
||||
new IIRCoefficients(9.2095325455e-01, 3.9523372724e-02, 1.8003794694e+00),
|
||||
/* 3.15k Hz*/
|
||||
new IIRCoefficients(9.0153642498e-01, 4.9231787512e-02, 1.7132251201e+00),
|
||||
/* 4k Hz*/
|
||||
new IIRCoefficients(8.7685876255e-01, 6.1570618727e-02, 1.5802270232e+00),
|
||||
/* 5k Hz*/
|
||||
new IIRCoefficients(8.4886734822e-01, 7.5566325889e-02, 1.3992391376e+00),
|
||||
/* 6.3k Hz*/
|
||||
new IIRCoefficients(8.1417575446e-01, 9.2912122771e-02, 1.1311200817e+00),
|
||||
/* 8k Hz*/
|
||||
new IIRCoefficients(7.7175298860e-01, 1.1412350570e-01, 7.4018523020e-01),
|
||||
/* 10k Hz*/
|
||||
new IIRCoefficients(7.2627049462e-01, 1.3686475269e-01, 2.5120552756e-01),
|
||||
/* 12.5k Hz*/
|
||||
new IIRCoefficients(6.7674787974e-01, 1.6162606013e-01, -3.4978377639e-01),
|
||||
/* 16k Hz*/
|
||||
new IIRCoefficients(6.2482197550e-01, 1.8758901225e-01, -1.0576558797e+00),
|
||||
/* 20k Hz*/
|
||||
new IIRCoefficients(6.1776148240e-01, 1.9111925880e-01, -1.5492465594e+00)
|
||||
};
|
||||
|
||||
public final static IIRCoefficients iir_cf31_48000[] = {
|
||||
/* 20 Hz*/
|
||||
new IIRCoefficients(9.9939388451e-01, 3.0305774630e-04, 1.9993870327e+00),
|
||||
/* 25 Hz*/
|
||||
new IIRCoefficients(9.9924247917e-01, 3.7876041632e-04, 1.9992317740e+00),
|
||||
/* 31.5 Hz*/
|
||||
new IIRCoefficients(9.9904564663e-01, 4.7717668529e-04, 1.9990286528e+00),
|
||||
/* 40 Hz*/
|
||||
new IIRCoefficients(9.9878827195e-01, 6.0586402557e-04, 1.9987608731e+00),
|
||||
/* 50 Hz*/
|
||||
new IIRCoefficients(9.9848556942e-01, 7.5721528829e-04, 1.9984427652e+00),
|
||||
/* 63 Hz*/
|
||||
new IIRCoefficients(9.9809219264e-01, 9.5390367779e-04, 1.9980242502e+00),
|
||||
/* 80 Hz*/
|
||||
new IIRCoefficients(9.9757801538e-01, 1.2109923088e-03, 1.9974684869e+00),
|
||||
/* 100 Hz*/
|
||||
new IIRCoefficients(9.9697343933e-01, 1.5132803374e-03, 1.9968023538e+00),
|
||||
/* 125 Hz*/
|
||||
new IIRCoefficients(9.9621823598e-01, 1.8908820086e-03, 1.9959510180e+00),
|
||||
/* 160 Hz*/
|
||||
new IIRCoefficients(9.9516191728e-01, 2.4190413595e-03, 1.9947243453e+00),
|
||||
/* 200 Hz*/
|
||||
new IIRCoefficients(9.9395607757e-01, 3.0219612131e-03, 1.9932727986e+00),
|
||||
/* 250 Hz*/
|
||||
new IIRCoefficients(9.9245085008e-01, 3.7745749576e-03, 1.9913840669e+00),
|
||||
/* 315 Hz*/
|
||||
new IIRCoefficients(9.9049749914e-01, 4.7512504310e-03, 1.9888056233e+00),
|
||||
/* 400 Hz*/
|
||||
new IIRCoefficients(9.8794899744e-01, 6.0255012789e-03, 1.9852245824e+00),
|
||||
/* 500 Hz*/
|
||||
new IIRCoefficients(9.8495930023e-01, 7.5203498850e-03, 1.9807093500e+00),
|
||||
/* 630 Hz*/
|
||||
new IIRCoefficients(9.8108651246e-01, 9.4567437704e-03, 1.9743538683e+00),
|
||||
/* 800 Hz*/
|
||||
new IIRCoefficients(9.7604570090e-01, 1.1977149551e-02, 1.9652207158e+00),
|
||||
/* 1k Hz*/
|
||||
new IIRCoefficients(9.7014963927e-01, 1.4925180364e-02, 1.9532947360e+00),
|
||||
/* 1.25k Hz*/
|
||||
new IIRCoefficients(9.6283181641e-01, 1.8584091793e-02, 1.9366149237e+00),
|
||||
/* 1.6k Hz*/
|
||||
new IIRCoefficients(9.5268463224e-01, 2.3657683878e-02, 1.9100137880e+00),
|
||||
/* 2k Hz*/
|
||||
new IIRCoefficients(9.4122788957e-01, 2.9386055213e-02, 1.8750821533e+00),
|
||||
/* 2.5k Hz*/
|
||||
new IIRCoefficients(9.2711765003e-01, 3.6441174983e-02, 1.8248457659e+00),
|
||||
/* 3.15k Hz*/
|
||||
new IIRCoefficients(9.0912548757e-01, 4.5437256213e-02, 1.7491177803e+00),
|
||||
/* 4k Hz*/
|
||||
new IIRCoefficients(8.8619860800e-01, 5.6900696000e-02, 1.6334959111e+00),
|
||||
/* 5k Hz*/
|
||||
new IIRCoefficients(8.6010264114e-01, 6.9948679430e-02, 1.4757186436e+00),
|
||||
/* 6.3k Hz*/
|
||||
new IIRCoefficients(8.2760520925e-01, 8.6197395374e-02, 1.2405797786e+00),
|
||||
/* 8k Hz*/
|
||||
new IIRCoefficients(7.8757448309e-01, 1.0621275845e-01, 8.9378724155e-01),
|
||||
/* 10k Hz*/
|
||||
new IIRCoefficients(7.4415362476e-01, 1.2792318762e-01, 4.5142017567e-01),
|
||||
/* 12.5k Hz*/
|
||||
new IIRCoefficients(6.9581428034e-01, 1.5209285983e-01, -1.1091156053e-01),
|
||||
/* 16k Hz*/
|
||||
new IIRCoefficients(6.4120506488e-01, 1.7939746756e-01, -8.2060253244e-01),
|
||||
/* 20k Hz*/
|
||||
new IIRCoefficients(6.0884213704e-01, 1.9557893148e-01, -1.3932981614e+00),
|
||||
};
|
||||
|
||||
public final static IIRCoefficients iir_cf31_96000[] = {
|
||||
/* 20.0 Hz */
|
||||
new IIRCoefficients(9.9969659208e-01, 1.517040e-04, 1.9996948789e+00),
|
||||
/* 25.0 Hz */
|
||||
new IIRCoefficients(9.9962116126e-01, 1.894194e-04, 1.9996184845e+00),
|
||||
/* 31.5 Hz */
|
||||
new IIRCoefficients(9.9952283343e-01, 2.385833e-04, 1.9995185840e+00),
|
||||
/* 40.0 Hz */
|
||||
new IIRCoefficients(9.9939398196e-01, 3.030090e-04, 1.9993871301e+00),
|
||||
/* 50.0 Hz */
|
||||
new IIRCoefficients(9.9924251688e-01, 3.787416e-04, 1.9992318117e+00),
|
||||
/* 63.0 Hz */
|
||||
new IIRCoefficients(9.9904565182e-01, 4.771741e-04, 1.9990286580e+00),
|
||||
/* 80.0 Hz */
|
||||
new IIRCoefficients(9.9878828573e-01, 6.058571e-04, 1.9987608868e+00),
|
||||
/* 100.0 Hz */
|
||||
new IIRCoefficients(9.9848557077e-01, 7.572146e-04, 1.9984427665e+00),
|
||||
/* 125.0 Hz */
|
||||
new IIRCoefficients(9.9810732562e-01, 9.463372e-04, 1.9980404568e+00),
|
||||
/* 160.0 Hz */
|
||||
new IIRCoefficients(9.9757801618e-01, 1.210992e-03, 1.9974684877e+00),
|
||||
/* 200.0 Hz */
|
||||
new IIRCoefficients(9.9697343858e-01, 1.513281e-03, 1.9968023530e+00),
|
||||
/* 250.0 Hz */
|
||||
new IIRCoefficients(9.9621823615e-01, 1.890882e-03, 1.9959510182e+00),
|
||||
/* 315.0 Hz */
|
||||
new IIRCoefficients(9.9523733132e-01, 2.381334e-03, 1.9948133101e+00),
|
||||
/* 400.0 Hz */
|
||||
new IIRCoefficients(9.9395607744e-01, 3.021961e-03, 1.9932727985e+00),
|
||||
/* 500.0 Hz */
|
||||
new IIRCoefficients(9.9245084999e-01, 3.774575e-03, 1.9913840669e+00),
|
||||
/* 630.0 Hz */
|
||||
new IIRCoefficients(9.9049749915e-01, 4.751250e-03, 1.9888056234e+00),
|
||||
/* 800.0 Hz */
|
||||
new IIRCoefficients(9.8794899744e-01, 6.025501e-03, 1.9852245824e+00),
|
||||
/* 1000.0 Hz */
|
||||
new IIRCoefficients(9.8495930024e-01, 7.520350e-03, 1.9807093500e+00),
|
||||
/* 1250.0 Hz */
|
||||
new IIRCoefficients(9.8123517675e-01, 9.382412e-03, 1.9746084192e+00),
|
||||
/* 1600.0 Hz */
|
||||
new IIRCoefficients(9.7604570090e-01, 1.197715e-02, 1.9652207158e+00),
|
||||
/* 2000.0 Hz */
|
||||
new IIRCoefficients(9.7014963927e-01, 1.492518e-02, 1.9532947360e+00),
|
||||
/* 2500.0 Hz */
|
||||
new IIRCoefficients(9.6283181641e-01, 1.858409e-02, 1.9366149237e+00),
|
||||
/* 3150.0 Hz */
|
||||
new IIRCoefficients(9.5340564248e-01, 2.329718e-02, 1.9120378855e+00),
|
||||
/* 4000.0 Hz */
|
||||
new IIRCoefficients(9.4122788957e-01, 2.938606e-02, 1.8750821533e+00),
|
||||
/* 5000.0 Hz */
|
||||
new IIRCoefficients(9.2711765003e-01, 3.644117e-02, 1.8248457659e+00),
|
||||
/* 6300.0 Hz */
|
||||
new IIRCoefficients(9.0912548757e-01, 4.543726e-02, 1.7491177803e+00),
|
||||
/* 8000.0 Hz */
|
||||
new IIRCoefficients(8.8619860800e-01, 5.690070e-02, 1.6334959111e+00),
|
||||
/* 10000.0 Hz */
|
||||
new IIRCoefficients(8.6010264114e-01, 6.994868e-02, 1.4757186436e+00),
|
||||
/* 12500.0 Hz */
|
||||
new IIRCoefficients(8.2882509035e-01, 8.558745e-02, 1.2501707535e+00),
|
||||
/* 16000.0 Hz */
|
||||
new IIRCoefficients(7.8757448309e-01, 1.062128e-01, 8.9378724155e-01),
|
||||
/* 20000.0 Hz */
|
||||
new IIRCoefficients(7.4415362476e-01, 1.279232e-01, 4.5142017567e-01),
|
||||
};
|
||||
}
|
||||
|
||||
@@ -17,6 +17,7 @@ import edu.cmu.sphinx.api.*;
|
||||
import edu.cmu.sphinx.decoder.adaptation.*;
|
||||
import edu.cmu.sphinx.result.*;
|
||||
import java.nio.file.Files;
|
||||
import java.util.zip.*;
|
||||
|
||||
public class AudiobookRecorder extends JFrame {
|
||||
|
||||
@@ -65,14 +66,14 @@ public class AudiobookRecorder extends JFrame {
|
||||
Sentence selectedSentence = null;
|
||||
|
||||
JPanel sampleControl;
|
||||
Waveform sampleWaveform;
|
||||
public Waveform sampleWaveform;
|
||||
JScrollBar sampleScroll;
|
||||
|
||||
JSpinner postSentenceGap;
|
||||
JCheckBox locked;
|
||||
|
||||
JButton reprocessAudioFFT;
|
||||
JButton reprocessAudioPeak;
|
||||
JButtonSpacePlay reprocessAudioFFT;
|
||||
JButtonSpacePlay reprocessAudioPeak;
|
||||
|
||||
Thread playingThread = null;
|
||||
|
||||
@@ -317,9 +318,7 @@ public class AudiobookRecorder extends JFrame {
|
||||
|
||||
sampleControl.add(sampleWaveform, BorderLayout.CENTER);
|
||||
|
||||
reprocessAudioFFT = new JButton(Icons.fft);
|
||||
reprocessAudioFFT.setToolTipText("Autotrim Audio (FFT)");
|
||||
reprocessAudioFFT.addActionListener(new ActionListener() {
|
||||
reprocessAudioFFT = new JButtonSpacePlay(Icons.fft, "Autotrim Audio (FFT)", new ActionListener() {
|
||||
public void actionPerformed(ActionEvent e) {
|
||||
if (selectedSentence != null) {
|
||||
selectedSentence.autoTrimSampleFFT();
|
||||
@@ -331,9 +330,7 @@ public class AudiobookRecorder extends JFrame {
|
||||
}
|
||||
});
|
||||
|
||||
reprocessAudioPeak = new JButton(Icons.peak);
|
||||
reprocessAudioPeak.setToolTipText("Autotrim Audio (Peak)");
|
||||
reprocessAudioPeak.addActionListener(new ActionListener() {
|
||||
reprocessAudioPeak = new JButtonSpacePlay(Icons.peak, "Autotrim Audio (Peak)", new ActionListener() {
|
||||
public void actionPerformed(ActionEvent e) {
|
||||
if (selectedSentence != null) {
|
||||
selectedSentence.autoTrimSamplePeak();
|
||||
@@ -362,13 +359,15 @@ public class AudiobookRecorder extends JFrame {
|
||||
JToolBar controlsLeft = new JToolBar(JToolBar.VERTICAL);
|
||||
JToolBar controlsRight = new JToolBar(JToolBar.VERTICAL);
|
||||
|
||||
controlsTop.setFloatable(false);
|
||||
controlsLeft.setFloatable(false);
|
||||
controlsRight.setFloatable(false);
|
||||
|
||||
controlsLeft.add(reprocessAudioFFT);
|
||||
controlsLeft.add(reprocessAudioPeak);
|
||||
|
||||
locked = new JCheckBox("Sentence locked");
|
||||
locked = new JCheckBox("Phrase locked");
|
||||
locked.setFocusable(false);
|
||||
|
||||
locked.addActionListener(new ActionListener() {
|
||||
public void actionPerformed(ActionEvent e) {
|
||||
@@ -388,22 +387,21 @@ public class AudiobookRecorder extends JFrame {
|
||||
|
||||
controlsTop.add(locked);
|
||||
|
||||
controlsTop.add(Box.createHorizontalGlue());
|
||||
controlsTop.add(new JLabel("Post gap:"));
|
||||
controlsTop.add(postSentenceGap);
|
||||
controlsTop.add(new JLabel("ms"));
|
||||
controlsTop.add(Box.createHorizontalGlue());
|
||||
|
||||
JButton zoomIn = new JButton(Icons.zoomIn);
|
||||
zoomIn.setToolTipText("Zoom In");
|
||||
zoomIn.addActionListener(new ActionListener() {
|
||||
|
||||
JButtonSpacePlay zoomIn = new JButtonSpacePlay(Icons.zoomIn, "Zoom In", new ActionListener() {
|
||||
public void actionPerformed(ActionEvent e) {
|
||||
sampleWaveform.increaseZoom();
|
||||
}
|
||||
});
|
||||
controlsRight.add(zoomIn);
|
||||
|
||||
JButton zoomOut = new JButton(Icons.zoomOut);
|
||||
zoomOut.setToolTipText("Zoom Out");
|
||||
zoomOut.addActionListener(new ActionListener() {
|
||||
JButtonSpacePlay zoomOut = new JButtonSpacePlay(Icons.zoomOut, "Zoom Out", new ActionListener() {
|
||||
public void actionPerformed(ActionEvent e) {
|
||||
sampleWaveform.decreaseZoom();
|
||||
}
|
||||
@@ -424,6 +422,9 @@ public class AudiobookRecorder extends JFrame {
|
||||
|
||||
buildToolbar(centralPanel);
|
||||
|
||||
centralPanel.getInputMap(JComponent.WHEN_IN_FOCUSED_WINDOW).put(KeyStroke.getKeyStroke("F"), "startRecordShort");
|
||||
centralPanel.getInputMap(JComponent.WHEN_IN_FOCUSED_WINDOW).put(KeyStroke.getKeyStroke("released F"), "stopRecord");
|
||||
|
||||
centralPanel.getInputMap(JComponent.WHEN_IN_FOCUSED_WINDOW).put(KeyStroke.getKeyStroke("R"), "startRecord");
|
||||
centralPanel.getInputMap(JComponent.WHEN_IN_FOCUSED_WINDOW).put(KeyStroke.getKeyStroke("released R"), "stopRecord");
|
||||
|
||||
@@ -432,7 +433,7 @@ public class AudiobookRecorder extends JFrame {
|
||||
|
||||
centralPanel.getInputMap(JComponent.WHEN_IN_FOCUSED_WINDOW).put(KeyStroke.getKeyStroke("released D"), "deleteLast");
|
||||
|
||||
centralPanel.getInputMap(JComponent.WHEN_IN_FOCUSED_WINDOW).put(KeyStroke.getKeyStroke("SPACE"), "startPlayback");
|
||||
centralPanel.getInputMap(JComponent.WHEN_IN_FOCUSED_WINDOW).put(KeyStroke.getKeyStroke("SPACE"), "startStopPlayback");
|
||||
|
||||
centralPanel.getInputMap(JComponent.WHEN_IN_FOCUSED_WINDOW).put(KeyStroke.getKeyStroke("E"), "startRerecord");
|
||||
centralPanel.getInputMap(JComponent.WHEN_IN_FOCUSED_WINDOW).put(KeyStroke.getKeyStroke("released E"), "stopRecord");
|
||||
@@ -447,6 +448,16 @@ public class AudiobookRecorder extends JFrame {
|
||||
startRecording();
|
||||
}
|
||||
});
|
||||
centralPanel.getActionMap().put("startRecordShort", new AbstractAction() {
|
||||
public void actionPerformed(ActionEvent e) {
|
||||
if (bookTree.isEditing()) return;
|
||||
if (getNoiseFloor() == 0) {
|
||||
alertNoRoomNoise();
|
||||
return;
|
||||
}
|
||||
startRecordingShort();
|
||||
}
|
||||
});
|
||||
centralPanel.getActionMap().put("startRecordNewPara", new AbstractAction() {
|
||||
public void actionPerformed(ActionEvent e) {
|
||||
if (bookTree.isEditing()) return;
|
||||
@@ -480,10 +491,14 @@ public class AudiobookRecorder extends JFrame {
|
||||
}
|
||||
});
|
||||
|
||||
centralPanel.getActionMap().put("startPlayback", new AbstractAction() {
|
||||
centralPanel.getActionMap().put("startStopPlayback", new AbstractAction() {
|
||||
public void actionPerformed(ActionEvent e) {
|
||||
if (bookTree.isEditing()) return;
|
||||
playSelectedSentence();
|
||||
if (playing == null) {
|
||||
playSelectedSentence();
|
||||
} else {
|
||||
stopPlaying();
|
||||
}
|
||||
}
|
||||
});
|
||||
|
||||
@@ -509,6 +524,18 @@ public class AudiobookRecorder extends JFrame {
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
if (!Options.getBoolean("interface.donations.hide")) {
|
||||
int numruns = Options.getInteger("interface.donations.count");
|
||||
numruns++;
|
||||
if (numruns == 10) {
|
||||
numruns = 0;
|
||||
JOptionPane.showMessageDialog(this, new DonationPanel(), "Thank you", JOptionPane.PLAIN_MESSAGE);
|
||||
}
|
||||
Options.set("interface.donations.count", numruns);
|
||||
Options.savePreferences();
|
||||
}
|
||||
|
||||
}
|
||||
|
||||
public static void main(String args[]) {
|
||||
@@ -631,7 +658,7 @@ public class AudiobookRecorder extends JFrame {
|
||||
|
||||
JPopupMenu menu = new JPopupMenu();
|
||||
JMenuObject rec = new JMenuObject("Recognise text from audio", s);
|
||||
JMenu moveMenu = new JMenu("Move sentence to...");
|
||||
JMenu moveMenu = new JMenu("Move phrase to...");
|
||||
|
||||
for (Enumeration c = book.children(); c.hasMoreElements();) {
|
||||
Chapter chp = (Chapter)c.nextElement();
|
||||
@@ -677,8 +704,9 @@ public class AudiobookRecorder extends JFrame {
|
||||
});
|
||||
|
||||
|
||||
JMenuObject ins = new JMenuObject("Insert sentence above", s);
|
||||
JMenuObject del = new JMenuObject("Delete sentence", s);
|
||||
JMenuObject ins = new JMenuObject("Insert phrase above", s);
|
||||
JMenuObject del = new JMenuObject("Delete phrase", s);
|
||||
JMenuObject dup = new JMenuObject("Duplicate phrase", s);
|
||||
|
||||
|
||||
ins.addActionListener(new ActionListener() {
|
||||
@@ -704,6 +732,21 @@ public class AudiobookRecorder extends JFrame {
|
||||
}
|
||||
});
|
||||
|
||||
dup.addActionListener(new ActionListener() {
|
||||
public void actionPerformed(ActionEvent e) {
|
||||
try {
|
||||
JMenuObject o = (JMenuObject)e.getSource();
|
||||
Sentence s = (Sentence)o.getObject();
|
||||
Sentence newSentence = s.cloneSentence();
|
||||
Chapter c = (Chapter)s.getParent();
|
||||
int idx = bookTreeModel.getIndexOfChild(c, s);
|
||||
bookTreeModel.insertNodeInto(newSentence, c, idx);
|
||||
} catch (Exception ex) {
|
||||
ex.printStackTrace();
|
||||
}
|
||||
}
|
||||
});
|
||||
|
||||
rec.addActionListener(new ActionListener() {
|
||||
public void actionPerformed(ActionEvent e) {
|
||||
JMenuObject o = (JMenuObject)e.getSource();
|
||||
@@ -726,6 +769,8 @@ public class AudiobookRecorder extends JFrame {
|
||||
menu.addSeparator();
|
||||
menu.add(ins);
|
||||
menu.add(del);
|
||||
menu.addSeparator();
|
||||
menu.add(dup);
|
||||
menu.show(bookTree, e.getX(), e.getY());
|
||||
} else if (node instanceof Chapter) {
|
||||
Chapter c = (Chapter)node;
|
||||
@@ -734,11 +779,12 @@ public class AudiobookRecorder extends JFrame {
|
||||
|
||||
JPopupMenu menu = new JPopupMenu();
|
||||
JMenuObject peak = new JMenuObject("Auto-trim all (Peak)", c);
|
||||
JMenuObject fft = new JMenuObject("Auto-trim all (FFT)", c);
|
||||
JMenuObject moveUp = new JMenuObject("Move Up", c);
|
||||
JMenuObject moveDown = new JMenuObject("Move Down", c);
|
||||
JMenu mergeWith = new JMenu("Merge chapter with");
|
||||
JMenuObject lockAll = new JMenuObject("Lock all sentences", c);
|
||||
JMenuObject unlockAll = new JMenuObject("Unlock all sentences", c);
|
||||
JMenuObject lockAll = new JMenuObject("Lock all phrases", c);
|
||||
JMenuObject unlockAll = new JMenuObject("Unlock all phrases", c);
|
||||
JMenuObject exportChapter = new JMenuObject("Export chapter", c);
|
||||
JMenuObject deleteChapter = new JMenuObject("Delete chapter", c);
|
||||
|
||||
@@ -747,7 +793,7 @@ public class AudiobookRecorder extends JFrame {
|
||||
JMenuObject o = (JMenuObject)e.getSource();
|
||||
Chapter chap = (Chapter)o.getObject();
|
||||
|
||||
ExportDialog ed = new ExportDialog("Exporting " + chap.getName());
|
||||
ProgressDialog ed = new ProgressDialog("Exporting " + chap.getName());
|
||||
|
||||
ExportThread t = new ExportThread(chap, ed);
|
||||
Thread nt = new Thread(t);
|
||||
@@ -839,6 +885,19 @@ public class AudiobookRecorder extends JFrame {
|
||||
}
|
||||
});
|
||||
|
||||
fft.addActionListener(new ActionListener() {
|
||||
public void actionPerformed(ActionEvent e) {
|
||||
JMenuObject o = (JMenuObject)e.getSource();
|
||||
Chapter c = (Chapter)o.getObject();
|
||||
for (Enumeration s = c.children(); s.hasMoreElements();) {
|
||||
Sentence snt = (Sentence)s.nextElement();
|
||||
if (!snt.isLocked()) {
|
||||
snt.autoTrimSampleFFT();
|
||||
}
|
||||
}
|
||||
}
|
||||
});
|
||||
|
||||
lockAll.addActionListener(new ActionListener() {
|
||||
public void actionPerformed(ActionEvent e) {
|
||||
JMenuObject o = (JMenuObject)e.getSource();
|
||||
@@ -886,6 +945,7 @@ public class AudiobookRecorder extends JFrame {
|
||||
menu.add(mergeWith);
|
||||
menu.addSeparator();
|
||||
menu.add(peak);
|
||||
menu.add(fft);
|
||||
menu.addSeparator();
|
||||
menu.add(lockAll);
|
||||
menu.add(unlockAll);
|
||||
@@ -933,6 +993,59 @@ public class AudiobookRecorder extends JFrame {
|
||||
}
|
||||
}
|
||||
|
||||
public void startRecordingShort() {
|
||||
|
||||
if (recording != null) return;
|
||||
if (book == null) return;
|
||||
|
||||
if (microphone == null) {
|
||||
JOptionPane.showMessageDialog(this, "Microphone not started. Start microphone first.", "Error", JOptionPane.ERROR_MESSAGE);
|
||||
return;
|
||||
}
|
||||
|
||||
toolBar.disableBook();
|
||||
toolBar.disableSentence();
|
||||
|
||||
DefaultMutableTreeNode selectedNode = (DefaultMutableTreeNode)bookTree.getLastSelectedPathComponent();
|
||||
|
||||
if (selectedNode == null) {
|
||||
selectedNode = book.getLastChapter();
|
||||
bookTree.setSelectionPath(new TreePath(selectedNode.getPath()));
|
||||
}
|
||||
|
||||
if (selectedNode instanceof Book) {
|
||||
selectedNode = book.getLastChapter();
|
||||
bookTree.setSelectionPath(new TreePath(selectedNode.getPath()));
|
||||
}
|
||||
|
||||
if (selectedNode instanceof Sentence) {
|
||||
selectedNode = (DefaultMutableTreeNode)selectedNode.getParent();
|
||||
bookTree.setSelectionPath(new TreePath(selectedNode.getPath()));
|
||||
}
|
||||
|
||||
Chapter c = (Chapter)selectedNode;
|
||||
|
||||
DefaultMutableTreeNode lastLeaf = c.getLastLeaf();
|
||||
|
||||
if (lastLeaf instanceof Sentence) {
|
||||
Sentence lastSentence = (Sentence)lastLeaf;
|
||||
lastSentence.setPostGap(Options.getInteger("catenation.short-sentence"));
|
||||
}
|
||||
|
||||
Sentence s = new Sentence();
|
||||
bookTreeModel.insertNodeInto(s, c, c.getChildCount());
|
||||
|
||||
bookTree.expandPath(new TreePath(c.getPath()));
|
||||
bookTree.setSelectionPath(new TreePath(s.getPath()));
|
||||
bookTree.scrollPathToVisible(new TreePath(s.getPath()));
|
||||
|
||||
if (s.startRecording()) {
|
||||
recording = s;
|
||||
centralPanel.setFlash(true);
|
||||
}
|
||||
}
|
||||
|
||||
|
||||
public void startRecordingNewParagraph() {
|
||||
|
||||
if (recording != null) return;
|
||||
@@ -1431,7 +1544,7 @@ public class AudiobookRecorder extends JFrame {
|
||||
}
|
||||
|
||||
ms *= 10;
|
||||
ms /= 9;
|
||||
ms /= 7;
|
||||
return ms;
|
||||
}
|
||||
|
||||
@@ -1460,21 +1573,52 @@ public class AudiobookRecorder extends JFrame {
|
||||
}
|
||||
}
|
||||
|
||||
|
||||
public void playSelectedSentence() {
|
||||
if (selectedSentence == null) return;
|
||||
|
||||
if (playing != null) return;
|
||||
|
||||
if (getNoiseFloor() == 0) {
|
||||
alertNoRoomNoise();
|
||||
return;
|
||||
}
|
||||
playing = selectedSentence;
|
||||
|
||||
toolBar.disableSentence();
|
||||
toolBar.enableStop();
|
||||
|
||||
|
||||
playingThread = new Thread(new Runnable() {
|
||||
public void run() {
|
||||
playing.play();
|
||||
playing = null;
|
||||
Sentence s = playing;
|
||||
byte[] data;
|
||||
|
||||
try {
|
||||
|
||||
AudioFormat format = s.getAudioFormat();
|
||||
play = AudioSystem.getSourceDataLine(format, Options.getPlaybackMixer());
|
||||
play.open(format);
|
||||
play.start();
|
||||
|
||||
bookTree.scrollPathToVisible(new TreePath(s.getPath()));
|
||||
data = s.getRawAudioData();
|
||||
for (int pos = 0; pos < data.length; pos += 1024) {
|
||||
sampleWaveform.setPlayMarker(pos / format.getFrameSize());
|
||||
int l = data.length - pos;
|
||||
if (l > 1024) l = 1024;
|
||||
play.write(data, pos, l);
|
||||
}
|
||||
|
||||
play.drain();
|
||||
play.stop();
|
||||
play.close();
|
||||
play = null;
|
||||
} catch (Exception e) {
|
||||
playing = null;
|
||||
if (play != null) {
|
||||
play.drain();
|
||||
play.stop();
|
||||
play.close();
|
||||
}
|
||||
play = null;
|
||||
}
|
||||
toolBar.enableSentence();
|
||||
toolBar.disableStop();
|
||||
}
|
||||
@@ -1482,14 +1626,13 @@ public class AudiobookRecorder extends JFrame {
|
||||
|
||||
playingThread.setDaemon(true);
|
||||
playingThread.start();
|
||||
|
||||
}
|
||||
|
||||
class ExportThread implements Runnable {
|
||||
ExportDialog exportDialog;
|
||||
ProgressDialog exportDialog;
|
||||
Chapter chapter;
|
||||
|
||||
public ExportThread(Chapter c, ExportDialog e) {
|
||||
public ExportThread(Chapter c, ProgressDialog e) {
|
||||
super();
|
||||
exportDialog = e;
|
||||
chapter = c;
|
||||
@@ -1514,7 +1657,7 @@ public class AudiobookRecorder extends JFrame {
|
||||
|
||||
for (Enumeration o = book.children(); o.hasMoreElements();) {
|
||||
Chapter c = (Chapter)o.nextElement();
|
||||
ExportDialog ed = new ExportDialog("Exporting " + c.getName());
|
||||
ProgressDialog ed = new ProgressDialog("Exporting " + c.getName());
|
||||
|
||||
ExportThread t = new ExportThread(c, ed);
|
||||
Thread nt = new Thread(t);
|
||||
@@ -1563,7 +1706,12 @@ public class AudiobookRecorder extends JFrame {
|
||||
play.write(data, 0, data.length);
|
||||
}
|
||||
data = s.getRawAudioData();
|
||||
play.write(data, 0, data.length);
|
||||
for (int pos = 0; pos < data.length; pos += 1024) {
|
||||
sampleWaveform.setPlayMarker(pos / format.getFrameSize());
|
||||
int l = data.length - pos;
|
||||
if (l > 1024) l = 1024;
|
||||
play.write(data, pos, l);
|
||||
}
|
||||
|
||||
DefaultMutableTreeNode next = s.getNextSibling();
|
||||
boolean last = false;
|
||||
@@ -1653,6 +1801,7 @@ public class AudiobookRecorder extends JFrame {
|
||||
equaliserWindow.pack();
|
||||
}
|
||||
equaliserWindow.setVisible(true);
|
||||
equaliserWindow.setLocationRelativeTo(this);
|
||||
}
|
||||
|
||||
public boolean enableMicrophone() {
|
||||
@@ -1706,9 +1855,12 @@ public class AudiobookRecorder extends JFrame {
|
||||
String[] lines = s.split("\n");
|
||||
|
||||
for (String line : lines) {
|
||||
line = line.trim();
|
||||
try {
|
||||
Process p = Runtime.getRuntime().exec(line);
|
||||
p.waitFor();
|
||||
if (!line.equals("")) {
|
||||
Process p = Runtime.getRuntime().exec(line);
|
||||
p.waitFor();
|
||||
}
|
||||
} catch (Exception e) {
|
||||
e.printStackTrace();
|
||||
}
|
||||
@@ -1778,7 +1930,6 @@ public class AudiobookRecorder extends JFrame {
|
||||
|
||||
public void mergeChapter(Properties prefs, String chid) {
|
||||
Chapter c = book.addChapter();
|
||||
System.err.println("Added chapter " + c.getId());
|
||||
c.setName("Merged-" + prefs.getProperty("chapter." + chid + ".name"));
|
||||
c.setPostGap(Utils.s2i(prefs.getProperty("chapter." + chid + ".post-gap")));
|
||||
c.setPreGap(Utils.s2i(prefs.getProperty("chapter." + chid + ".pre-gap")));
|
||||
@@ -1819,7 +1970,119 @@ System.err.println("Added chapter " + c.getId());
|
||||
}
|
||||
|
||||
}
|
||||
|
||||
|
||||
ArrayList<File> gatherFiles(File root) {
|
||||
ArrayList<File> fileList = new ArrayList<File>();
|
||||
File[] files = root.listFiles();
|
||||
for (File f : files) {
|
||||
if (f.getName().startsWith(".")) continue;
|
||||
if (!f.isDirectory()) {
|
||||
fileList.add(f);
|
||||
}
|
||||
}
|
||||
|
||||
for (File f : files) {
|
||||
if (f.getName().startsWith(".")) continue;
|
||||
if (f.isDirectory()) {
|
||||
fileList.add(f);
|
||||
fileList.addAll(gatherFiles(f));
|
||||
}
|
||||
}
|
||||
return fileList;
|
||||
}
|
||||
|
||||
public class ArchiveBookThread implements Runnable {
|
||||
ProgressDialog pd;
|
||||
|
||||
public ArchiveBookThread(ProgressDialog p) {
|
||||
pd = p;
|
||||
}
|
||||
|
||||
public void run() {
|
||||
try {
|
||||
String name = AudiobookRecorder.this.book.getName();
|
||||
File storageDir = new File(Options.get("path.storage"));
|
||||
File bookDir = new File(storageDir, name);
|
||||
File archiveDir = new File(storageDir, "archive");
|
||||
|
||||
ArrayList<File> fileList = gatherFiles(bookDir);
|
||||
|
||||
if (!archiveDir.exists()) {
|
||||
archiveDir.mkdirs();
|
||||
}
|
||||
|
||||
File archiveFile = new File(archiveDir, name + ".abz");
|
||||
System.err.println("Archiving to " + archiveFile.getAbsolutePath());
|
||||
if (archiveFile.exists()) {
|
||||
archiveFile.delete();
|
||||
}
|
||||
|
||||
FileOutputStream fos = new FileOutputStream(archiveFile);
|
||||
ZipOutputStream zos = new ZipOutputStream(fos);
|
||||
|
||||
zos.putNextEntry(new ZipEntry(name + "/"));
|
||||
zos.closeEntry();
|
||||
|
||||
int numFiles = fileList.size();
|
||||
int fileNo = 0;
|
||||
|
||||
String prefix = storageDir.getAbsolutePath();
|
||||
|
||||
for (File f : fileList) {
|
||||
fileNo++;
|
||||
int pct = fileNo * 2000 / numFiles;
|
||||
pd.setProgress(pct);
|
||||
|
||||
String path = f.getAbsolutePath().substring(prefix.length() + 1);
|
||||
|
||||
if (f.isDirectory()) {
|
||||
ZipEntry entry = new ZipEntry(path + "/");
|
||||
zos.putNextEntry(entry);
|
||||
zos.closeEntry();
|
||||
} else {
|
||||
ZipEntry entry = new ZipEntry(path);
|
||||
entry.setTime(f.lastModified());
|
||||
zos.putNextEntry(entry);
|
||||
|
||||
FileInputStream fis = new FileInputStream(f);
|
||||
byte[] buffer = new byte[1024];
|
||||
int bytesRead = 0;
|
||||
while ((bytesRead = fis.read(buffer, 0, 1024)) != -1) {
|
||||
zos.write(buffer, 0, bytesRead);
|
||||
}
|
||||
fis.close();
|
||||
zos.closeEntry();
|
||||
}
|
||||
}
|
||||
|
||||
zos.flush();
|
||||
zos.close();
|
||||
|
||||
while (fileList.size() > 0) {
|
||||
File f = fileList.remove(fileList.size() - 1);
|
||||
f.delete();
|
||||
}
|
||||
} catch (Exception e) {
|
||||
}
|
||||
pd.closeDialog();
|
||||
}
|
||||
}
|
||||
|
||||
public void archiveBook() {
|
||||
int r = JOptionPane.showConfirmDialog(this, "This will stash the current book away\nin the archives folder in a compressed\nform. The existing book files will be deleted\nand the book closed.\n\nAre you sure you want to do this?", "Archive Book", JOptionPane.OK_CANCEL_OPTION);
|
||||
|
||||
if (r == JOptionPane.OK_OPTION) {
|
||||
|
||||
ProgressDialog pd = new ProgressDialog("Archiving book...");
|
||||
saveBookStructure();
|
||||
|
||||
ArchiveBookThread runnable = new ArchiveBookThread(pd);
|
||||
Thread t = new Thread(runnable);
|
||||
t.start();
|
||||
pd.setVisible(true);
|
||||
book = null;
|
||||
bookTree = null;
|
||||
mainScroll.setViewportView(null);
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
@@ -38,6 +38,12 @@ public class BookPanel extends JPanel {
|
||||
genre = props.getProperty("book.genre");
|
||||
comment = props.getProperty("book.comment");
|
||||
File icon = new File(root, "coverart.png");
|
||||
if (!icon.exists()) {
|
||||
icon = new File(root, "coverart.jpg");
|
||||
}
|
||||
if (!icon.exists()) {
|
||||
icon = new File(root, "coverart.gif");
|
||||
}
|
||||
if (icon.exists()) {
|
||||
cover = new ImageIcon(icon.getAbsolutePath());
|
||||
resizedCover = Utils.getScaledImage(cover.getImage(), 75, 75);
|
||||
|
||||
@@ -23,6 +23,7 @@ public class BookTreeRenderer extends DefaultTreeCellRenderer {
|
||||
if (s.isInSample()) {
|
||||
ret.setIcon(Icons.star);
|
||||
}
|
||||
|
||||
} else if (value instanceof Chapter) {
|
||||
ret.setIcon(Icons.chapter);
|
||||
} else if (value instanceof Book) {
|
||||
|
||||
@@ -81,7 +81,7 @@ public class Chapter extends DefaultMutableTreeNode {
|
||||
}
|
||||
|
||||
@SuppressWarnings("unchecked")
|
||||
public void exportChapter(ExportDialog exportDialog) throws
|
||||
public void exportChapter(ProgressDialog exportDialog) throws
|
||||
FileNotFoundException, IOException, InputFormatException, NotSupportedException,
|
||||
EncoderException, UnsupportedTagException, InvalidDataException {
|
||||
|
||||
@@ -200,4 +200,18 @@ public class Chapter extends DefaultMutableTreeNode {
|
||||
wavFile.delete();
|
||||
}
|
||||
|
||||
public double getChapterLength() {
|
||||
double totalTime = Options.getInteger("audio.recording.pre-chapter") / 1000d;
|
||||
for (Enumeration s = children(); s.hasMoreElements();) {
|
||||
Sentence sentence = (Sentence)s.nextElement();
|
||||
totalTime += sentence.getLength();
|
||||
if (s.hasMoreElements()) {
|
||||
totalTime += (sentence.getPostGap() / 1000d);
|
||||
} else {
|
||||
totalTime += Options.getInteger("audio.recording.post-chapter") / 1000d;
|
||||
}
|
||||
}
|
||||
return totalTime;
|
||||
}
|
||||
|
||||
}
|
||||
|
||||
56
src/uk/co/majenko/audiobookrecorder/DonationPanel.java
Normal file
56
src/uk/co/majenko/audiobookrecorder/DonationPanel.java
Normal file
@@ -0,0 +1,56 @@
|
||||
package uk.co.majenko.audiobookrecorder;
|
||||
|
||||
import javax.swing.*;
|
||||
import java.awt.*;
|
||||
import java.awt.event.*;
|
||||
import javax.swing.border.*;
|
||||
import java.net.*;
|
||||
|
||||
public class DonationPanel extends JPanel {
|
||||
public DonationPanel() {
|
||||
super();
|
||||
setLayout(new BorderLayout());
|
||||
JLabel icon = new JLabel(Icons.dollar);
|
||||
icon.setBorder(new EmptyBorder(10, 10, 10, 10));
|
||||
add(icon, BorderLayout.WEST);
|
||||
|
||||
JTextArea label = new JTextArea(
|
||||
"Thank you for using AudiobookRecorder by\n" +
|
||||
"Majenko Technologies. This software is\n" +
|
||||
"Free Open Source Software (FOSS). It is\n" +
|
||||
"created and maintained voluntarily with\n" +
|
||||
"no possibility of any profits from it.\n" +
|
||||
"If you enjoy using this software and end\n" +
|
||||
"up making millions of dollars from using\n" +
|
||||
"it we hope that you would maybe kindly\n" +
|
||||
"donate a couple of those dollars to the\n" +
|
||||
"developer to help with the costs of maintaining\n" +
|
||||
"the software.\n" +
|
||||
"\n" +
|
||||
"You can donate by going to:\n" +
|
||||
"\n" +
|
||||
"https://paypal.me/majenko"
|
||||
);
|
||||
|
||||
label.setEditable(false);
|
||||
label.setFocusable(false);
|
||||
label.setBorder(new EmptyBorder(10, 10, 10, 10));
|
||||
add(label, BorderLayout.CENTER);
|
||||
|
||||
JButton donate = new JButton("Donate!");
|
||||
donate.addActionListener(new ActionListener() {
|
||||
public void actionPerformed(ActionEvent e) {
|
||||
if (Desktop.isDesktopSupported()) {
|
||||
try {
|
||||
Desktop.getDesktop().browse(new URI("https://paypal.me/majenko"));
|
||||
} catch (Exception ex) {
|
||||
}
|
||||
}
|
||||
}
|
||||
});
|
||||
|
||||
add(donate, BorderLayout.SOUTH);
|
||||
|
||||
|
||||
}
|
||||
}
|
||||
@@ -30,4 +30,5 @@ public class Icons {
|
||||
static public final ImageIcon mic = new ImageIcon(Icons.class.getResource("icons/mic.png"));
|
||||
static public final ImageIcon zoomIn = new ImageIcon(Icons.class.getResource("icons/zoom-in.png"));
|
||||
static public final ImageIcon zoomOut = new ImageIcon(Icons.class.getResource("icons/zoom-out.png"));
|
||||
static public final ImageIcon dollar = new ImageIcon(Icons.class.getResource("icons/dollar.png"));
|
||||
}
|
||||
|
||||
21
src/uk/co/majenko/audiobookrecorder/JButtonSpacePlay.java
Normal file
21
src/uk/co/majenko/audiobookrecorder/JButtonSpacePlay.java
Normal file
@@ -0,0 +1,21 @@
|
||||
package uk.co.majenko.audiobookrecorder;
|
||||
|
||||
import javax.swing.*;
|
||||
import javax.swing.event.*;
|
||||
import java.awt.*;
|
||||
import java.awt.event.*;
|
||||
|
||||
public class JButtonSpacePlay extends JButton {
|
||||
public JButtonSpacePlay(ImageIcon i, String tt, ActionListener al) {
|
||||
super(i);
|
||||
getInputMap(JComponent.WHEN_FOCUSED).put(
|
||||
KeyStroke.getKeyStroke(KeyEvent.VK_SPACE, 0),
|
||||
"startPlayback"
|
||||
);
|
||||
|
||||
setToolTipText(tt);
|
||||
addActionListener(al);
|
||||
setFocusPainted(false);
|
||||
setFocusable(false);
|
||||
}
|
||||
}
|
||||
@@ -0,0 +1,21 @@
|
||||
package uk.co.majenko.audiobookrecorder;
|
||||
|
||||
import javax.swing.*;
|
||||
import javax.swing.event.*;
|
||||
import java.awt.*;
|
||||
import java.awt.event.*;
|
||||
|
||||
public class JToggleButtonSpacePlay extends JToggleButton {
|
||||
public JToggleButtonSpacePlay(ImageIcon i, String tt, ActionListener al) {
|
||||
super(i);
|
||||
getInputMap(JComponent.WHEN_FOCUSED).put(
|
||||
KeyStroke.getKeyStroke(KeyEvent.VK_SPACE, 0),
|
||||
"startPlayback"
|
||||
);
|
||||
|
||||
setToolTipText(tt);
|
||||
addActionListener(al);
|
||||
setFocusPainted(false);
|
||||
setFocusable(false);
|
||||
}
|
||||
}
|
||||
@@ -7,15 +7,15 @@ import java.awt.event.*;
|
||||
|
||||
public class MainToolBar extends JToolBar {
|
||||
|
||||
JButton newBook;
|
||||
JButton openBook;
|
||||
JButton saveBook;
|
||||
JButton newChapter;
|
||||
JButton recordRoomNoise;
|
||||
JButton playSentence;
|
||||
JButton playonSentence;
|
||||
JButton stopPlaying;
|
||||
JButton eq;
|
||||
JButtonSpacePlay newBook;
|
||||
JButtonSpacePlay openBook;
|
||||
JButtonSpacePlay saveBook;
|
||||
JButtonSpacePlay newChapter;
|
||||
JButtonSpacePlay recordRoomNoise;
|
||||
JButtonSpacePlay playSentence;
|
||||
JButtonSpacePlay playonSentence;
|
||||
JButtonSpacePlay stopPlaying;
|
||||
JButtonSpacePlay eq;
|
||||
JToggleButton mic;
|
||||
|
||||
AudiobookRecorder root;
|
||||
@@ -25,27 +25,21 @@ public class MainToolBar extends JToolBar {
|
||||
|
||||
root = r;
|
||||
|
||||
newBook = new JButton(Icons.newBook);
|
||||
newBook.setToolTipText("New Book");
|
||||
newBook.addActionListener(new ActionListener() {
|
||||
newBook = new JButtonSpacePlay(Icons.newBook, "New Book", new ActionListener() {
|
||||
public void actionPerformed(ActionEvent e) {
|
||||
root.createNewBook();
|
||||
}
|
||||
});
|
||||
add(newBook);
|
||||
|
||||
openBook = new JButton(Icons.openBook);
|
||||
openBook.setToolTipText("Open Book");
|
||||
openBook.addActionListener(new ActionListener() {
|
||||
openBook = new JButtonSpacePlay(Icons.openBook, "Open Book", new ActionListener() {
|
||||
public void actionPerformed(ActionEvent e) {
|
||||
root.openBook();
|
||||
}
|
||||
});
|
||||
add(openBook);
|
||||
|
||||
saveBook = new JButton(Icons.save);
|
||||
saveBook.setToolTipText("Save Book");
|
||||
saveBook.addActionListener(new ActionListener() {
|
||||
saveBook = new JButtonSpacePlay(Icons.save, "Save Book", new ActionListener() {
|
||||
public void actionPerformed(ActionEvent e) {
|
||||
root.saveBookStructure();
|
||||
}
|
||||
@@ -54,18 +48,14 @@ public class MainToolBar extends JToolBar {
|
||||
|
||||
addSeparator();
|
||||
|
||||
newChapter = new JButton(Icons.newChapter);
|
||||
newChapter.setToolTipText("New Chapter");
|
||||
newChapter.addActionListener(new ActionListener() {
|
||||
newChapter = new JButtonSpacePlay(Icons.newChapter, "New Chapter", new ActionListener() {
|
||||
public void actionPerformed(ActionEvent e) {
|
||||
root.addChapter();
|
||||
}
|
||||
});
|
||||
add(newChapter);
|
||||
|
||||
recordRoomNoise = new JButton(Icons.recordRoom);
|
||||
recordRoomNoise.setToolTipText("Record Room Noise");
|
||||
recordRoomNoise.addActionListener(new ActionListener() {
|
||||
recordRoomNoise = new JButtonSpacePlay(Icons.recordRoom, "Record Room Noise", new ActionListener() {
|
||||
public void actionPerformed(ActionEvent e) {
|
||||
root.recordRoomNoise();
|
||||
}
|
||||
@@ -74,27 +64,21 @@ public class MainToolBar extends JToolBar {
|
||||
|
||||
addSeparator();
|
||||
|
||||
playSentence = new JButton(Icons.play);
|
||||
playSentence.setToolTipText("Play sentence");
|
||||
playSentence.addActionListener(new ActionListener() {
|
||||
playSentence = new JButtonSpacePlay(Icons.play, "Play sentence", new ActionListener() {
|
||||
public void actionPerformed(ActionEvent e) {
|
||||
root.playSelectedSentence();
|
||||
}
|
||||
});
|
||||
add(playSentence);
|
||||
|
||||
playonSentence = new JButton(Icons.playon);
|
||||
playonSentence.setToolTipText("Play from sentence");
|
||||
playonSentence.addActionListener(new ActionListener() {
|
||||
playonSentence = new JButtonSpacePlay(Icons.playon, "Play from sentence", new ActionListener() {
|
||||
public void actionPerformed(ActionEvent e) {
|
||||
root.playFromSelectedSentence();
|
||||
}
|
||||
});
|
||||
add(playonSentence);
|
||||
|
||||
stopPlaying = new JButton(Icons.stop);
|
||||
stopPlaying.setToolTipText("Stop playing / recording");
|
||||
stopPlaying.addActionListener(new ActionListener() {
|
||||
stopPlaying = new JButtonSpacePlay(Icons.stop, "Stop playing", new ActionListener() {
|
||||
public void actionPerformed(ActionEvent e) {
|
||||
root.stopPlaying();
|
||||
}
|
||||
@@ -102,9 +86,7 @@ public class MainToolBar extends JToolBar {
|
||||
add(stopPlaying);
|
||||
|
||||
addSeparator();
|
||||
eq = new JButton(Icons.eq);
|
||||
eq.setToolTipText("Equaliser");
|
||||
eq.addActionListener(new ActionListener() {
|
||||
eq = new JButtonSpacePlay(Icons.eq, "Equaliser", new ActionListener() {
|
||||
public void actionPerformed(ActionEvent e) {
|
||||
root.showEqualiser();
|
||||
}
|
||||
@@ -114,17 +96,24 @@ public class MainToolBar extends JToolBar {
|
||||
|
||||
addSeparator();
|
||||
|
||||
mic = new JToggleButton(Icons.mic);
|
||||
mic.setToolTipText("Enable/disable microphone");
|
||||
mic.addActionListener(new ActionListener() {
|
||||
mic = new JToggleButtonSpacePlay(Icons.mic, "Enable / disable microphone", new ActionListener() {
|
||||
Color bgCol = null;
|
||||
public void actionPerformed(ActionEvent e) {
|
||||
JToggleButton b = (JToggleButton)e.getSource();
|
||||
if (b.isSelected()) {
|
||||
if (!root.enableMicrophone()) {
|
||||
b.setSelected(false);
|
||||
} else {
|
||||
if (bgCol == null) {
|
||||
bgCol = b.getBackground();
|
||||
}
|
||||
b.setBackground(Color.RED);
|
||||
}
|
||||
} else {
|
||||
root.disableMicrophone();
|
||||
if (bgCol != null) {
|
||||
b.setBackground(bgCol);
|
||||
}
|
||||
}
|
||||
}
|
||||
});
|
||||
|
||||
@@ -20,10 +20,12 @@ public class Options extends JDialog {
|
||||
JComboBox<KVPair> channelList;
|
||||
JComboBox<KVPair> rateList;
|
||||
JComboBox<KVPair> bitDepth;
|
||||
JComboBox<KVPair> trimMethod;
|
||||
JTextField storageFolder;
|
||||
JSpinner preChapterGap;
|
||||
JSpinner postChapterGap;
|
||||
JSpinner postSentenceGap;
|
||||
JSpinner shortSentenceGap;
|
||||
JSpinner postParagraphGap;
|
||||
JTextField ffmpegLocation;
|
||||
JComboBox<KVPair> bitRate;
|
||||
@@ -247,6 +249,7 @@ public class Options extends JDialog {
|
||||
channelList = addDropdown(optionsPanel, "Channels:", getChannelCountList(), get("audio.recording.channels"));
|
||||
rateList = addDropdown(optionsPanel, "Sample rate:", getSampleRateList(), get("audio.recording.samplerate"));
|
||||
bitDepth = addDropdown(optionsPanel, "Sample resolution:", getResolutionList(), get("audio.recording.resolution"));
|
||||
trimMethod = addDropdown(optionsPanel, "Auto-trim method:", getTrimMethods(), get("audio.recording.trim"));
|
||||
|
||||
addSeparator(optionsPanel);
|
||||
|
||||
@@ -259,6 +262,7 @@ public class Options extends JDialog {
|
||||
preChapterGap = addSpinner(optionsPanel, "Default pre-chapter gap:", 0, 5000, 100, getInteger("catenation.pre-chapter"), "ms");
|
||||
postChapterGap = addSpinner(optionsPanel, "Default post-chapter gap:", 0, 5000, 100, getInteger("catenation.post-chapter"), "ms");
|
||||
postSentenceGap = addSpinner(optionsPanel, "Default post-sentence gap:", 0, 5000, 100, getInteger("catenation.post-sentence"), "ms");
|
||||
shortSentenceGap = addSpinner(optionsPanel, "Short post-sentence gap:", 0, 5000, 100, getInteger("catenation.short-sentence"), "ms");
|
||||
postParagraphGap = addSpinner(optionsPanel, "Default post-paragraph gap:", 0, 5000, 100, getInteger("catenation.post-paragraph"), "ms");
|
||||
|
||||
addSeparator(optionsPanel);
|
||||
@@ -444,6 +448,7 @@ public class Options extends JDialog {
|
||||
defaultPrefs.put("audio.recording.channels", "2");
|
||||
defaultPrefs.put("audio.recording.samplerate", "44100");
|
||||
defaultPrefs.put("audio.recording.resolution", "16");
|
||||
defaultPrefs.put("audio.recording.trim", "peak");
|
||||
if (playbackMixers.length > 0) {
|
||||
defaultPrefs.put("audio.playback.device", playbackMixers[0].key);
|
||||
} else {
|
||||
@@ -453,6 +458,7 @@ public class Options extends JDialog {
|
||||
defaultPrefs.put("catenation.pre-chapter", "1000");
|
||||
defaultPrefs.put("catenation.post-chapter", "1500");
|
||||
defaultPrefs.put("catenation.post-sentence", "1000");
|
||||
defaultPrefs.put("catenation.short-sentence", "100");
|
||||
defaultPrefs.put("catenation.post-paragraph", "2000");
|
||||
|
||||
defaultPrefs.put("path.storage", (new File(System.getProperty("user.home"), "Recordings")).toString());
|
||||
@@ -589,12 +595,14 @@ public class Options extends JDialog {
|
||||
set("audio.recording.channels", ((KVPair)channelList.getSelectedItem()).key);
|
||||
set("audio.recording.samplerate", ((KVPair)rateList.getSelectedItem()).key);
|
||||
set("audio.recording.resolution", ((KVPair)bitDepth.getSelectedItem()).key);
|
||||
set("audio.recording.trim", ((KVPair)trimMethod.getSelectedItem()).key);
|
||||
set("audio.playback.device", ((KVPair)playbackList.getSelectedItem()).key);
|
||||
set("path.storage", storageFolder.getText());
|
||||
set("path.ffmpeg", ffmpegLocation.getText());
|
||||
set("catenation.pre-chapter", preChapterGap.getValue());
|
||||
set("catenation.post-chapter", postChapterGap.getValue());
|
||||
set("catenation.post-sentence", postSentenceGap.getValue());
|
||||
set("catenation.short-sentence", shortSentenceGap.getValue());
|
||||
set("catenation.post-paragraph", postParagraphGap.getValue());
|
||||
set("audio.export.bitrate", ((KVPair)bitRate.getSelectedItem()).key);
|
||||
set("audio.export.samplerate", ((KVPair)exportRate.getSelectedItem()).key);
|
||||
@@ -652,4 +660,11 @@ public class Options extends JDialog {
|
||||
pairs[0] = new KVPair("16", "16 Bit");
|
||||
return pairs;
|
||||
}
|
||||
|
||||
public static KVPair[] getTrimMethods() {
|
||||
KVPair[] pairs = new KVPair[2];
|
||||
pairs[0] = new KVPair("peak", "Peak Amplitude");
|
||||
pairs[1] = new KVPair("fft", "FFT Analysis");
|
||||
return pairs;
|
||||
}
|
||||
}
|
||||
|
||||
@@ -8,7 +8,7 @@ import java.awt.event.*;
|
||||
import java.util.*;
|
||||
import it.sauronsoftware.jave.*;
|
||||
|
||||
public class ExportDialog extends JDialog implements EncoderProgressListener {
|
||||
public class ProgressDialog extends JDialog implements EncoderProgressListener {
|
||||
JLabel message;
|
||||
JLabel icon;
|
||||
|
||||
@@ -18,7 +18,7 @@ public class ExportDialog extends JDialog implements EncoderProgressListener {
|
||||
|
||||
|
||||
|
||||
public ExportDialog(String m) {
|
||||
public ProgressDialog(String m) {
|
||||
super();
|
||||
|
||||
setModalityType(Dialog.ModalityType.APPLICATION_MODAL);
|
||||
@@ -35,6 +35,8 @@ public class Sentence extends DefaultMutableTreeNode implements Cacheable {
|
||||
|
||||
TargetDataLine line;
|
||||
AudioInputStream inputStream;
|
||||
AudioFormat storedFormat = null;
|
||||
double storedLength = -1d;
|
||||
|
||||
int[] storedAudioData = null;
|
||||
|
||||
@@ -147,9 +149,16 @@ public class Sentence extends DefaultMutableTreeNode implements Cacheable {
|
||||
}
|
||||
|
||||
storedAudioData = null;
|
||||
storedFormat = null;
|
||||
storedLength = -1;
|
||||
|
||||
if (!id.equals("room-noise")) {
|
||||
autoTrimSamplePeak();
|
||||
String tm = Options.get("audio.recording.trim");
|
||||
if (tm.equals("peak")) {
|
||||
autoTrimSamplePeak();
|
||||
} else if (tm.equals("fft")) {
|
||||
autoTrimSampleFFT();
|
||||
}
|
||||
if (Options.getBoolean("process.sphinx")) {
|
||||
recognise();
|
||||
}
|
||||
@@ -256,6 +265,8 @@ public class Sentence extends DefaultMutableTreeNode implements Cacheable {
|
||||
end = i;
|
||||
}
|
||||
|
||||
end++;
|
||||
|
||||
if (end <= 0) {
|
||||
end = blocks - 1;
|
||||
}
|
||||
@@ -413,7 +424,7 @@ public class Sentence extends DefaultMutableTreeNode implements Cacheable {
|
||||
File f = getFile();
|
||||
try {
|
||||
AudioInputStream s = AudioSystem.getAudioInputStream(f);
|
||||
AudioFormat format = s.getFormat();
|
||||
AudioFormat format = getAudioFormat();
|
||||
|
||||
int[] samples = null;
|
||||
|
||||
@@ -495,7 +506,7 @@ public class Sentence extends DefaultMutableTreeNode implements Cacheable {
|
||||
try {
|
||||
AudioInputStream s = AudioSystem.getAudioInputStream(f);
|
||||
EqualizerInputStream eq = new EqualizerInputStream(s, 31);
|
||||
AudioFormat format = eq.getFormat();
|
||||
AudioFormat format = getAudioFormat();
|
||||
IIRControls controls = eq.getControls();
|
||||
AudiobookRecorder.window.book.equaliser.apply(controls, format.getChannels());
|
||||
|
||||
@@ -511,56 +522,20 @@ public class Sentence extends DefaultMutableTreeNode implements Cacheable {
|
||||
}
|
||||
|
||||
public AudioFormat getAudioFormat() {
|
||||
if (storedFormat != null) return storedFormat;
|
||||
|
||||
File f = getFile();
|
||||
try {
|
||||
AudioInputStream s = AudioSystem.getAudioInputStream(f);
|
||||
AudioFormat format = s.getFormat();
|
||||
return format;
|
||||
storedFormat = s.getFormat();
|
||||
s.close();
|
||||
return storedFormat;
|
||||
} catch (Exception e) {
|
||||
e.printStackTrace();
|
||||
}
|
||||
return null;
|
||||
}
|
||||
|
||||
public void play() {
|
||||
File f = getFile();
|
||||
try {
|
||||
AudioInputStream s = AudioSystem.getAudioInputStream(f);
|
||||
EqualizerInputStream eq = new EqualizerInputStream(s, 31);
|
||||
|
||||
AudioFormat format = eq.getFormat();
|
||||
|
||||
IIRControls controls = eq.getControls();
|
||||
AudiobookRecorder.window.book.equaliser.apply(controls, format.getChannels());
|
||||
|
||||
int frameSize = format.getFrameSize();
|
||||
|
||||
updateCrossings();
|
||||
|
||||
int pos = crossStartOffset * frameSize;
|
||||
|
||||
SourceDataLine play = AudioSystem.getSourceDataLine(format, Options.getPlaybackMixer());
|
||||
play.open(format);
|
||||
|
||||
play.start();
|
||||
|
||||
byte[] buffer = new byte[1024];
|
||||
|
||||
eq.skip(pos);
|
||||
|
||||
while (pos < crossEndOffset * frameSize) {
|
||||
int nr = eq.read(buffer);
|
||||
pos += nr;
|
||||
|
||||
play.write(buffer, 0, nr);
|
||||
};
|
||||
play.drain();
|
||||
play.close();
|
||||
} catch (Exception e) {
|
||||
e.printStackTrace();
|
||||
}
|
||||
}
|
||||
|
||||
public byte[] getRawAudioData() {
|
||||
File f = getFile();
|
||||
try {
|
||||
@@ -569,7 +544,7 @@ public class Sentence extends DefaultMutableTreeNode implements Cacheable {
|
||||
EqualizerInputStream eq = new EqualizerInputStream(s, 31);
|
||||
|
||||
|
||||
AudioFormat format = eq.getFormat();
|
||||
AudioFormat format = getAudioFormat();
|
||||
IIRControls controls = eq.getControls();
|
||||
AudiobookRecorder.window.book.equaliser.apply(controls, format.getChannels());
|
||||
|
||||
@@ -619,7 +594,7 @@ public class Sentence extends DefaultMutableTreeNode implements Cacheable {
|
||||
recognizer = new StreamSpeechRecognizer(sphinxConfig);
|
||||
|
||||
AudioInputStream s = AudioSystem.getAudioInputStream(getFile());
|
||||
AudioFormat format = s.getFormat();
|
||||
AudioFormat format = getAudioFormat();
|
||||
int frameSize = format.getFrameSize();
|
||||
int length = (int)s.getFrameLength();
|
||||
byte[] data = new byte[length * frameSize];
|
||||
@@ -727,4 +702,32 @@ public class Sentence extends DefaultMutableTreeNode implements Cacheable {
|
||||
}
|
||||
return pos;
|
||||
}
|
||||
|
||||
/* Get the length of the sample in seconds */
|
||||
public double getLength() {
|
||||
if (storedLength > -1d) return storedLength;
|
||||
AudioFormat format = getAudioFormat();
|
||||
float sampleFrequency = format.getFrameRate();
|
||||
int length = crossEndOffset - crossStartOffset;
|
||||
double time = (double)length / (double)sampleFrequency;
|
||||
storedLength = time;
|
||||
return time;
|
||||
}
|
||||
|
||||
public Sentence cloneSentence() throws IOException {
|
||||
Sentence sentence = new Sentence();
|
||||
sentence.setPostGap(getPostGap());
|
||||
if (!id.equals(text)) {
|
||||
sentence.setText(text);
|
||||
}
|
||||
sentence.setStartOffset(getStartOffset());
|
||||
sentence.setEndOffset(getEndOffset());
|
||||
|
||||
File from = getFile();
|
||||
File to = sentence.getFile();
|
||||
Files.copy(from.toPath(), to.toPath());
|
||||
|
||||
sentence.updateCrossings();
|
||||
return sentence;
|
||||
}
|
||||
}
|
||||
|
||||
@@ -16,6 +16,8 @@ public class Waveform extends JPanel implements MouseListener, MouseMotionListen
|
||||
int leftMarkerSaved = 0;
|
||||
int rightMarkerSaved = 0;
|
||||
|
||||
int playMarker = 0;
|
||||
|
||||
int leftAltMarker = 0;
|
||||
int rightAltMarker = 0;
|
||||
|
||||
@@ -126,6 +128,10 @@ public class Waveform extends JPanel implements MouseListener, MouseMotionListen
|
||||
g.drawLine((leftMarker - offset)/step, 0, (leftMarker - offset)/step, h);
|
||||
g.drawLine((rightMarker - offset)/step, 0, (rightMarker - offset)/step, h);
|
||||
|
||||
g.setColor(new Color(0, 255, 255));
|
||||
for (int i = 0; i < h; i += 2) {
|
||||
g.drawLine((playMarker - offset) / step, i, (playMarker - offset) / step, i);
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
@@ -168,6 +174,7 @@ public class Waveform extends JPanel implements MouseListener, MouseMotionListen
|
||||
|
||||
public void setData(int[] s) {
|
||||
samples = s;
|
||||
playMarker = 0;
|
||||
repaint();
|
||||
}
|
||||
|
||||
@@ -185,13 +192,13 @@ public class Waveform extends JPanel implements MouseListener, MouseMotionListen
|
||||
|
||||
public void mousePressed(MouseEvent e) {
|
||||
int x = e.getX();
|
||||
if ((x >= ((leftMarker - offset)/step) - 2) && (x <= ((leftMarker - offset)/step) + 2)) {
|
||||
if ((x >= ((leftMarker - offset)/step) - 10) && (x <= ((leftMarker - offset)/step) + 10)) {
|
||||
leftMarkerSaved = leftMarker;
|
||||
rightMarkerSaved = rightMarker;
|
||||
dragging = 1;
|
||||
return;
|
||||
}
|
||||
if ((x >= ((rightMarker - offset)/step) - 2) && (x <= ((rightMarker - offset)/step) + 2)) {
|
||||
if ((x >= ((rightMarker - offset)/step) - 10) && (x <= ((rightMarker - offset)/step) + 10)) {
|
||||
rightMarkerSaved = rightMarker;
|
||||
leftMarkerSaved = leftMarker;
|
||||
dragging = 2;
|
||||
@@ -219,11 +226,11 @@ public class Waveform extends JPanel implements MouseListener, MouseMotionListen
|
||||
|
||||
public void mouseMoved(MouseEvent e) {
|
||||
int x = e.getX();
|
||||
if ((x >= ((leftMarker - offset)/step) - 2) && (x <= ((leftMarker - offset)/step) + 2)) {
|
||||
if ((x >= ((leftMarker - offset)/step) - 10) && (x <= ((leftMarker - offset)/step) + 10)) {
|
||||
setCursor(Cursor.getPredefinedCursor(Cursor.W_RESIZE_CURSOR));
|
||||
return;
|
||||
}
|
||||
if ((x >= ((rightMarker - offset)/step) - 2) && (x <= ((rightMarker - offset)/step) + 2)) {
|
||||
if ((x >= ((rightMarker - offset)/step) - 10) && (x <= ((rightMarker - offset)/step) + 10)) {
|
||||
setCursor(Cursor.getPredefinedCursor(Cursor.E_RESIZE_CURSOR));
|
||||
return;
|
||||
}
|
||||
@@ -271,4 +278,8 @@ public class Waveform extends JPanel implements MouseListener, MouseMotionListen
|
||||
repaint();
|
||||
}
|
||||
|
||||
public void setPlayMarker(int m) {
|
||||
playMarker = leftAltMarker + m;
|
||||
repaint();
|
||||
}
|
||||
}
|
||||
|
||||
Reference in New Issue
Block a user