Compare commits
43 Commits
| Author | SHA1 | Date | |
|---|---|---|---|
| 28a8bd3c51 | |||
| 9adcd89cd5 | |||
| 14e6709c29 | |||
| 024626019d | |||
| c0d86d5753 | |||
| 175281537c | |||
|
|
abb26288c6 | ||
| f5c0d5bbfc | |||
| ff08db3e44 | |||
| 7431550d61 | |||
| 448910b8d7 | |||
| 991c4fbf8e | |||
| ced0aaa597 | |||
| 498247c793 | |||
| ad5c3808cd | |||
| c658dc6a50 | |||
|
|
100adec397 | ||
|
|
f4b793574d | ||
| d8c52575fb | |||
| 1b2945d9c4 | |||
| 1244bd60ed | |||
| b566b9e89e | |||
| 4a4d7f2a38 | |||
| f7848228a2 | |||
| 8c22315b15 | |||
| 718c982578 | |||
| be0f6a9f56 | |||
| 35874f5ca2 | |||
| a7fdfce094 | |||
| 5947c9a020 | |||
| 05408915b1 | |||
| 4635b5af0f | |||
| b362217d75 | |||
| cc48d49b5c | |||
| 391e54b993 | |||
| 49b6a92865 | |||
| fbe05367fa | |||
| eaf3080859 | |||
| 6ceec9ef85 | |||
| ac73711122 | |||
| 3cb0471027 | |||
| 38e7434730 | |||
| d8cd72809c |
1
.gitattributes
vendored
Normal file
@@ -0,0 +1 @@
|
||||
*.jar filter=lfs diff=lfs merge=lfs -text
|
||||
13
README.md
@@ -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.
|
||||
|
||||
@@ -71,3 +72,15 @@ files) is placed.
|
||||
|
||||
When you export the book as MP3 a new folder "export" is created within the book's folder where the MP3 files are placed.
|
||||
MP3 files are all tagged with the book title, chapter title, chapter number and comment.
|
||||
|
||||
|
||||
Building
|
||||
========
|
||||
|
||||
1. Check out this repo
|
||||
2. Install `ant` and `default-jdk`
|
||||
3. Install [git LFS support](https://help.github.com/articles/installing-git-large-file-storage/)
|
||||
4. Pull the large files with `git lfs pull`
|
||||
5. Build with `ant build`
|
||||
6. Run with `java -jar ./AudiobookRecorder.jar`
|
||||
|
||||
|
||||
BIN
deps/commons-codec-1.10.jar
LFS
vendored
Normal file
BIN
deps/commons-logging-1.2.jar
LFS
vendored
Normal file
BIN
deps/fluent-hc-4.5.6.jar
LFS
vendored
Normal file
BIN
deps/httpclient-4.5.6.jar
LFS
vendored
Normal file
BIN
deps/httpclient-cache-4.5.6.jar
LFS
vendored
Normal file
BIN
deps/httpclient-win-4.5.6.jar
LFS
vendored
Normal file
BIN
deps/httpcore-4.4.10.jar
LFS
vendored
Normal file
BIN
deps/httpmime-4.5.6.jar
LFS
vendored
Normal file
BIN
deps/jna-4.4.0.jar
LFS
vendored
Normal file
BIN
deps/jna-platform-4.4.0.jar
LFS
vendored
Normal file
BIN
deps/json-20180813.jar
LFS
vendored
Normal file
BIN
deps/mp3agic-0.9.1.jar
vendored
BIN
deps/sphinx4-core-5prealpha-SNAPSHOT.jar
vendored
BIN
deps/sphinx4-data-5prealpha-SNAPSHOT.jar
vendored
13
dist/linux/audiobookrecorder.desktop
vendored
Normal file
@@ -0,0 +1,13 @@
|
||||
[Desktop Entry]
|
||||
Name=AudiobookRecorder
|
||||
GenericName=Audiobook Recorder
|
||||
X-GNOME-FullName=AudiobookRecorder
|
||||
Comment=Record audiobooks with ease
|
||||
Keywords=audio
|
||||
Exec=AudiobookRecorder
|
||||
Terminal=false
|
||||
Type=Application
|
||||
StartupNotify=true
|
||||
Icon=AudiobookRecorder
|
||||
Categories=AudioVideo;Audio;Recorder;
|
||||
X-AppStream-Ignore=true
|
||||
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
@@ -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
@@ -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);
|
||||
}
|
||||
|
||||
558
licenses/apache-commons/LICENSE.txt
Normal file
@@ -0,0 +1,558 @@
|
||||
Apache License
|
||||
Version 2.0, January 2004
|
||||
http://www.apache.org/licenses/
|
||||
|
||||
TERMS AND CONDITIONS FOR USE, REPRODUCTION, AND DISTRIBUTION
|
||||
|
||||
1. Definitions.
|
||||
|
||||
"License" shall mean the terms and conditions for use, reproduction,
|
||||
and distribution as defined by Sections 1 through 9 of this document.
|
||||
|
||||
"Licensor" shall mean the copyright owner or entity authorized by
|
||||
the copyright owner that is granting the License.
|
||||
|
||||
"Legal Entity" shall mean the union of the acting entity and all
|
||||
other entities that control, are controlled by, or are under common
|
||||
control with that entity. For the purposes of this definition,
|
||||
"control" means (i) the power, direct or indirect, to cause the
|
||||
direction or management of such entity, whether by contract or
|
||||
otherwise, or (ii) ownership of fifty percent (50%) or more of the
|
||||
outstanding shares, or (iii) beneficial ownership of such entity.
|
||||
|
||||
"You" (or "Your") shall mean an individual or Legal Entity
|
||||
exercising permissions granted by this License.
|
||||
|
||||
"Source" form shall mean the preferred form for making modifications,
|
||||
including but not limited to software source code, documentation
|
||||
source, and configuration files.
|
||||
|
||||
"Object" form shall mean any form resulting from mechanical
|
||||
transformation or translation of a Source form, including but
|
||||
not limited to compiled object code, generated documentation,
|
||||
and conversions to other media types.
|
||||
|
||||
"Work" shall mean the work of authorship, whether in Source or
|
||||
Object form, made available under the License, as indicated by a
|
||||
copyright notice that is included in or attached to the work
|
||||
(an example is provided in the Appendix below).
|
||||
|
||||
"Derivative Works" shall mean any work, whether in Source or Object
|
||||
form, that is based on (or derived from) the Work and for which the
|
||||
editorial revisions, annotations, elaborations, or other modifications
|
||||
represent, as a whole, an original work of authorship. For the purposes
|
||||
of this License, Derivative Works shall not include works that remain
|
||||
separable from, or merely link (or bind by name) to the interfaces of,
|
||||
the Work and Derivative Works thereof.
|
||||
|
||||
"Contribution" shall mean any work of authorship, including
|
||||
the original version of the Work and any modifications or additions
|
||||
to that Work or Derivative Works thereof, that is intentionally
|
||||
submitted to Licensor for inclusion in the Work by the copyright owner
|
||||
or by an individual or Legal Entity authorized to submit on behalf of
|
||||
the copyright owner. For the purposes of this definition, "submitted"
|
||||
means any form of electronic, verbal, or written communication sent
|
||||
to the Licensor or its representatives, including but not limited to
|
||||
communication on electronic mailing lists, source code control systems,
|
||||
and issue tracking systems that are managed by, or on behalf of, the
|
||||
Licensor for the purpose of discussing and improving the Work, but
|
||||
excluding communication that is conspicuously marked or otherwise
|
||||
designated in writing by the copyright owner as "Not a Contribution."
|
||||
|
||||
"Contributor" shall mean Licensor and any individual or Legal Entity
|
||||
on behalf of whom a Contribution has been received by Licensor and
|
||||
subsequently incorporated within the Work.
|
||||
|
||||
2. Grant of Copyright License. Subject to the terms and conditions of
|
||||
this License, each Contributor hereby grants to You a perpetual,
|
||||
worldwide, non-exclusive, no-charge, royalty-free, irrevocable
|
||||
copyright license to reproduce, prepare Derivative Works of,
|
||||
publicly display, publicly perform, sublicense, and distribute the
|
||||
Work and such Derivative Works in Source or Object form.
|
||||
|
||||
3. Grant of Patent License. Subject to the terms and conditions of
|
||||
this License, each Contributor hereby grants to You a perpetual,
|
||||
worldwide, non-exclusive, no-charge, royalty-free, irrevocable
|
||||
(except as stated in this section) patent license to make, have made,
|
||||
use, offer to sell, sell, import, and otherwise transfer the Work,
|
||||
where such license applies only to those patent claims licensable
|
||||
by such Contributor that are necessarily infringed by their
|
||||
Contribution(s) alone or by combination of their Contribution(s)
|
||||
with the Work to which such Contribution(s) was submitted. If You
|
||||
institute patent litigation against any entity (including a
|
||||
cross-claim or counterclaim in a lawsuit) alleging that the Work
|
||||
or a Contribution incorporated within the Work constitutes direct
|
||||
or contributory patent infringement, then any patent licenses
|
||||
granted to You under this License for that Work shall terminate
|
||||
as of the date such litigation is filed.
|
||||
|
||||
4. Redistribution. You may reproduce and distribute copies of the
|
||||
Work or Derivative Works thereof in any medium, with or without
|
||||
modifications, and in Source or Object form, provided that You
|
||||
meet the following conditions:
|
||||
|
||||
(a) You must give any other recipients of the Work or
|
||||
Derivative Works a copy of this License; and
|
||||
|
||||
(b) You must cause any modified files to carry prominent notices
|
||||
stating that You changed the files; and
|
||||
|
||||
(c) You must retain, in the Source form of any Derivative Works
|
||||
that You distribute, all copyright, patent, trademark, and
|
||||
attribution notices from the Source form of the Work,
|
||||
excluding those notices that do not pertain to any part of
|
||||
the Derivative Works; and
|
||||
|
||||
(d) If the Work includes a "NOTICE" text file as part of its
|
||||
distribution, then any Derivative Works that You distribute must
|
||||
include a readable copy of the attribution notices contained
|
||||
within such NOTICE file, excluding those notices that do not
|
||||
pertain to any part of the Derivative Works, in at least one
|
||||
of the following places: within a NOTICE text file distributed
|
||||
as part of the Derivative Works; within the Source form or
|
||||
documentation, if provided along with the Derivative Works; or,
|
||||
within a display generated by the Derivative Works, if and
|
||||
wherever such third-party notices normally appear. The contents
|
||||
of the NOTICE file are for informational purposes only and
|
||||
do not modify the License. You may add Your own attribution
|
||||
notices within Derivative Works that You distribute, alongside
|
||||
or as an addendum to the NOTICE text from the Work, provided
|
||||
that such additional attribution notices cannot be construed
|
||||
as modifying the License.
|
||||
|
||||
You may add Your own copyright statement to Your modifications and
|
||||
may provide additional or different license terms and conditions
|
||||
for use, reproduction, or distribution of Your modifications, or
|
||||
for any such Derivative Works as a whole, provided Your use,
|
||||
reproduction, and distribution of the Work otherwise complies with
|
||||
the conditions stated in this License.
|
||||
|
||||
5. Submission of Contributions. Unless You explicitly state otherwise,
|
||||
any Contribution intentionally submitted for inclusion in the Work
|
||||
by You to the Licensor shall be under the terms and conditions of
|
||||
this License, without any additional terms or conditions.
|
||||
Notwithstanding the above, nothing herein shall supersede or modify
|
||||
the terms of any separate license agreement you may have executed
|
||||
with Licensor regarding such Contributions.
|
||||
|
||||
6. Trademarks. This License does not grant permission to use the trade
|
||||
names, trademarks, service marks, or product names of the Licensor,
|
||||
except as required for reasonable and customary use in describing the
|
||||
origin of the Work and reproducing the content of the NOTICE file.
|
||||
|
||||
7. Disclaimer of Warranty. Unless required by applicable law or
|
||||
agreed to in writing, Licensor provides the Work (and each
|
||||
Contributor provides its Contributions) on an "AS IS" BASIS,
|
||||
WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or
|
||||
implied, including, without limitation, any warranties or conditions
|
||||
of TITLE, NON-INFRINGEMENT, MERCHANTABILITY, or FITNESS FOR A
|
||||
PARTICULAR PURPOSE. You are solely responsible for determining the
|
||||
appropriateness of using or redistributing the Work and assume any
|
||||
risks associated with Your exercise of permissions under this License.
|
||||
|
||||
8. Limitation of Liability. In no event and under no legal theory,
|
||||
whether in tort (including negligence), contract, or otherwise,
|
||||
unless required by applicable law (such as deliberate and grossly
|
||||
negligent acts) or agreed to in writing, shall any Contributor be
|
||||
liable to You for damages, including any direct, indirect, special,
|
||||
incidental, or consequential damages of any character arising as a
|
||||
result of this License or out of the use or inability to use the
|
||||
Work (including but not limited to damages for loss of goodwill,
|
||||
work stoppage, computer failure or malfunction, or any and all
|
||||
other commercial damages or losses), even if such Contributor
|
||||
has been advised of the possibility of such damages.
|
||||
|
||||
9. Accepting Warranty or Additional Liability. While redistributing
|
||||
the Work or Derivative Works thereof, You may choose to offer,
|
||||
and charge a fee for, acceptance of support, warranty, indemnity,
|
||||
or other liability obligations and/or rights consistent with this
|
||||
License. However, in accepting such obligations, You may act only
|
||||
on Your own behalf and on Your sole responsibility, not on behalf
|
||||
of any other Contributor, and only if You agree to indemnify,
|
||||
defend, and hold each Contributor harmless for any liability
|
||||
incurred by, or claims asserted against, such Contributor by reason
|
||||
of your accepting any such warranty or additional liability.
|
||||
|
||||
END OF TERMS AND CONDITIONS
|
||||
|
||||
=========================================================================
|
||||
|
||||
This project includes Public Suffix List copied from
|
||||
<https://publicsuffix.org/list/effective_tld_names.dat>
|
||||
licensed under the terms of the Mozilla Public License, v. 2.0
|
||||
|
||||
Full license text: <http://mozilla.org/MPL/2.0/>
|
||||
|
||||
Mozilla Public License Version 2.0
|
||||
==================================
|
||||
|
||||
1. Definitions
|
||||
--------------
|
||||
|
||||
1.1. "Contributor"
|
||||
means each individual or legal entity that creates, contributes to
|
||||
the creation of, or owns Covered Software.
|
||||
|
||||
1.2. "Contributor Version"
|
||||
means the combination of the Contributions of others (if any) used
|
||||
by a Contributor and that particular Contributor's Contribution.
|
||||
|
||||
1.3. "Contribution"
|
||||
means Covered Software of a particular Contributor.
|
||||
|
||||
1.4. "Covered Software"
|
||||
means Source Code Form to which the initial Contributor has attached
|
||||
the notice in Exhibit A, the Executable Form of such Source Code
|
||||
Form, and Modifications of such Source Code Form, in each case
|
||||
including portions thereof.
|
||||
|
||||
1.5. "Incompatible With Secondary Licenses"
|
||||
means
|
||||
|
||||
(a) that the initial Contributor has attached the notice described
|
||||
in Exhibit B to the Covered Software; or
|
||||
|
||||
(b) that the Covered Software was made available under the terms of
|
||||
version 1.1 or earlier of the License, but not also under the
|
||||
terms of a Secondary License.
|
||||
|
||||
1.6. "Executable Form"
|
||||
means any form of the work other than Source Code Form.
|
||||
|
||||
1.7. "Larger Work"
|
||||
means a work that combines Covered Software with other material, in
|
||||
a separate file or files, that is not Covered Software.
|
||||
|
||||
1.8. "License"
|
||||
means this document.
|
||||
|
||||
1.9. "Licensable"
|
||||
means having the right to grant, to the maximum extent possible,
|
||||
whether at the time of the initial grant or subsequently, any and
|
||||
all of the rights conveyed by this License.
|
||||
|
||||
1.10. "Modifications"
|
||||
means any of the following:
|
||||
|
||||
(a) any file in Source Code Form that results from an addition to,
|
||||
deletion from, or modification of the contents of Covered
|
||||
Software; or
|
||||
|
||||
(b) any new file in Source Code Form that contains any Covered
|
||||
Software.
|
||||
|
||||
1.11. "Patent Claims" of a Contributor
|
||||
means any patent claim(s), including without limitation, method,
|
||||
process, and apparatus claims, in any patent Licensable by such
|
||||
Contributor that would be infringed, but for the grant of the
|
||||
License, by the making, using, selling, offering for sale, having
|
||||
made, import, or transfer of either its Contributions or its
|
||||
Contributor Version.
|
||||
|
||||
1.12. "Secondary License"
|
||||
means either the GNU General Public License, Version 2.0, the GNU
|
||||
Lesser General Public License, Version 2.1, the GNU Affero General
|
||||
Public License, Version 3.0, or any later versions of those
|
||||
licenses.
|
||||
|
||||
1.13. "Source Code Form"
|
||||
means the form of the work preferred for making modifications.
|
||||
|
||||
1.14. "You" (or "Your")
|
||||
means an individual or a legal entity exercising rights under this
|
||||
License. For legal entities, "You" includes any entity that
|
||||
controls, is controlled by, or is under common control with You. For
|
||||
purposes of this definition, "control" means (a) the power, direct
|
||||
or indirect, to cause the direction or management of such entity,
|
||||
whether by contract or otherwise, or (b) ownership of more than
|
||||
fifty percent (50%) of the outstanding shares or beneficial
|
||||
ownership of such entity.
|
||||
|
||||
2. License Grants and Conditions
|
||||
--------------------------------
|
||||
|
||||
2.1. Grants
|
||||
|
||||
Each Contributor hereby grants You a world-wide, royalty-free,
|
||||
non-exclusive license:
|
||||
|
||||
(a) under intellectual property rights (other than patent or trademark)
|
||||
Licensable by such Contributor to use, reproduce, make available,
|
||||
modify, display, perform, distribute, and otherwise exploit its
|
||||
Contributions, either on an unmodified basis, with Modifications, or
|
||||
as part of a Larger Work; and
|
||||
|
||||
(b) under Patent Claims of such Contributor to make, use, sell, offer
|
||||
for sale, have made, import, and otherwise transfer either its
|
||||
Contributions or its Contributor Version.
|
||||
|
||||
2.2. Effective Date
|
||||
|
||||
The licenses granted in Section 2.1 with respect to any Contribution
|
||||
become effective for each Contribution on the date the Contributor first
|
||||
distributes such Contribution.
|
||||
|
||||
2.3. Limitations on Grant Scope
|
||||
|
||||
The licenses granted in this Section 2 are the only rights granted under
|
||||
this License. No additional rights or licenses will be implied from the
|
||||
distribution or licensing of Covered Software under this License.
|
||||
Notwithstanding Section 2.1(b) above, no patent license is granted by a
|
||||
Contributor:
|
||||
|
||||
(a) for any code that a Contributor has removed from Covered Software;
|
||||
or
|
||||
|
||||
(b) for infringements caused by: (i) Your and any other third party's
|
||||
modifications of Covered Software, or (ii) the combination of its
|
||||
Contributions with other software (except as part of its Contributor
|
||||
Version); or
|
||||
|
||||
(c) under Patent Claims infringed by Covered Software in the absence of
|
||||
its Contributions.
|
||||
|
||||
This License does not grant any rights in the trademarks, service marks,
|
||||
or logos of any Contributor (except as may be necessary to comply with
|
||||
the notice requirements in Section 3.4).
|
||||
|
||||
2.4. Subsequent Licenses
|
||||
|
||||
No Contributor makes additional grants as a result of Your choice to
|
||||
distribute the Covered Software under a subsequent version of this
|
||||
License (see Section 10.2) or under the terms of a Secondary License (if
|
||||
permitted under the terms of Section 3.3).
|
||||
|
||||
2.5. Representation
|
||||
|
||||
Each Contributor represents that the Contributor believes its
|
||||
Contributions are its original creation(s) or it has sufficient rights
|
||||
to grant the rights to its Contributions conveyed by this License.
|
||||
|
||||
2.6. Fair Use
|
||||
|
||||
This License is not intended to limit any rights You have under
|
||||
applicable copyright doctrines of fair use, fair dealing, or other
|
||||
equivalents.
|
||||
|
||||
2.7. Conditions
|
||||
|
||||
Sections 3.1, 3.2, 3.3, and 3.4 are conditions of the licenses granted
|
||||
in Section 2.1.
|
||||
|
||||
3. Responsibilities
|
||||
-------------------
|
||||
|
||||
3.1. Distribution of Source Form
|
||||
|
||||
All distribution of Covered Software in Source Code Form, including any
|
||||
Modifications that You create or to which You contribute, must be under
|
||||
the terms of this License. You must inform recipients that the Source
|
||||
Code Form of the Covered Software is governed by the terms of this
|
||||
License, and how they can obtain a copy of this License. You may not
|
||||
attempt to alter or restrict the recipients' rights in the Source Code
|
||||
Form.
|
||||
|
||||
3.2. Distribution of Executable Form
|
||||
|
||||
If You distribute Covered Software in Executable Form then:
|
||||
|
||||
(a) such Covered Software must also be made available in Source Code
|
||||
Form, as described in Section 3.1, and You must inform recipients of
|
||||
the Executable Form how they can obtain a copy of such Source Code
|
||||
Form by reasonable means in a timely manner, at a charge no more
|
||||
than the cost of distribution to the recipient; and
|
||||
|
||||
(b) You may distribute such Executable Form under the terms of this
|
||||
License, or sublicense it under different terms, provided that the
|
||||
license for the Executable Form does not attempt to limit or alter
|
||||
the recipients' rights in the Source Code Form under this License.
|
||||
|
||||
3.3. Distribution of a Larger Work
|
||||
|
||||
You may create and distribute a Larger Work under terms of Your choice,
|
||||
provided that You also comply with the requirements of this License for
|
||||
the Covered Software. If the Larger Work is a combination of Covered
|
||||
Software with a work governed by one or more Secondary Licenses, and the
|
||||
Covered Software is not Incompatible With Secondary Licenses, this
|
||||
License permits You to additionally distribute such Covered Software
|
||||
under the terms of such Secondary License(s), so that the recipient of
|
||||
the Larger Work may, at their option, further distribute the Covered
|
||||
Software under the terms of either this License or such Secondary
|
||||
License(s).
|
||||
|
||||
3.4. Notices
|
||||
|
||||
You may not remove or alter the substance of any license notices
|
||||
(including copyright notices, patent notices, disclaimers of warranty,
|
||||
or limitations of liability) contained within the Source Code Form of
|
||||
the Covered Software, except that You may alter any license notices to
|
||||
the extent required to remedy known factual inaccuracies.
|
||||
|
||||
3.5. Application of Additional Terms
|
||||
|
||||
You may choose to offer, and to charge a fee for, warranty, support,
|
||||
indemnity or liability obligations to one or more recipients of Covered
|
||||
Software. However, You may do so only on Your own behalf, and not on
|
||||
behalf of any Contributor. You must make it absolutely clear that any
|
||||
such warranty, support, indemnity, or liability obligation is offered by
|
||||
You alone, and You hereby agree to indemnify every Contributor for any
|
||||
liability incurred by such Contributor as a result of warranty, support,
|
||||
indemnity or liability terms You offer. You may include additional
|
||||
disclaimers of warranty and limitations of liability specific to any
|
||||
jurisdiction.
|
||||
|
||||
4. Inability to Comply Due to Statute or Regulation
|
||||
---------------------------------------------------
|
||||
|
||||
If it is impossible for You to comply with any of the terms of this
|
||||
License with respect to some or all of the Covered Software due to
|
||||
statute, judicial order, or regulation then You must: (a) comply with
|
||||
the terms of this License to the maximum extent possible; and (b)
|
||||
describe the limitations and the code they affect. Such description must
|
||||
be placed in a text file included with all distributions of the Covered
|
||||
Software under this License. Except to the extent prohibited by statute
|
||||
or regulation, such description must be sufficiently detailed for a
|
||||
recipient of ordinary skill to be able to understand it.
|
||||
|
||||
5. Termination
|
||||
--------------
|
||||
|
||||
5.1. The rights granted under this License will terminate automatically
|
||||
if You fail to comply with any of its terms. However, if You become
|
||||
compliant, then the rights granted under this License from a particular
|
||||
Contributor are reinstated (a) provisionally, unless and until such
|
||||
Contributor explicitly and finally terminates Your grants, and (b) on an
|
||||
ongoing basis, if such Contributor fails to notify You of the
|
||||
non-compliance by some reasonable means prior to 60 days after You have
|
||||
come back into compliance. Moreover, Your grants from a particular
|
||||
Contributor are reinstated on an ongoing basis if such Contributor
|
||||
notifies You of the non-compliance by some reasonable means, this is the
|
||||
first time You have received notice of non-compliance with this License
|
||||
from such Contributor, and You become compliant prior to 30 days after
|
||||
Your receipt of the notice.
|
||||
|
||||
5.2. If You initiate litigation against any entity by asserting a patent
|
||||
infringement claim (excluding declaratory judgment actions,
|
||||
counter-claims, and cross-claims) alleging that a Contributor Version
|
||||
directly or indirectly infringes any patent, then the rights granted to
|
||||
You by any and all Contributors for the Covered Software under Section
|
||||
2.1 of this License shall terminate.
|
||||
|
||||
5.3. In the event of termination under Sections 5.1 or 5.2 above, all
|
||||
end user license agreements (excluding distributors and resellers) which
|
||||
have been validly granted by You or Your distributors under this License
|
||||
prior to termination shall survive termination.
|
||||
|
||||
************************************************************************
|
||||
* *
|
||||
* 6. Disclaimer of Warranty *
|
||||
* ------------------------- *
|
||||
* *
|
||||
* Covered Software is provided under this License on an "as is" *
|
||||
* basis, without warranty of any kind, either expressed, implied, or *
|
||||
* statutory, including, without limitation, warranties that the *
|
||||
* Covered Software is free of defects, merchantable, fit for a *
|
||||
* particular purpose or non-infringing. The entire risk as to the *
|
||||
* quality and performance of the Covered Software is with You. *
|
||||
* Should any Covered Software prove defective in any respect, You *
|
||||
* (not any Contributor) assume the cost of any necessary servicing, *
|
||||
* repair, or correction. This disclaimer of warranty constitutes an *
|
||||
* essential part of this License. No use of any Covered Software is *
|
||||
* authorized under this License except under this disclaimer. *
|
||||
* *
|
||||
************************************************************************
|
||||
|
||||
************************************************************************
|
||||
* *
|
||||
* 7. Limitation of Liability *
|
||||
* -------------------------- *
|
||||
* *
|
||||
* Under no circumstances and under no legal theory, whether tort *
|
||||
* (including negligence), contract, or otherwise, shall any *
|
||||
* Contributor, or anyone who distributes Covered Software as *
|
||||
* permitted above, be liable to You for any direct, indirect, *
|
||||
* special, incidental, or consequential damages of any character *
|
||||
* including, without limitation, damages for lost profits, loss of *
|
||||
* goodwill, work stoppage, computer failure or malfunction, or any *
|
||||
* and all other commercial damages or losses, even if such party *
|
||||
* shall have been informed of the possibility of such damages. This *
|
||||
* limitation of liability shall not apply to liability for death or *
|
||||
* personal injury resulting from such party's negligence to the *
|
||||
* extent applicable law prohibits such limitation. Some *
|
||||
* jurisdictions do not allow the exclusion or limitation of *
|
||||
* incidental or consequential damages, so this exclusion and *
|
||||
* limitation may not apply to You. *
|
||||
* *
|
||||
************************************************************************
|
||||
|
||||
8. Litigation
|
||||
-------------
|
||||
|
||||
Any litigation relating to this License may be brought only in the
|
||||
courts of a jurisdiction where the defendant maintains its principal
|
||||
place of business and such litigation shall be governed by laws of that
|
||||
jurisdiction, without reference to its conflict-of-law provisions.
|
||||
Nothing in this Section shall prevent a party's ability to bring
|
||||
cross-claims or counter-claims.
|
||||
|
||||
9. Miscellaneous
|
||||
----------------
|
||||
|
||||
This License represents the complete agreement concerning the subject
|
||||
matter hereof. If any provision of this License is held to be
|
||||
unenforceable, such provision shall be reformed only to the extent
|
||||
necessary to make it enforceable. Any law or regulation which provides
|
||||
that the language of a contract shall be construed against the drafter
|
||||
shall not be used to construe this License against a Contributor.
|
||||
|
||||
10. Versions of the License
|
||||
---------------------------
|
||||
|
||||
10.1. New Versions
|
||||
|
||||
Mozilla Foundation is the license steward. Except as provided in Section
|
||||
10.3, no one other than the license steward has the right to modify or
|
||||
publish new versions of this License. Each version will be given a
|
||||
distinguishing version number.
|
||||
|
||||
10.2. Effect of New Versions
|
||||
|
||||
You may distribute the Covered Software under the terms of the version
|
||||
of the License under which You originally received the Covered Software,
|
||||
or under the terms of any subsequent version published by the license
|
||||
steward.
|
||||
|
||||
10.3. Modified Versions
|
||||
|
||||
If you create software not governed by this License, and you want to
|
||||
create a new license for such software, you may create and use a
|
||||
modified version of this License if you rename the license and remove
|
||||
any references to the name of the license steward (except to note that
|
||||
such modified license differs from this License).
|
||||
|
||||
10.4. Distributing Source Code Form that is Incompatible With Secondary
|
||||
Licenses
|
||||
|
||||
If You choose to distribute Source Code Form that is Incompatible With
|
||||
Secondary Licenses under the terms of this version of the License, the
|
||||
notice described in Exhibit B of this License must be attached.
|
||||
|
||||
Exhibit A - Source Code Form License Notice
|
||||
-------------------------------------------
|
||||
|
||||
This Source Code Form is subject to the terms of the Mozilla Public
|
||||
License, v. 2.0. If a copy of the MPL was not distributed with this
|
||||
file, You can obtain one at http://mozilla.org/MPL/2.0/.
|
||||
|
||||
If it is not possible or desirable to put the notice in a particular
|
||||
file, then You may include the notice in a location (such as a LICENSE
|
||||
file in a relevant directory) where a recipient would be likely to look
|
||||
for such a notice.
|
||||
|
||||
You may add additional accurate notices of copyright ownership.
|
||||
|
||||
Exhibit B - "Incompatible With Secondary Licenses" Notice
|
||||
---------------------------------------------------------
|
||||
|
||||
This Source Code Form is "Incompatible With Secondary Licenses", as
|
||||
defined by the Mozilla Public License, v. 2.0.
|
||||
6
licenses/apache-commons/NOTICE.txt
Normal file
@@ -0,0 +1,6 @@
|
||||
Apache HttpComponents Client
|
||||
Copyright 1999-2018 The Apache Software Foundation
|
||||
|
||||
This product includes software developed at
|
||||
The Apache Software Foundation (http://www.apache.org/).
|
||||
|
||||
77
licenses/apache-commons/README.txt
Normal file
@@ -0,0 +1,77 @@
|
||||
Apache HttpComponents Client
|
||||
============================
|
||||
|
||||
Welcome to the HttpClient component of the Apache HttpComponents project.
|
||||
|
||||
Building Instructions
|
||||
---------------------
|
||||
|
||||
For building from source instructions please refer to BUILDING.txt.
|
||||
|
||||
Dependencies
|
||||
------------
|
||||
|
||||
HttpClient main module requires Java 6 compatible runtime and
|
||||
depends on the following external libraries:
|
||||
|
||||
* Apache HttpComponents HttpCore
|
||||
* Apache Commons Logging
|
||||
* Apache Commons Codec
|
||||
|
||||
(for detailed information on external dependencies please see pom.xml)
|
||||
|
||||
HttpMime module is optional and requires Java 6 compatible runtime
|
||||
and depends on the following external libraries:
|
||||
|
||||
* Apache HttpComponents HttpCore
|
||||
* Apache Commons Logging
|
||||
|
||||
(for detailed information on external dependencies please see pom.xml)
|
||||
|
||||
Licensing
|
||||
---------
|
||||
|
||||
Apache HttpComponents Client is licensed under the Apache License 2.0.
|
||||
See the files called LICENSE.txt and NOTICE.txt for more information.
|
||||
|
||||
Cryptographic Software Notice
|
||||
-----------------------------
|
||||
|
||||
This distribution may include software that has been designed for use
|
||||
with cryptographic software. The country in which you currently reside
|
||||
may have restrictions on the import, possession, use, and/or re-export
|
||||
to another country, of encryption software. BEFORE using any encryption
|
||||
software, please check your country's laws, regulations and policies
|
||||
concerning the import, possession, or use, and re-export of encryption
|
||||
software, to see if this is permitted. See <http://www.wassenaar.org/>
|
||||
for more information.
|
||||
|
||||
The U.S. Government Department of Commerce, Bureau of Industry and
|
||||
Security (BIS), has classified this software as Export Commodity
|
||||
Control Number (ECCN) 5D002.C.1, which includes information security
|
||||
software using or performing cryptographic functions with asymmetric
|
||||
algorithms. The form and manner of this Apache Software Foundation
|
||||
distribution makes it eligible for export under the License Exception
|
||||
ENC Technology Software Unrestricted (TSU) exception (see the BIS
|
||||
Export Administration Regulations, Section 740.13) for both object
|
||||
code and source code.
|
||||
|
||||
The following provides more details on the included software that
|
||||
may be subject to export controls on cryptographic software:
|
||||
|
||||
Apache HttpComponents Client interfaces with the
|
||||
Java Secure Socket Extension (JSSE) API to provide
|
||||
|
||||
- HTTPS support
|
||||
|
||||
Apache HttpComponents Client does not include any
|
||||
implementation of JSSE.
|
||||
|
||||
Contact
|
||||
-------
|
||||
|
||||
o For general information visit the main project site at
|
||||
http://hc.apache.org/
|
||||
|
||||
o For current status information visit the status page at
|
||||
http://hc.apache.org/status.html
|
||||
2354
licenses/apache-commons/RELEASE_NOTES.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.3
|
||||
|
||||
BIN
resources/uk/co/majenko/audiobookrecorder/icons/attention.png
Normal file
|
After Width: | Height: | Size: 952 B |
|
Before Width: | Height: | Size: 1.3 KiB After Width: | Height: | Size: 838 B |
|
Before Width: | Height: | Size: 277 B After Width: | Height: | Size: 263 B |
BIN
resources/uk/co/majenko/audiobookrecorder/icons/dollar.png
Normal file
|
After Width: | Height: | Size: 11 KiB |
|
Before Width: | Height: | Size: 592 B After Width: | Height: | Size: 1.2 KiB |
BIN
resources/uk/co/majenko/audiobookrecorder/icons/normalize.png
Normal file
|
After Width: | Height: | Size: 473 B |
|
Before Width: | Height: | Size: 799 B After Width: | Height: | Size: 710 B |
BIN
resources/uk/co/majenko/audiobookrecorder/overlays/attention.png
Normal file
|
After Width: | Height: | Size: 198 B |
BIN
resources/uk/co/majenko/audiobookrecorder/overlays/filter.png
Normal file
|
After Width: | Height: | Size: 198 B |
BIN
resources/uk/co/majenko/audiobookrecorder/overlays/important.png
Normal file
|
After Width: | Height: | Size: 262 B |
BIN
resources/uk/co/majenko/audiobookrecorder/overlays/locked.png
Normal file
|
After Width: | Height: | Size: 256 B |
BIN
resources/uk/co/majenko/audiobookrecorder/overlays/star.png
Normal file
|
After Width: | Height: | Size: 301 B |
@@ -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 @@ public class Book extends DefaultMutableTreeNode {
|
||||
String author;
|
||||
String genre;
|
||||
String comment;
|
||||
String ACX;
|
||||
|
||||
int sampleRate;
|
||||
int channels;
|
||||
@@ -24,39 +25,31 @@ public class Book extends DefaultMutableTreeNode {
|
||||
|
||||
ImageIcon icon;
|
||||
|
||||
public Equaliser equaliser;
|
||||
public Equaliser[] equaliser = new Equaliser[2];
|
||||
|
||||
float[] eqChannels = new float[31];
|
||||
|
||||
public Book(String bookname) {
|
||||
Properties prefs;
|
||||
|
||||
public Book(Properties p, String bookname) {
|
||||
super(bookname);
|
||||
|
||||
prefs = p;
|
||||
name = bookname;
|
||||
equaliser = new Equaliser();
|
||||
equaliser[0] = new Equaliser("Default");
|
||||
equaliser[1] = new Equaliser("Phone");
|
||||
AudiobookRecorder.window.setTitle("AudioBook Recorder :: " + name);
|
||||
}
|
||||
|
||||
public void setAuthor(String a) {
|
||||
author = a;
|
||||
}
|
||||
public void setAuthor(String a) { author = a; }
|
||||
public void setGenre(String g) { genre = g; }
|
||||
public void setComment(String c) { comment = c; }
|
||||
public void setACX(String c) { ACX = c; }
|
||||
|
||||
public void setGenre(String g) {
|
||||
genre = g;
|
||||
}
|
||||
|
||||
public void setComment(String c) {
|
||||
comment = c;
|
||||
}
|
||||
|
||||
public String getAuthor() {
|
||||
return author;
|
||||
}
|
||||
|
||||
public String getGenre() {
|
||||
return genre;
|
||||
}
|
||||
|
||||
public String getComment() {
|
||||
return comment;
|
||||
}
|
||||
public String getAuthor() { return author; }
|
||||
public String getGenre() { return genre; }
|
||||
public String getComment() { return comment; }
|
||||
public String getACX() { if (ACX == null) return ""; return ACX; }
|
||||
|
||||
public Chapter getClosingCredits() {
|
||||
return getChapterById("close");
|
||||
@@ -124,23 +117,28 @@ public class Book extends DefaultMutableTreeNode {
|
||||
public void setUserObject(Object o) {
|
||||
if (o instanceof String) {
|
||||
String newName = (String)o;
|
||||
if (newName.equals(name)) return;
|
||||
renameBook(newName);
|
||||
}
|
||||
}
|
||||
|
||||
File oldDir = new File(Options.get("path.storage"), name);
|
||||
File newDir = new File(Options.get("path.storage"), newName);
|
||||
public void renameBook(String newName) {
|
||||
File oldDir = new File(Options.get("path.storage"), name);
|
||||
File newDir = new File(Options.get("path.storage"), newName);
|
||||
|
||||
if (newDir.exists()) {
|
||||
JOptionPane.showMessageDialog(AudiobookRecorder.window, "Book already exists", "Error", JOptionPane.ERROR_MESSAGE);
|
||||
return;
|
||||
}
|
||||
if (newDir.exists()) {
|
||||
JOptionPane.showMessageDialog(AudiobookRecorder.window, "Book already exists", "Error", JOptionPane.ERROR_MESSAGE);
|
||||
return;
|
||||
}
|
||||
|
||||
if (oldDir.exists() && oldDir.isDirectory()) {
|
||||
oldDir.renameTo(newDir);
|
||||
name = newName;
|
||||
AudiobookRecorder.window.saveBookStructure();
|
||||
AudiobookRecorder.window.bookTreeModel.reload(this);
|
||||
Options.set("path.last-book", name);
|
||||
Options.savePreferences();
|
||||
}
|
||||
if (oldDir.exists() && oldDir.isDirectory()) {
|
||||
oldDir.renameTo(newDir);
|
||||
name = newName;
|
||||
AudiobookRecorder.window.saveBookStructure();
|
||||
AudiobookRecorder.window.bookTreeModel.reload(this);
|
||||
Options.set("path.last-book", name);
|
||||
Options.savePreferences();
|
||||
AudiobookRecorder.window.setTitle("AudioBook Recorder :: " + name);
|
||||
}
|
||||
}
|
||||
|
||||
@@ -171,4 +169,22 @@ public class Book extends DefaultMutableTreeNode {
|
||||
public AudioFormat getAudioFormat() {
|
||||
return new AudioFormat(getSampleRate(), getResolution(), getChannels(), true, false);
|
||||
}
|
||||
|
||||
public String get(String key) {
|
||||
if (prefs.getProperty(key) == null) { return Options.get(key); }
|
||||
return prefs.getProperty(key);
|
||||
}
|
||||
|
||||
public Integer getInteger(String key) {
|
||||
if (prefs.getProperty(key) == null) { return Options.getInteger(key); }
|
||||
return Utils.s2i(prefs.getProperty(key));
|
||||
}
|
||||
|
||||
public void set(String key, String value) {
|
||||
prefs.setProperty(key, value);
|
||||
}
|
||||
|
||||
public void set(String key, Integer value) {
|
||||
prefs.setProperty(key, "" + value);
|
||||
}
|
||||
}
|
||||
|
||||
@@ -4,6 +4,7 @@ import javax.swing.*;
|
||||
import javax.swing.event.*;
|
||||
import java.awt.*;
|
||||
import java.awt.event.*;
|
||||
import java.util.regex.*;
|
||||
|
||||
public class BookInfoPanel extends JPanel {
|
||||
|
||||
@@ -11,8 +12,9 @@ public class BookInfoPanel extends JPanel {
|
||||
JTextField author;
|
||||
JTextField genre;
|
||||
JTextField comment;
|
||||
JTextField acx;
|
||||
|
||||
public BookInfoPanel(String t, String a, String g, String c) {
|
||||
public BookInfoPanel(String t, String a, String g, String c, String x) {
|
||||
super();
|
||||
setLayout(new GridBagLayout());
|
||||
GridBagConstraints con = new GridBagConstraints();
|
||||
@@ -56,37 +58,36 @@ public class BookInfoPanel extends JPanel {
|
||||
con.gridx = 0;
|
||||
con.gridy++;
|
||||
|
||||
add(new JLabel("AXC Code:"), con);
|
||||
con.gridx = 1;
|
||||
acx = new JTextField(x);
|
||||
acx.setPreferredSize(new Dimension(200, 20));
|
||||
add(acx, con);
|
||||
|
||||
con.gridx = 0;
|
||||
con.gridy++;
|
||||
|
||||
}
|
||||
|
||||
public String getTitle() {
|
||||
return title.getText();
|
||||
public String getTitle() { return title.getText(); }
|
||||
public String getAuthor() { return author.getText(); }
|
||||
public String getGenre() { return genre.getText(); }
|
||||
public String getComment() { return comment.getText(); }
|
||||
|
||||
public String getACX() {
|
||||
Pattern p = Pattern.compile("\\/titleview\\/([A-Z0-9]{14})");
|
||||
Matcher m = p.matcher(acx.getText());
|
||||
if (m.find()) {
|
||||
System.err.println(m);
|
||||
return m.group(1);
|
||||
}
|
||||
return acx.getText();
|
||||
}
|
||||
|
||||
public String getAuthor() {
|
||||
return author.getText();
|
||||
}
|
||||
public void setTitle(String t) { title.setText(t); }
|
||||
public void setAuthor(String a) { author.setText(a); }
|
||||
public void setGenre(String g) { genre.setText(g); }
|
||||
public void setComment(String c) { comment.setText(c); }
|
||||
public void setACX(String a) { acx.setText(a); }
|
||||
|
||||
public String getGenre() {
|
||||
return genre.getText();
|
||||
}
|
||||
|
||||
public String getComment() {
|
||||
return comment.getText();
|
||||
}
|
||||
|
||||
public void setTitle(String t) {
|
||||
title.setText(t);
|
||||
}
|
||||
|
||||
public void setAuthor(String a) {
|
||||
author.setText(a);
|
||||
}
|
||||
|
||||
public void setGenre(String g) {
|
||||
genre.setText(g);
|
||||
}
|
||||
|
||||
public void setComment(String c) {
|
||||
comment.setText(c);
|
||||
}
|
||||
}
|
||||
|
||||
@@ -28,24 +28,48 @@ public class BookPanel extends JPanel {
|
||||
|
||||
boolean highlight = false;
|
||||
|
||||
public BookPanel(Properties p, ImageIcon i) {
|
||||
loadBookData(p, i);
|
||||
}
|
||||
|
||||
public BookPanel(File r) {
|
||||
try {
|
||||
root = r;
|
||||
Properties props = new Properties();
|
||||
props.loadFromXML(new FileInputStream(new File(root, "audiobook.abk")));
|
||||
loadBookData(props, null);
|
||||
} catch (Exception e) {
|
||||
e.printStackTrace();
|
||||
}
|
||||
}
|
||||
|
||||
public void loadBookData(Properties props, ImageIcon i) {
|
||||
try {
|
||||
name = props.getProperty("book.name");
|
||||
author = props.getProperty("book.author");
|
||||
genre = props.getProperty("book.genre");
|
||||
comment = props.getProperty("book.comment");
|
||||
File icon = new File(root, "coverart.png");
|
||||
if (icon.exists()) {
|
||||
cover = new ImageIcon(icon.getAbsolutePath());
|
||||
if (i == null) {
|
||||
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);
|
||||
iconLabel = new JLabel(new ImageIcon(resizedCover));
|
||||
} else {
|
||||
cover = null;
|
||||
resizedCover = null;
|
||||
iconLabel = new JLabel("");
|
||||
}
|
||||
} else {
|
||||
cover = i;
|
||||
resizedCover = Utils.getScaledImage(cover.getImage(), 75, 75);
|
||||
iconLabel = new JLabel(new ImageIcon(resizedCover));
|
||||
} else {
|
||||
cover = null;
|
||||
resizedCover = null;
|
||||
iconLabel = new JLabel("");
|
||||
}
|
||||
|
||||
iconLabel.setSize(new Dimension(75, 75));
|
||||
|
||||
@@ -11,18 +11,32 @@ public class BookTreeRenderer extends DefaultTreeCellRenderer {
|
||||
if (value instanceof Sentence) {
|
||||
Sentence s = (Sentence)value;
|
||||
|
||||
if (s.isLocked()) {
|
||||
ret.setForeground(new Color(0x20, 0x00, 0x00));
|
||||
ret.setIcon(Icons.locked);
|
||||
} else if (s.getStartOffset() == 0) {
|
||||
ret.setIcon(Icons.important);
|
||||
} else {
|
||||
ret.setIcon(Icons.sentence);
|
||||
OverlayIcon icn = new OverlayIcon(Icons.sentence);
|
||||
|
||||
if (s.getOverrideText() != null) {
|
||||
ret.setText(s.getOverrideText());
|
||||
}
|
||||
|
||||
if (s.isInSample()) {
|
||||
ret.setIcon(Icons.star);
|
||||
if (s.getAttentionFlag()) {
|
||||
ret.setForeground(new Color(0xFF, 0xFF, 0x00));
|
||||
icn.add(Overlays.attention, OverlayIcon.TOP_LEFT);
|
||||
}
|
||||
|
||||
if (s.isLocked()) {
|
||||
ret.setForeground(new Color(0x00, 0x80, 0xFF));
|
||||
icn.add(Overlays.locked, OverlayIcon.BOTTOM_LEFT);
|
||||
}
|
||||
|
||||
if (s.getStartOffset() == 0) {
|
||||
icn.add(Overlays.important, OverlayIcon.TOP_RIGHT);
|
||||
}
|
||||
|
||||
if (s.getEthereal()) {
|
||||
icn.add(Overlays.filter, OverlayIcon.BOTTOM_RIGHT);
|
||||
}
|
||||
|
||||
ret.setIcon(icn);
|
||||
|
||||
} 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 {
|
||||
|
||||
@@ -135,7 +135,7 @@ public class Chapter extends DefaultMutableTreeNode {
|
||||
File exportFile = new File(export, name + ".wax");
|
||||
File wavFile = new File(export, name + ".wav");
|
||||
File mp3File = new File(export, name + "-untagged.mp3");
|
||||
File taggedFile = new File(export, name + ".mp3");
|
||||
File taggedFile = new File(export, book.getName() + " - " + name + ".mp3");
|
||||
|
||||
FileOutputStream fos = new FileOutputStream(exportFile);
|
||||
data = AudiobookRecorder.window.getRoomNoise(Utils.s2i(Options.get("catenation.pre-chapter")));
|
||||
@@ -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;
|
||||
}
|
||||
|
||||
}
|
||||
|
||||
51
src/uk/co/majenko/audiobookrecorder/DonationPanel.java
Normal file
@@ -0,0 +1,51 @@
|
||||
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) {
|
||||
Utils.browse("https://paypal.me/majenko");
|
||||
}
|
||||
});
|
||||
|
||||
add(donate, BorderLayout.SOUTH);
|
||||
|
||||
|
||||
}
|
||||
}
|
||||
@@ -14,6 +14,7 @@ import davaguine.jeq.core.IIRControls;
|
||||
public class Equaliser extends JPanel {
|
||||
|
||||
EqualiserChannel channels[];
|
||||
String name;
|
||||
|
||||
static final double[] frequencies = {
|
||||
20d, 25d, 31.5d, 40d, 50d, 63d, 80d, 100d, 125d, 160d, 200d,
|
||||
@@ -22,9 +23,11 @@ public class Equaliser extends JPanel {
|
||||
20000d
|
||||
};
|
||||
|
||||
public Equaliser() {
|
||||
public Equaliser(String n) {
|
||||
super();
|
||||
|
||||
name = n;
|
||||
|
||||
channels = new EqualiserChannel[31];
|
||||
|
||||
setLayout(new BorderLayout());
|
||||
@@ -96,4 +99,8 @@ public class Equaliser extends JPanel {
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
public String getName() {
|
||||
return name;
|
||||
}
|
||||
}
|
||||
|
||||
83
src/uk/co/majenko/audiobookrecorder/HavenQueue.java
Normal file
@@ -0,0 +1,83 @@
|
||||
package uk.co.majenko.audiobookrecorder;
|
||||
|
||||
import java.util.*;
|
||||
import java.util.concurrent.*;
|
||||
import javax.swing.*;
|
||||
import java.awt.*;
|
||||
import java.util.Timer;
|
||||
|
||||
public class HavenQueue extends JPanel {
|
||||
ConcurrentLinkedQueue<Sentence> sentenceList = new ConcurrentLinkedQueue<Sentence>();
|
||||
|
||||
Timer timer = new Timer();
|
||||
|
||||
Sentence currentSentence = null;
|
||||
|
||||
JLabel count;
|
||||
|
||||
public HavenQueue() {
|
||||
timer.schedule(new TimerTask() { public void run() { processQueue(); }}, 30000);
|
||||
count = new JLabel("Haven queue: 0");
|
||||
setLayout(new BorderLayout());
|
||||
add(count, BorderLayout.CENTER);
|
||||
|
||||
count.setOpaque(false);
|
||||
setOpaque(false);
|
||||
count.setForeground(Color.WHITE);
|
||||
}
|
||||
|
||||
public void processQueue() {
|
||||
|
||||
count.setText("Haven queue: " + sentenceList.size());
|
||||
|
||||
if (currentSentence == null) {
|
||||
// Grab a new sentence to process.
|
||||
currentSentence = sentenceList.poll();
|
||||
|
||||
if (currentSentence != null) {
|
||||
if (!currentSentence.postHavenData()) { // Failed. Add to the end of the queue and wait a bit
|
||||
submit(currentSentence);
|
||||
currentSentence = null;
|
||||
timer.schedule(new TimerTask() { public void run() { processQueue(); }}, 30000);
|
||||
return;
|
||||
}
|
||||
timer.schedule(new TimerTask() { public void run() { processQueue(); }}, 5000);
|
||||
return;
|
||||
}
|
||||
|
||||
timer.schedule(new TimerTask() { public void run() { processQueue(); }}, 5000);
|
||||
return;
|
||||
}
|
||||
|
||||
if (currentSentence != null) {
|
||||
currentSentence.processPendingHaven();
|
||||
int status = currentSentence.getHavenStatus();
|
||||
switch (status) {
|
||||
case 0: // Um... not running...?
|
||||
currentSentence = null;
|
||||
timer.schedule(new TimerTask() { public void run() { processQueue(); }}, 30000);
|
||||
return;
|
||||
case 1: // Still processing...
|
||||
timer.schedule(new TimerTask() { public void run() { processQueue(); }}, 5000);
|
||||
return;
|
||||
case 2: // Finished
|
||||
currentSentence = null;
|
||||
timer.schedule(new TimerTask() { public void run() { processQueue(); }}, 30000);
|
||||
return;
|
||||
case 3: // Failed
|
||||
currentSentence = null;
|
||||
timer.schedule(new TimerTask() { public void run() { processQueue(); }}, 30000);
|
||||
return;
|
||||
}
|
||||
}
|
||||
|
||||
timer.schedule(new TimerTask() { public void run() { processQueue(); }}, 30000);
|
||||
}
|
||||
|
||||
public void submit(Sentence s) {
|
||||
s.setOverrideText("[queued...]");
|
||||
AudiobookRecorder.window.bookTreeModel.reload(s);
|
||||
sentenceList.add(s);
|
||||
count.setText("Haven queue: " + sentenceList.size());
|
||||
}
|
||||
}
|
||||
@@ -30,4 +30,7 @@ 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"));
|
||||
static public final ImageIcon attention = new ImageIcon(Icons.class.getResource("icons/attention.png"));
|
||||
static public final ImageIcon normalize = new ImageIcon(Icons.class.getResource("icons/normalize.png"));
|
||||
}
|
||||
|
||||
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);
|
||||
}
|
||||
}
|
||||
31
src/uk/co/majenko/audiobookrecorder/KVPair.java
Normal file
@@ -0,0 +1,31 @@
|
||||
package uk.co.majenko.audiobookrecorder;
|
||||
|
||||
public class KVPair<K,V> implements Comparable {
|
||||
public K key;
|
||||
public V value;
|
||||
|
||||
public KVPair(K k, V v) {
|
||||
key = k;
|
||||
value = v;
|
||||
}
|
||||
|
||||
public String toString() {
|
||||
return (String)value;
|
||||
}
|
||||
|
||||
public int compareTo(Object o) {
|
||||
// if (o instanceof KVPair) {
|
||||
// KVPair ko = (KVPair)o;
|
||||
// return key.compareTo(ko.key);
|
||||
// }
|
||||
return 0;
|
||||
}
|
||||
|
||||
public K getKey() {
|
||||
return key;
|
||||
}
|
||||
|
||||
public V getValue() {
|
||||
return value;
|
||||
}
|
||||
}
|
||||
@@ -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);
|
||||
}
|
||||
}
|
||||
}
|
||||
});
|
||||
@@ -135,31 +124,4 @@ public class MainToolBar extends JToolBar {
|
||||
setFloatable(false);
|
||||
}
|
||||
|
||||
public void enableBook() {
|
||||
newChapter.setEnabled(true);
|
||||
recordRoomNoise.setEnabled(true);
|
||||
}
|
||||
|
||||
public void disableBook() {
|
||||
newChapter.setEnabled(false);
|
||||
recordRoomNoise.setEnabled(false);
|
||||
}
|
||||
|
||||
public void enableSentence() {
|
||||
playSentence.setEnabled(true);
|
||||
playonSentence.setEnabled(true);
|
||||
}
|
||||
|
||||
public void disableSentence() {
|
||||
playSentence.setEnabled(false);
|
||||
playonSentence.setEnabled(false);
|
||||
}
|
||||
|
||||
public void enableStop() {
|
||||
stopPlaying.setEnabled(true);
|
||||
}
|
||||
|
||||
public void disableStop() {
|
||||
stopPlaying.setEnabled(false);
|
||||
}
|
||||
}
|
||||
|
||||
@@ -20,10 +20,13 @@ public class Options extends JDialog {
|
||||
JComboBox<KVPair> channelList;
|
||||
JComboBox<KVPair> rateList;
|
||||
JComboBox<KVPair> bitDepth;
|
||||
JComboBox<KVPair> trimMethod;
|
||||
JTextField storageFolder;
|
||||
JTextField archiveFolder;
|
||||
JSpinner preChapterGap;
|
||||
JSpinner postChapterGap;
|
||||
JSpinner postSentenceGap;
|
||||
JSpinner shortSentenceGap;
|
||||
JSpinner postParagraphGap;
|
||||
JTextField ffmpegLocation;
|
||||
JComboBox<KVPair> bitRate;
|
||||
@@ -31,6 +34,12 @@ public class Options extends JDialog {
|
||||
JCheckBox enableParsing;
|
||||
JSpinner cacheSize;
|
||||
|
||||
JSpinner etherealIterations;
|
||||
JSpinner etherealAttenuation;
|
||||
JSpinner etherealOffset;
|
||||
|
||||
JTextField havenApiKey;
|
||||
|
||||
Equaliser equaliser;
|
||||
|
||||
JTextArea startupScript;
|
||||
@@ -38,28 +47,6 @@ public class Options extends JDialog {
|
||||
static HashMap<String, String> defaultPrefs;
|
||||
static Preferences prefs = null;
|
||||
|
||||
static class KVPair implements Comparable {
|
||||
public String key;
|
||||
public String value;
|
||||
|
||||
public KVPair(String k, String v) {
|
||||
key = k;
|
||||
value = v;
|
||||
}
|
||||
|
||||
public String toString() {
|
||||
return value;
|
||||
}
|
||||
|
||||
public int compareTo(Object o) {
|
||||
if (o instanceof KVPair) {
|
||||
KVPair ko = (KVPair)o;
|
||||
return key.compareTo(ko.key);
|
||||
}
|
||||
return 0;
|
||||
}
|
||||
}
|
||||
|
||||
class JButtonObject extends JButton {
|
||||
Object object;
|
||||
public JButtonObject(String s, Object o) {
|
||||
@@ -95,6 +82,27 @@ public class Options extends JDialog {
|
||||
return o;
|
||||
}
|
||||
|
||||
JTextField addTextField(JPanel panel, String label, String def) {
|
||||
JLabel l = new JLabel(label);
|
||||
constraint.gridx = 0;
|
||||
constraint.gridwidth = 1;
|
||||
constraint.gridheight = 1;
|
||||
constraint.anchor = GridBagConstraints.LINE_START;
|
||||
panel.add(l, constraint);
|
||||
|
||||
JTextField a = new JTextField(def);
|
||||
constraint.gridx = 1;
|
||||
|
||||
constraint.fill = GridBagConstraints.HORIZONTAL;
|
||||
panel.add(a, constraint);
|
||||
|
||||
constraint.fill = GridBagConstraints.NONE;
|
||||
|
||||
constraint.gridy++;
|
||||
return a;
|
||||
}
|
||||
|
||||
|
||||
JTextField addFilePath(JPanel panel, String label, String path, boolean dironly) {
|
||||
JLabel l = new JLabel(label);
|
||||
constraint.gridx = 0;
|
||||
@@ -247,18 +255,21 @@ 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);
|
||||
|
||||
playbackList = addDropdown(optionsPanel, "Playback device:", getPlaybackMixerList(), get("audio.playback.device"));
|
||||
addSeparator(optionsPanel);
|
||||
storageFolder = addFilePath(optionsPanel, "Storage folder:", get("path.storage"), true);
|
||||
archiveFolder = addFilePath(optionsPanel, "Archive folder:", get("path.archive"), true);
|
||||
|
||||
addSeparator(optionsPanel);
|
||||
|
||||
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);
|
||||
@@ -270,34 +281,47 @@ public class Options extends JDialog {
|
||||
|
||||
addSeparator(optionsPanel);
|
||||
|
||||
enableParsing = addCheckBox(optionsPanel, "Enable automatic sphinx speech-to-text (**SLOW**)", getBoolean("process.sphinx"));
|
||||
enableParsing = addCheckBox(optionsPanel, "Enable automatic speech-to-text submission", getBoolean("process.haven.auto"));
|
||||
havenApiKey = addTextField(optionsPanel, "Haven OnDemand API Key", get("process.haven.apikey"));
|
||||
|
||||
addSeparator(optionsPanel);
|
||||
|
||||
cacheSize = addSpinner(optionsPanel, "Cache size:", 0, 5000, 1, getInteger("cache.size"), "");
|
||||
|
||||
addSeparator(optionsPanel);
|
||||
|
||||
tabs.add("Options", optionsPanel);
|
||||
|
||||
equaliser = new Equaliser();
|
||||
|
||||
tabs.add("Options", new JScrollPane(optionsPanel));
|
||||
equaliser = new Equaliser("Default");
|
||||
for (int i = 0; i < 31; i++) {
|
||||
equaliser.setChannel(i, Options.getFloat("audio.eq." + i));
|
||||
}
|
||||
|
||||
tabs.add("Default EQ", equaliser);
|
||||
tabs.add("Default EQ", new JScrollPane(equaliser));
|
||||
|
||||
JPanel startScript = new JPanel();
|
||||
startScript.setLayout(new BorderLayout());
|
||||
startupScript = new JTextArea(get("scripts.startup"));
|
||||
startScript.add(startupScript, BorderLayout.CENTER);
|
||||
|
||||
tabs.add("Startup Script", startScript);
|
||||
|
||||
add(tabs, BorderLayout.CENTER);
|
||||
|
||||
|
||||
|
||||
JPanel effects = new JPanel();
|
||||
effects.setLayout(new GridBagLayout());
|
||||
constraint.gridx = 0;
|
||||
constraint.gridy = 0;
|
||||
constraint.gridwidth = 1;
|
||||
constraint.gridheight = 1;
|
||||
|
||||
etherealOffset = addSpinner(effects, "Ethereal Voice Offset", 0, 2000, 10, getInteger("effects.ethereal.offset"), "ms");
|
||||
etherealIterations = addSpinner(effects, "Ethereal Voice Iterations", 1, 10, 1, getInteger("effects.ethereal.iterations"), "");
|
||||
etherealAttenuation = addSpinner(effects, "Ethereal Voice Attenuation", 0, 100, 1, getInteger("effects.ethereal.attenuation"), "%");
|
||||
|
||||
tabs.add("Effects", effects);
|
||||
|
||||
|
||||
|
||||
|
||||
|
||||
add(tabs, BorderLayout.CENTER);
|
||||
|
||||
setTitle("Options");
|
||||
|
||||
@@ -341,8 +365,8 @@ public class Options extends JDialog {
|
||||
setVisible(true);
|
||||
}
|
||||
|
||||
static KVPair[] getRecordingMixerList() {
|
||||
TreeSet<KVPair> list = new TreeSet<KVPair>();
|
||||
static KVPair<String, String>[] getRecordingMixerList() {
|
||||
TreeSet<KVPair<String, String>> list = new TreeSet<KVPair<String, String>>();
|
||||
|
||||
AudioFormat stereoFormat = new AudioFormat(44100f, 16, 2, true, false);
|
||||
AudioFormat monoFormat = new AudioFormat(44100f, 16, 1, true, false);
|
||||
@@ -369,7 +393,7 @@ public class Options extends JDialog {
|
||||
}
|
||||
|
||||
if (supported) {
|
||||
KVPair p = new KVPair(i.getName(), i.getName()); //i.getDescription());
|
||||
KVPair<String, String> p = new KVPair<String, String>(i.getName(), i.getName()); //i.getDescription());
|
||||
list.add(p);
|
||||
}
|
||||
}
|
||||
@@ -378,7 +402,7 @@ public class Options extends JDialog {
|
||||
}
|
||||
|
||||
static KVPair[] getPlaybackMixerList() {
|
||||
TreeSet<KVPair> list = new TreeSet<KVPair>();
|
||||
TreeSet<KVPair<String, String>> list = new TreeSet<KVPair<String, String>>();
|
||||
|
||||
AudioFormat stereoFormat = new AudioFormat(44100f, 16, 2, true, false);
|
||||
AudioFormat monoFormat = new AudioFormat(44100f, 16, 1, true, false);
|
||||
@@ -406,7 +430,7 @@ public class Options extends JDialog {
|
||||
|
||||
|
||||
if (supported) {
|
||||
KVPair p = new KVPair(i.getName(), i.getName()); //i.getDescription());
|
||||
KVPair<String, String> p = new KVPair<String, String>(i.getName(), i.getName()); //i.getDescription());
|
||||
list.add(p);
|
||||
}
|
||||
}
|
||||
@@ -416,16 +440,16 @@ public class Options extends JDialog {
|
||||
|
||||
static KVPair[] getChannelCountList() {
|
||||
KVPair[] l = new KVPair[2];
|
||||
l[0] = new KVPair("1", "Mono");
|
||||
l[1] = new KVPair("2", "Stereo");
|
||||
l[0] = new KVPair<String, String>("1", "Mono");
|
||||
l[1] = new KVPair<String, String>("2", "Stereo");
|
||||
return l;
|
||||
}
|
||||
|
||||
static KVPair[] getSampleRateList() {
|
||||
KVPair[] l = new KVPair[3];
|
||||
l[0] = new KVPair("44100", "44100");
|
||||
l[1] = new KVPair("48000", "48000");
|
||||
l[2] = new KVPair("96000", "96000");
|
||||
l[0] = new KVPair<String, String>("44100", "44100");
|
||||
l[1] = new KVPair<String, String>("48000", "48000");
|
||||
l[2] = new KVPair<String, String>("96000", "96000");
|
||||
return l;
|
||||
}
|
||||
|
||||
@@ -437,15 +461,16 @@ public class Options extends JDialog {
|
||||
KVPair[] playbackMixers = getPlaybackMixerList();
|
||||
|
||||
if (recordingMixers.length > 0) {
|
||||
defaultPrefs.put("audio.recording.device", recordingMixers[0].key);
|
||||
defaultPrefs.put("audio.recording.device", (String)recordingMixers[0].key);
|
||||
} else {
|
||||
defaultPrefs.put("audio.recording.device", "");
|
||||
}
|
||||
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);
|
||||
defaultPrefs.put("audio.playback.device", (String)playbackMixers[0].key);
|
||||
} else {
|
||||
defaultPrefs.put("audio.playback.device", "");
|
||||
}
|
||||
@@ -453,15 +478,18 @@ 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());
|
||||
defaultPrefs.put("path.archive", (new File(new File(System.getProperty("user.home"), "Recordings"),"archive")).toString());
|
||||
defaultPrefs.put("path.ffmpeg", "");
|
||||
|
||||
defaultPrefs.put("audio.export.bitrate", "256000");
|
||||
defaultPrefs.put("audio.export.samplerate", "44100");
|
||||
|
||||
defaultPrefs.put("process.sphinx", "false");
|
||||
defaultPrefs.put("process.haven.apikey", "");
|
||||
|
||||
defaultPrefs.put("cache.size", "100");
|
||||
|
||||
@@ -499,6 +527,10 @@ public class Options extends JDialog {
|
||||
|
||||
defaultPrefs.put("scripts.startup", "");
|
||||
|
||||
defaultPrefs.put("effects.ethereal.offset", "50");
|
||||
defaultPrefs.put("effects.ethereal.iterations", "3");
|
||||
defaultPrefs.put("effects.ethereal.attenuation", "50");
|
||||
|
||||
if (prefs == null) {
|
||||
prefs = Preferences.userNodeForPackage(AudiobookRecorder.class);
|
||||
}
|
||||
@@ -589,18 +621,26 @@ 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.archive", archiveFolder.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);
|
||||
set("process.sphinx", enableParsing.isSelected());
|
||||
set("process.haven.apikey", havenApiKey.getText());
|
||||
set("cache.size", cacheSize.getValue());
|
||||
|
||||
set("effects.ethereal.offset", etherealOffset.getValue());
|
||||
set("effects.ethereal.iterations", etherealIterations.getValue());
|
||||
set("effects.ethereal.attenuation", etherealAttenuation.getValue());
|
||||
|
||||
for (int i = 0; i < 31; i++) {
|
||||
set("audio.eq." + i, equaliser.getChannel(i));
|
||||
}
|
||||
@@ -640,16 +680,23 @@ public class Options extends JDialog {
|
||||
|
||||
public static KVPair[] getBitrates() {
|
||||
KVPair[] pairs = new KVPair[4];
|
||||
pairs[0] = new KVPair("128000", "128kbps");
|
||||
pairs[1] = new KVPair("192000", "192kbps");
|
||||
pairs[2] = new KVPair("256000", "256kbps");
|
||||
pairs[3] = new KVPair("320000", "320kbps");
|
||||
pairs[0] = new KVPair<String, String>("128000", "128kbps");
|
||||
pairs[1] = new KVPair<String, String>("192000", "192kbps");
|
||||
pairs[2] = new KVPair<String, String>("256000", "256kbps");
|
||||
pairs[3] = new KVPair<String, String>("320000", "320kbps");
|
||||
return pairs;
|
||||
}
|
||||
|
||||
public static KVPair[] getResolutionList() {
|
||||
KVPair[] pairs = new KVPair[1];
|
||||
pairs[0] = new KVPair("16", "16 Bit");
|
||||
pairs[0] = new KVPair<String, String>("16", "16 Bit");
|
||||
return pairs;
|
||||
}
|
||||
|
||||
public static KVPair[] getTrimMethods() {
|
||||
KVPair[] pairs = new KVPair[2];
|
||||
pairs[0] = new KVPair<String, String>("peak", "Peak Amplitude");
|
||||
pairs[1] = new KVPair<String, String>("fft", "FFT Analysis");
|
||||
return pairs;
|
||||
}
|
||||
}
|
||||
|
||||
131
src/uk/co/majenko/audiobookrecorder/OverlayIcon.java
Normal file
@@ -0,0 +1,131 @@
|
||||
/*
|
||||
* Copyright (c) 2015, Majenko Technologies
|
||||
* All rights reserved.
|
||||
*
|
||||
* Redistribution and use in source and binary forms, with or without modification,
|
||||
* are permitted provided that the following conditions are met:
|
||||
*
|
||||
* * Redistributions of source code must retain the above copyright notice, this
|
||||
* list of conditions and the following disclaimer.
|
||||
*
|
||||
* * Redistributions in binary form must reproduce the above copyright notice, this
|
||||
* list of conditions and the following disclaimer in the documentation and/or
|
||||
* other materials provided with the distribution.
|
||||
*
|
||||
* * Neither the name of Majenko Technologies nor the names of its
|
||||
* contributors may be used to endorse or promote products derived from
|
||||
* this software without specific prior written permission.
|
||||
*
|
||||
* THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS "AS IS" AND
|
||||
* ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE IMPLIED
|
||||
* WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE ARE
|
||||
* DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT HOLDER OR CONTRIBUTORS BE LIABLE FOR
|
||||
* ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES
|
||||
* (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES;
|
||||
* LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON
|
||||
* ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT
|
||||
* (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE OF THIS
|
||||
* SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE.
|
||||
*/
|
||||
|
||||
package uk.co.majenko.audiobookrecorder;
|
||||
|
||||
import javax.swing.ImageIcon;
|
||||
import java.util.List;
|
||||
import java.util.ArrayList;
|
||||
import java.awt.Component;
|
||||
import java.awt.Graphics;
|
||||
|
||||
public class OverlayIcon extends ImageIcon {
|
||||
class IconSpec {
|
||||
public ImageIcon icon;
|
||||
int location;
|
||||
|
||||
public IconSpec(ImageIcon i, int loc) {
|
||||
icon = i;
|
||||
location = loc;
|
||||
}
|
||||
}
|
||||
|
||||
private ImageIcon base;
|
||||
private ArrayList<IconSpec> overlays;
|
||||
|
||||
public static final int TOP_LEFT = 0;
|
||||
public static final int TOP_MIDDLE = 1;
|
||||
public static final int TOP_RIGHT = 2;
|
||||
public static final int MIDDLE_LEFT = 3;
|
||||
public static final int MIDDLE_MIDDLE = 4;
|
||||
public static final int MIDDLE_RIGHT = 5;
|
||||
public static final int BOTTOM_LEFT = 6;
|
||||
public static final int BOTTOM_MIDDLE = 7;
|
||||
public static final int BOTTOM_RIGHT = 8;
|
||||
|
||||
public OverlayIcon(ImageIcon base) {
|
||||
super(base.getImage());
|
||||
this.base = base;
|
||||
this.overlays = new ArrayList<IconSpec>();
|
||||
}
|
||||
|
||||
public void add(ImageIcon overlay, int position) {
|
||||
overlays.add(new IconSpec(overlay, position));
|
||||
}
|
||||
|
||||
@Override
|
||||
|
||||
public synchronized void paintIcon(Component c, Graphics g, int x, int y) {
|
||||
base.paintIcon(c, g, x, y);
|
||||
|
||||
int bw = base.getIconWidth();
|
||||
int bh = base.getIconHeight();
|
||||
|
||||
for(IconSpec icon : overlays) {
|
||||
int iw = icon.icon.getIconWidth();
|
||||
int ih = icon.icon.getIconHeight();
|
||||
|
||||
int ix = 0;
|
||||
int iy = 0;
|
||||
|
||||
switch (icon.location) {
|
||||
case TOP_LEFT:
|
||||
case MIDDLE_LEFT:
|
||||
case BOTTOM_LEFT:
|
||||
ix = 0;
|
||||
break;
|
||||
|
||||
case TOP_MIDDLE:
|
||||
case MIDDLE_MIDDLE:
|
||||
case BOTTOM_MIDDLE:
|
||||
ix = (bw / 2) - (iw / 2);
|
||||
break;
|
||||
|
||||
case TOP_RIGHT:
|
||||
case MIDDLE_RIGHT:
|
||||
case BOTTOM_RIGHT:
|
||||
ix = bw - iw;
|
||||
break;
|
||||
}
|
||||
|
||||
switch (icon.location) {
|
||||
case TOP_LEFT:
|
||||
case TOP_MIDDLE:
|
||||
case TOP_RIGHT:
|
||||
iy = 0;
|
||||
break;
|
||||
|
||||
case MIDDLE_LEFT:
|
||||
case MIDDLE_MIDDLE:
|
||||
case MIDDLE_RIGHT:
|
||||
iy = (bh / 2) - (ih / 2);
|
||||
break;
|
||||
|
||||
case BOTTOM_LEFT:
|
||||
case BOTTOM_MIDDLE:
|
||||
case BOTTOM_RIGHT:
|
||||
iy = bh - ih;
|
||||
break;
|
||||
}
|
||||
|
||||
icon.icon.paintIcon(c, g, x + ix, y + iy);
|
||||
}
|
||||
}
|
||||
}
|
||||
11
src/uk/co/majenko/audiobookrecorder/Overlays.java
Normal file
@@ -0,0 +1,11 @@
|
||||
package uk.co.majenko.audiobookrecorder;
|
||||
|
||||
import javax.swing.*;
|
||||
|
||||
public class Overlays {
|
||||
static public final ImageIcon locked = new ImageIcon(Overlays.class.getResource("overlays/locked.png"));
|
||||
static public final ImageIcon star = new ImageIcon(Overlays.class.getResource("overlays/star.png"));
|
||||
static public final ImageIcon important = new ImageIcon(Overlays.class.getResource("overlays/important.png"));
|
||||
static public final ImageIcon attention = new ImageIcon(Overlays.class.getResource("overlays/attention.png"));
|
||||
static public final ImageIcon filter = new ImageIcon(Overlays.class.getResource("overlays/filter.png"));
|
||||
}
|
||||
@@ -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);
|
||||
@@ -9,12 +9,25 @@ import java.io.*;
|
||||
import java.nio.file.*;
|
||||
import javax.swing.tree.*;
|
||||
import javax.sound.sampled.*;
|
||||
import edu.cmu.sphinx.api.*;
|
||||
import edu.cmu.sphinx.decoder.adaptation.*;
|
||||
import edu.cmu.sphinx.result.*;
|
||||
import davaguine.jeq.spi.EqualizerInputStream;
|
||||
import davaguine.jeq.core.IIRControls;
|
||||
|
||||
import org.apache.http.HttpEntity;
|
||||
import org.apache.http.client.methods.CloseableHttpResponse;
|
||||
import org.apache.http.client.methods.HttpPost;
|
||||
import org.apache.http.entity.ContentType;
|
||||
import org.apache.http.entity.mime.MultipartEntityBuilder;
|
||||
import org.apache.http.entity.mime.content.FileBody;
|
||||
import org.apache.http.entity.mime.content.StringBody;
|
||||
import org.apache.http.impl.client.CloseableHttpClient;
|
||||
import org.apache.http.impl.client.HttpClients;
|
||||
import org.apache.http.util.EntityUtils;
|
||||
|
||||
import org.json.*;
|
||||
|
||||
import java.util.Timer;
|
||||
|
||||
|
||||
public class Sentence extends DefaultMutableTreeNode implements Cacheable {
|
||||
|
||||
String text;
|
||||
@@ -32,14 +45,36 @@ public class Sentence extends DefaultMutableTreeNode implements Cacheable {
|
||||
boolean recording;
|
||||
|
||||
boolean inSample;
|
||||
boolean attention = false;
|
||||
|
||||
int eqProfile = 0;
|
||||
|
||||
double gain = 1.0d;
|
||||
|
||||
String havenJobId = "";
|
||||
|
||||
// 0: Not processed
|
||||
// 1: Submitted
|
||||
// 2: Procesisng finished
|
||||
// 3: Processing failed
|
||||
int havenStatus = 0;
|
||||
|
||||
String overrideText = null;
|
||||
|
||||
public void setOverrideText(String s) { overrideText = s; }
|
||||
public String getOverrideText() { return overrideText; }
|
||||
|
||||
TargetDataLine line;
|
||||
AudioInputStream inputStream;
|
||||
AudioFormat storedFormat = null;
|
||||
double storedLength = -1d;
|
||||
|
||||
int[] storedAudioData = null;
|
||||
|
||||
RecordingThread recordingThread;
|
||||
|
||||
boolean effectEthereal = false;
|
||||
|
||||
static class RecordingThread implements Runnable {
|
||||
|
||||
boolean running = false;
|
||||
@@ -147,10 +182,17 @@ public class Sentence extends DefaultMutableTreeNode implements Cacheable {
|
||||
}
|
||||
|
||||
storedAudioData = null;
|
||||
storedFormat = null;
|
||||
storedLength = -1;
|
||||
|
||||
if (!id.equals("room-noise")) {
|
||||
autoTrimSamplePeak();
|
||||
if (Options.getBoolean("process.sphinx")) {
|
||||
String tm = Options.get("audio.recording.trim");
|
||||
if (tm.equals("peak")) {
|
||||
autoTrimSamplePeak();
|
||||
} else if (tm.equals("fft")) {
|
||||
autoTrimSampleFFT();
|
||||
}
|
||||
if (Options.getBoolean("process.haven.auto")) {
|
||||
recognise();
|
||||
}
|
||||
}
|
||||
@@ -256,6 +298,8 @@ public class Sentence extends DefaultMutableTreeNode implements Cacheable {
|
||||
end = i;
|
||||
}
|
||||
|
||||
end++;
|
||||
|
||||
if (end <= 0) {
|
||||
end = blocks - 1;
|
||||
}
|
||||
@@ -318,6 +362,7 @@ public class Sentence extends DefaultMutableTreeNode implements Cacheable {
|
||||
}
|
||||
|
||||
public void setText(String t) {
|
||||
overrideText = null;
|
||||
text = t;
|
||||
}
|
||||
|
||||
@@ -381,6 +426,10 @@ public class Sentence extends DefaultMutableTreeNode implements Cacheable {
|
||||
}
|
||||
|
||||
public int[] getAudioDataS16LE(AudioInputStream s, AudioFormat format) throws IOException {
|
||||
return getAudioDataS16LE(s, format, true);
|
||||
}
|
||||
|
||||
public int[] getAudioDataS16LE(AudioInputStream s, AudioFormat format, boolean amplify) throws IOException {
|
||||
long len = s.getFrameLength();
|
||||
int frameSize = format.getFrameSize();
|
||||
int chans = format.getChannels();
|
||||
@@ -400,7 +449,12 @@ public class Sentence extends DefaultMutableTreeNode implements Cacheable {
|
||||
} else {
|
||||
sample = (frame[1] << 8) | frame[0];
|
||||
}
|
||||
samples[(int)fno] = sample;
|
||||
if (amplify) {
|
||||
double amped = (double)sample * gain;
|
||||
samples[(int)fno] = (int)amped;
|
||||
} else {
|
||||
samples[(int)fno] = sample;
|
||||
}
|
||||
}
|
||||
|
||||
return samples;
|
||||
@@ -413,7 +467,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;
|
||||
|
||||
@@ -434,6 +488,28 @@ public class Sentence extends DefaultMutableTreeNode implements Cacheable {
|
||||
return null;
|
||||
}
|
||||
|
||||
public int[] getUnprocessedAudioData() {
|
||||
File f = getFile();
|
||||
try {
|
||||
AudioInputStream s = AudioSystem.getAudioInputStream(f);
|
||||
AudioFormat format = getAudioFormat();
|
||||
|
||||
int[] samples = null;
|
||||
|
||||
switch (format.getSampleSizeInBits()) {
|
||||
case 16:
|
||||
samples = getAudioDataS16LE(s, format, false);
|
||||
break;
|
||||
}
|
||||
|
||||
s.close();
|
||||
return samples;
|
||||
} catch (Exception e) {
|
||||
}
|
||||
return null;
|
||||
}
|
||||
|
||||
|
||||
public int getStartCrossing() {
|
||||
return crossStartOffset;
|
||||
}
|
||||
@@ -495,9 +571,9 @@ 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());
|
||||
AudiobookRecorder.window.book.equaliser[eqProfile].apply(controls, format.getChannels());
|
||||
|
||||
int frameSize = format.getFrameSize();
|
||||
|
||||
@@ -511,56 +587,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,9 +609,9 @@ 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());
|
||||
AudiobookRecorder.window.book.equaliser[eqProfile].apply(controls, format.getChannels());
|
||||
|
||||
int frameSize = format.getFrameSize();
|
||||
int length = crossEndOffset - crossStartOffset;
|
||||
@@ -591,6 +631,8 @@ public class Sentence extends DefaultMutableTreeNode implements Cacheable {
|
||||
bytesToRead--;
|
||||
}
|
||||
}
|
||||
|
||||
data = postProcessData(data);
|
||||
|
||||
return data;
|
||||
} catch (Exception e) {
|
||||
@@ -599,70 +641,112 @@ public class Sentence extends DefaultMutableTreeNode implements Cacheable {
|
||||
return null;
|
||||
}
|
||||
|
||||
public void recognise() {
|
||||
byte[] adjustGain(byte[] data) {
|
||||
AudioFormat format = getAudioFormat();
|
||||
int frameSize = format.getFrameSize();
|
||||
int channels = format.getChannels();
|
||||
int bytesPerChannel = frameSize / channels;
|
||||
|
||||
int frames = data.length / frameSize;
|
||||
|
||||
Thread t = new Thread(new Runnable() {
|
||||
int byteNo = 0;
|
||||
|
||||
public void run() {
|
||||
try {
|
||||
byte[] out = new byte[data.length];
|
||||
|
||||
Configuration sphinxConfig = new Configuration();
|
||||
for (int i = 0; i < frames; i++) {
|
||||
if (channels == 1) {
|
||||
int l = data[i * frameSize] >= 0 ? data[i * frameSize] : 256 + data[i * frameSize];
|
||||
int h = data[(i * frameSize) + 1] >= 0 ? data[(i * frameSize) + 1] : 256 + data[(i * frameSize) + 1];
|
||||
|
||||
sphinxConfig.setAcousticModelPath("resource:/edu/cmu/sphinx/models/en-us/en-us");
|
||||
sphinxConfig.setDictionaryPath("resource:/edu/cmu/sphinx/models/en-us/cmudict-en-us.dict");
|
||||
sphinxConfig.setLanguageModelPath("resource:/edu/cmu/sphinx/models/en-us/en-us.lm.bin");
|
||||
int sample = (h << 8) | l;
|
||||
if ((sample & 0x8000) == 0x8000) sample |= 0xFFFF0000;
|
||||
|
||||
double sampleDouble = (double)sample;
|
||||
sampleDouble *= gain;
|
||||
sample = (int)sampleDouble;
|
||||
|
||||
StreamSpeechRecognizer recognizer;
|
||||
|
||||
recognizer = new StreamSpeechRecognizer(sphinxConfig);
|
||||
|
||||
AudioInputStream s = AudioSystem.getAudioInputStream(getFile());
|
||||
AudioFormat format = s.getFormat();
|
||||
int frameSize = format.getFrameSize();
|
||||
int length = (int)s.getFrameLength();
|
||||
byte[] data = new byte[length * frameSize];
|
||||
|
||||
s.read(data);
|
||||
|
||||
int channels = format.getChannels();
|
||||
int newLen = (length / 3);
|
||||
byte[] decimated = new byte[newLen * 2];
|
||||
|
||||
for (int i = 0; i < newLen; i++) {
|
||||
if (channels == 1) {
|
||||
decimated[i * 2] = data[i * 6];
|
||||
decimated[i * 2 + 1] = data[i * 6 + 1];
|
||||
} else {
|
||||
decimated[i * 2] = data[i * 12];
|
||||
decimated[i * 2 + 1] = data[i * 12 + 1];
|
||||
}
|
||||
}
|
||||
|
||||
|
||||
ByteArrayInputStream bas = new ByteArrayInputStream(decimated);
|
||||
recognizer.startRecognition(bas);
|
||||
SpeechResult result;
|
||||
String res = "";
|
||||
while ((result = recognizer.getResult()) != null) {
|
||||
res += result.getHypothesis();
|
||||
res += " ";
|
||||
}
|
||||
recognizer.stopRecognition();
|
||||
|
||||
text = res;
|
||||
|
||||
AudiobookRecorder.window.bookTreeModel.reload(Sentence.this);
|
||||
|
||||
} catch (Exception e) {
|
||||
e.printStackTrace();
|
||||
}
|
||||
if (sample > 32767) sample = 32767;
|
||||
if (sample < -32768) sample = -32768;
|
||||
out[i * frameSize] = (byte)(sample & 0xFF);
|
||||
out[(i * frameSize) + 1] = (byte)((sample & 0xFF00) >> 8);
|
||||
|
||||
} else {
|
||||
return data;
|
||||
}
|
||||
});
|
||||
}
|
||||
|
||||
t.start();
|
||||
return out;
|
||||
}
|
||||
|
||||
byte[] postProcessData(byte[] data) {
|
||||
data = adjustGain(data);
|
||||
|
||||
if (effectEthereal) {
|
||||
data = processEtherealEffect(data);
|
||||
}
|
||||
return data;
|
||||
}
|
||||
|
||||
byte[] processEtherealEffect(byte[] data) {
|
||||
AudioFormat format = getAudioFormat();
|
||||
int frameSize = format.getFrameSize();
|
||||
int channels = format.getChannels();
|
||||
int bytesPerChannel = frameSize / channels;
|
||||
|
||||
int frames = data.length / frameSize;
|
||||
|
||||
int byteNo = 0;
|
||||
|
||||
double fpms = (double)format.getFrameRate() / 1000d;
|
||||
double doubleOffset = fpms * (double) AudiobookRecorder.window.book.getInteger("effects.ethereal.offset");
|
||||
int offset = (int)doubleOffset;
|
||||
double attenuation = 1d - ((double)AudiobookRecorder.window.book.getInteger("effects.ethereal.attenuation") / 100d);
|
||||
|
||||
int copies = AudiobookRecorder.window.book.getInteger("effects.ethereal.iterations");
|
||||
|
||||
byte[] out = new byte[data.length];
|
||||
|
||||
for (int i = 0; i < frames; i++) {
|
||||
if (channels == 1) {
|
||||
int l = data[i * frameSize] >= 0 ? data[i * frameSize] : 256 + data[i * frameSize];
|
||||
int h = data[(i * frameSize) + 1] >= 0 ? data[(i * frameSize) + 1] : 256 + data[(i * frameSize) + 1];
|
||||
|
||||
int sample = (h << 8) | l;
|
||||
if ((sample & 0x8000) == 0x8000) sample |= 0xFFFF0000;
|
||||
|
||||
double sampleDouble = (double)sample;
|
||||
|
||||
int used = 0;
|
||||
for (int j = 0; j < copies; j++) {
|
||||
if (i + (j * offset) < frames) {
|
||||
used++;
|
||||
int lx = data[(i + (j * offset)) * frameSize] >= 0 ? data[(i + (j * offset)) * frameSize] : 256 + data[(i + (j * offset)) * frameSize];
|
||||
int hx = data[((i + (j * offset)) * frameSize) + 1] >= 0 ? data[((i + (j * offset)) * frameSize) + 1] : 256 + data[((i + (j * offset)) * frameSize) + 1];
|
||||
int futureSample = (hx << 8) | lx;
|
||||
if ((futureSample & 0x8000) == 0x8000) futureSample |= 0xFFFF0000;
|
||||
double futureDouble = (double)futureSample;
|
||||
for (int k = 0; k < copies; k++) {
|
||||
futureDouble *= attenuation;
|
||||
}
|
||||
sampleDouble = mix(sampleDouble, futureDouble);
|
||||
}
|
||||
}
|
||||
sample = (int)sampleDouble;
|
||||
if (sample > 32767) sample = 32767;
|
||||
if (sample < -32768) sample = -32768;
|
||||
out[i * frameSize] = (byte)(sample & 0xFF);
|
||||
out[(i * frameSize) + 1] = (byte)((sample & 0xFF00) >> 8);
|
||||
|
||||
} else {
|
||||
return data;
|
||||
}
|
||||
}
|
||||
|
||||
return out;
|
||||
}
|
||||
|
||||
public void recognise() {
|
||||
AudiobookRecorder.window.havenQueue.submit(Sentence.this);
|
||||
}
|
||||
|
||||
public void setLocked(boolean l) {
|
||||
@@ -683,7 +767,7 @@ public class Sentence extends DefaultMutableTreeNode implements Cacheable {
|
||||
|
||||
public void clearCache() {
|
||||
storedAudioData = null;
|
||||
System.gc();
|
||||
// System.gc();
|
||||
}
|
||||
|
||||
public boolean lockedInCache() {
|
||||
@@ -727,4 +811,246 @@ 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;
|
||||
}
|
||||
|
||||
public void setAttentionFlag(boolean f) {
|
||||
attention = f;
|
||||
}
|
||||
|
||||
public boolean getAttentionFlag() {
|
||||
return attention;
|
||||
}
|
||||
|
||||
public String getHavenJobId() {
|
||||
return havenJobId;
|
||||
}
|
||||
|
||||
public void setHavenJobId(String i) {
|
||||
havenJobId = i;
|
||||
}
|
||||
|
||||
public int getHavenStatus() {
|
||||
return havenStatus;
|
||||
}
|
||||
|
||||
public void setHavenStatus(int i) {
|
||||
havenStatus = i;
|
||||
}
|
||||
|
||||
public boolean postHavenData() {
|
||||
String apiKey = Options.get("process.haven.apikey");
|
||||
if (apiKey == null || apiKey.equals("")) return false;
|
||||
|
||||
CloseableHttpClient httpclient = HttpClients.createDefault();
|
||||
|
||||
setOverrideText("[submitting...]");
|
||||
AudiobookRecorder.window.bookTreeModel.reload(this);
|
||||
|
||||
try {
|
||||
HttpPost httppost = new HttpPost("https://api.havenondemand.com/1/api/async/recognizespeech/v2?apikey=" + apiKey);
|
||||
|
||||
FileBody bin = new FileBody(getFile());
|
||||
StringBody language = new StringBody("en-GB");
|
||||
|
||||
HttpEntity reqEntity = MultipartEntityBuilder.create()
|
||||
.addPart("language_model", language)
|
||||
.addPart("file", bin)
|
||||
.build();
|
||||
|
||||
httppost.setEntity(reqEntity);
|
||||
|
||||
CloseableHttpResponse response = httpclient.execute(httppost);
|
||||
try {
|
||||
if (response.getStatusLine().getStatusCode() != 200) {
|
||||
System.err.println("Error posting data: " + response.getStatusLine().getStatusCode());
|
||||
return false;
|
||||
}
|
||||
|
||||
HttpEntity resEntity = response.getEntity();
|
||||
if (resEntity != null) {
|
||||
JSONObject obj = new JSONObject(EntityUtils.toString(resEntity));
|
||||
havenJobId = obj.getString("jobID");
|
||||
System.err.println("Submitted new Haven OnDemand job #" + havenJobId);
|
||||
havenStatus = 1;
|
||||
}
|
||||
EntityUtils.consume(resEntity);
|
||||
} catch (Exception ex) {
|
||||
ex.printStackTrace();
|
||||
return false;
|
||||
}
|
||||
} catch (Exception ex) {
|
||||
ex.printStackTrace();
|
||||
return false;
|
||||
}
|
||||
|
||||
|
||||
return true;
|
||||
// eddec91c-6018-4dcd-bd8d-5e96b23e334c --form "language_model=en-US" --form "file=@3e67460c-f298-4e2c-a412-d375d489e1b3.wav"
|
||||
}
|
||||
|
||||
public void processPendingHaven() {
|
||||
if (havenStatus != 1) return;
|
||||
|
||||
|
||||
String apiKey = Options.get("process.haven.apikey");
|
||||
if (apiKey == null || apiKey.equals("")) return;
|
||||
|
||||
CloseableHttpClient httpclient = HttpClients.createDefault();
|
||||
|
||||
|
||||
try {
|
||||
HttpPost httppost = new HttpPost("https://api.havenondemand.com/1/job/status/" + havenJobId + "?apikey=" + apiKey);
|
||||
|
||||
HttpEntity reqEntity = MultipartEntityBuilder.create().build();
|
||||
httppost.setEntity(reqEntity);
|
||||
|
||||
CloseableHttpResponse response = httpclient.execute(httppost);
|
||||
try {
|
||||
if (response.getStatusLine().getStatusCode() != 200) {
|
||||
havenStatus = 3;
|
||||
return;
|
||||
}
|
||||
|
||||
HttpEntity resEntity = response.getEntity();
|
||||
if (resEntity != null) {
|
||||
JSONObject obj = new JSONObject(EntityUtils.toString(resEntity));
|
||||
|
||||
System.err.println(havenJobId + ": " + obj.getString("status"));
|
||||
|
||||
if (obj.getString("status").equals("finished")) {
|
||||
havenStatus = 2;
|
||||
JSONArray textItems = obj.getJSONArray("actions").getJSONObject(0).getJSONObject("result").getJSONArray("items");
|
||||
|
||||
StringBuilder out = new StringBuilder();
|
||||
|
||||
for (int i = 0; i < textItems.length(); i++) {
|
||||
out.append(textItems.getJSONObject(i).getString("text"));
|
||||
out.append(" ");
|
||||
}
|
||||
String result = out.toString();
|
||||
setText(result.trim());
|
||||
AudiobookRecorder.window.bookTreeModel.reload(Sentence.this);
|
||||
System.err.println(result);
|
||||
} else if (obj.getString("status").equals("queued")) {
|
||||
havenStatus = 1;
|
||||
setOverrideText("[processing...]");
|
||||
AudiobookRecorder.window.bookTreeModel.reload(Sentence.this);
|
||||
} else {
|
||||
text = id;
|
||||
AudiobookRecorder.window.bookTreeModel.reload(Sentence.this);
|
||||
havenStatus = 3;
|
||||
return;
|
||||
}
|
||||
}
|
||||
EntityUtils.consume(resEntity);
|
||||
} catch (Exception ex) {
|
||||
ex.printStackTrace();
|
||||
}
|
||||
} catch (Exception ex) {
|
||||
ex.printStackTrace();
|
||||
}
|
||||
}
|
||||
|
||||
public void setEthereal(boolean e) {
|
||||
effectEthereal = e;
|
||||
}
|
||||
|
||||
public boolean getEthereal() {
|
||||
return effectEthereal;
|
||||
}
|
||||
|
||||
public double mix(double a, double b) {
|
||||
double z;
|
||||
double fa, fb, fz;
|
||||
fa = a + 32768d;
|
||||
fb = b + 32768d;
|
||||
|
||||
if (fa < 32768d && fb < 32768d) {
|
||||
fz = (fa * fb) / 32768d;
|
||||
} else {
|
||||
fz = (2d * (fa + fb)) - ((fa * fb) / 32768d) - 65536d;
|
||||
}
|
||||
|
||||
z = fz - 32768d;
|
||||
return z;
|
||||
}
|
||||
|
||||
public int getPeakValue() {
|
||||
int[] samples = getUnprocessedAudioData();
|
||||
if (samples == null) {
|
||||
return 0;
|
||||
}
|
||||
int ms = 0;
|
||||
for (int i = 0; i < samples.length; i++) {
|
||||
if (Math.abs(samples[i]) > ms) {
|
||||
ms = Math.abs(samples[i]);
|
||||
}
|
||||
}
|
||||
return ms;
|
||||
}
|
||||
|
||||
public int getHeadroom() {
|
||||
int nf = getPeakValue();
|
||||
if (nf == 0) return 0;
|
||||
double r = nf / 32767d;
|
||||
double l10 = Math.log10(r);
|
||||
double db = 20d * l10;
|
||||
|
||||
return (int)db;
|
||||
}
|
||||
|
||||
public void setGain(double g) {
|
||||
if (g <= 0.0001d) g = 1.0d;
|
||||
if (g == gain) return;
|
||||
gain = g;
|
||||
clearCache();
|
||||
}
|
||||
|
||||
public double getGain() {
|
||||
return gain;
|
||||
}
|
||||
|
||||
public void normalize() {
|
||||
if (locked) return;
|
||||
int max = getPeakValue();
|
||||
double d = 23192d / max;
|
||||
if (d > 1.1d) d = 1.1d;
|
||||
setGain(d);
|
||||
}
|
||||
|
||||
public int getEQProfile() {
|
||||
return eqProfile;
|
||||
}
|
||||
|
||||
public void setEQProfile(int e) {
|
||||
eqProfile = e;
|
||||
}
|
||||
|
||||
}
|
||||
|
||||
@@ -8,6 +8,7 @@ import java.awt.image.*;
|
||||
import javax.swing.border.*;
|
||||
import java.util.*;
|
||||
import java.io.*;
|
||||
import java.net.*;
|
||||
|
||||
public class Utils {
|
||||
public static Image getScaledImage(Image srcImg, int w, int h){
|
||||
@@ -46,4 +47,20 @@ public class Utils {
|
||||
return 0.0f;
|
||||
}
|
||||
|
||||
public static double s2d(String s) {
|
||||
try {
|
||||
return Double.parseDouble(s);
|
||||
} catch (Exception e) {
|
||||
}
|
||||
return 0.0d;
|
||||
}
|
||||
|
||||
public static void browse(String url) {
|
||||
if (Desktop.isDesktopSupported()) {
|
||||
try {
|
||||
Desktop.getDesktop().browse(new URI(url));
|
||||
} catch (Exception ex) {
|
||||
}
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
@@ -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;
|
||||
|
||||
@@ -103,12 +105,26 @@ public class Waveform extends JPanel implements MouseListener, MouseMotionListen
|
||||
if (hcnt > 0) have /= hcnt;
|
||||
if (lcnt > 0) lave /= lcnt;
|
||||
|
||||
boolean clip = false;
|
||||
|
||||
if (lmax > 32000) { // -3dB == 23198?
|
||||
clip = true;
|
||||
}
|
||||
|
||||
if (hmax > 32000) { // -3dB
|
||||
clip = true;
|
||||
}
|
||||
|
||||
hmax /= scale;
|
||||
lmax /= scale;
|
||||
have /= scale;
|
||||
lave /= scale;
|
||||
|
||||
g.setColor(new Color(0, 20, 200));
|
||||
if (clip) {
|
||||
g.setColor(new Color(200, 20, 0));
|
||||
} else {
|
||||
g.setColor(new Color(0, 20, 200));
|
||||
}
|
||||
g.drawLine(n, h/2 + lmax, n, h/2 - hmax);
|
||||
g.setColor(new Color(0, 100, 255));
|
||||
g.drawLine(n, h/2 + (int)lave, n, h/2 - (int)have);
|
||||
@@ -126,6 +142,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 +188,7 @@ public class Waveform extends JPanel implements MouseListener, MouseMotionListen
|
||||
|
||||
public void setData(int[] s) {
|
||||
samples = s;
|
||||
playMarker = 0;
|
||||
repaint();
|
||||
}
|
||||
|
||||
@@ -185,13 +206,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 +240,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 +292,8 @@ public class Waveform extends JPanel implements MouseListener, MouseMotionListen
|
||||
repaint();
|
||||
}
|
||||
|
||||
public void setPlayMarker(int m) {
|
||||
playMarker = leftAltMarker + m;
|
||||
repaint();
|
||||
}
|
||||
}
|
||||
|
||||