Skip to content
Projects
Groups
Snippets
Help
Loading...
Help
Submit feedback
Contribute to GitLab
Sign in
Toggle navigation
A
audiowmark
Project
Project
Details
Activity
Releases
Cycle Analytics
Repository
Repository
Files
Commits
Branches
Tags
Contributors
Graph
Compare
Charts
Issues
0
Issues
0
List
Board
Labels
Milestones
Merge Requests
0
Merge Requests
0
CI / CD
CI / CD
Pipelines
Jobs
Schedules
Charts
Wiki
Wiki
Members
Members
Collapse sidebar
Close sidebar
Activity
Graph
Charts
Create a new issue
Jobs
Commits
Issue Boards
Open sidebar
Stefan Westerfeld
audiowmark
Commits
58820005
Commit
58820005
authored
Jan 08, 2022
by
Stefan Westerfeld
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
Add audiowmark get --try-speed option for testing.
Signed-off-by:
Stefan Westerfeld
<
stefan@space.twc.de
>
parent
83e9291d
Changes
4
Hide whitespace changes
Inline
Side-by-side
Showing
4 changed files
with
16 additions
and
2 deletions
+16
-2
audiowmark.cc
src/audiowmark.cc
+9
-0
wmcommon.cc
src/wmcommon.cc
+1
-0
wmcommon.hh
src/wmcommon.hh
+1
-0
wmget.cc
src/wmget.cc
+5
-2
No files found.
src/audiowmark.cc
View file @
58820005
...
@@ -599,6 +599,15 @@ parse_get_options (ArgParser& ap)
...
@@ -599,6 +599,15 @@ parse_get_options (ArgParser& ap)
{
{
Params
::
detect_speed
=
true
;
Params
::
detect_speed
=
true
;
}
}
if
(
ap
.
parse_opt
(
"--try-speed"
,
f
))
{
if
(
Params
::
detect_speed
)
{
error
(
"audiowmark: can not use both options: --detect-speed and --try-speed
\n
"
);
exit
(
1
);
}
Params
::
try_speed
=
f
;
}
if
(
ap
.
parse_opt
(
"--test-speed"
,
f
))
if
(
ap
.
parse_opt
(
"--test-speed"
,
f
))
{
{
Params
::
test_speed
=
f
;
Params
::
test_speed
=
f
;
...
...
src/wmcommon.cc
View file @
58820005
...
@@ -26,6 +26,7 @@ bool Params::mix = true;
...
@@ -26,6 +26,7 @@ bool Params::mix = true;
bool
Params
::
hard
=
false
;
// hard decode bits? (soft decoding is better)
bool
Params
::
hard
=
false
;
// hard decode bits? (soft decoding is better)
bool
Params
::
snr
=
false
;
// compute/show snr while adding watermark
bool
Params
::
snr
=
false
;
// compute/show snr while adding watermark
bool
Params
::
detect_speed
=
false
;
bool
Params
::
detect_speed
=
false
;
double
Params
::
try_speed
=
-
1
;
double
Params
::
test_speed
=
-
1
;
double
Params
::
test_speed
=
-
1
;
int
Params
::
have_key
=
0
;
int
Params
::
have_key
=
0
;
size_t
Params
::
payload_size
=
128
;
size_t
Params
::
payload_size
=
128
;
...
...
src/wmcommon.hh
View file @
58820005
...
@@ -47,6 +47,7 @@ public:
...
@@ -47,6 +47,7 @@ public:
static
int
have_key
;
static
int
have_key
;
static
bool
detect_speed
;
static
bool
detect_speed
;
static
double
try_speed
;
// manual speed correction
static
double
test_speed
;
// for debugging --detect-speed
static
double
test_speed
;
// for debugging --detect-speed
static
size_t
payload_size
;
// number of payload bits for the watermark
static
size_t
payload_size
;
// number of payload bits for the watermark
...
...
src/wmget.cc
View file @
58820005
...
@@ -602,9 +602,12 @@ decode_and_report (const WavData& wav_data, const string& orig_pattern)
...
@@ -602,9 +602,12 @@ decode_and_report (const WavData& wav_data, const string& orig_pattern)
* The reason to do it this way is that the detected speed may be wrong (on short clips)
* The reason to do it this way is that the detected speed may be wrong (on short clips)
* and we don't want to loose a successful clip decoder match in this case.
* and we don't want to loose a successful clip decoder match in this case.
*/
*/
if
(
Params
::
detect_speed
)
if
(
Params
::
detect_speed
||
Params
::
try_speed
>
0
)
{
{
speed
=
detect_speed
(
wav_data
,
!
orig_pattern
.
empty
());
if
(
Params
::
detect_speed
)
speed
=
detect_speed
(
wav_data
,
!
orig_pattern
.
empty
());
else
speed
=
Params
::
try_speed
;
// speeds closer to 1.0 than this usually work without stretching before decode
// speeds closer to 1.0 than this usually work without stretching before decode
if
(
speed
<
0.9999
||
speed
>
1.0001
)
if
(
speed
<
0.9999
||
speed
>
1.0001
)
...
...
Write
Preview
Markdown
is supported
0%
Try again
or
attach a new file
Attach a file
Cancel
You are about to add
0
people
to the discussion. Proceed with caution.
Finish editing this message first!
Cancel
Please
register
or
sign in
to comment