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
66333870
Commit
66333870
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
09e50c8d
Changes
4
Hide whitespace changes
Inline
Side-by-side
Showing
4 changed files
with
17 additions
and
2 deletions
+17
-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
+6
-2
No files found.
src/audiowmark.cc
View file @
66333870
...
...
@@ -593,6 +593,15 @@ parse_get_options (ArgParser& ap)
{
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
))
{
Params
::
test_speed
=
f
;
...
...
src/wmcommon.cc
View file @
66333870
...
...
@@ -26,6 +26,7 @@ bool Params::mix = true;
bool
Params
::
hard
=
false
;
// hard decode bits? (soft decoding is better)
bool
Params
::
snr
=
false
;
// compute/show snr while adding watermark
bool
Params
::
detect_speed
=
false
;
double
Params
::
try_speed
=
-
1
;
double
Params
::
test_speed
=
-
1
;
int
Params
::
have_key
=
0
;
size_t
Params
::
payload_size
=
128
;
...
...
src/wmcommon.hh
View file @
66333870
...
...
@@ -46,6 +46,7 @@ public:
static
int
have_key
;
static
bool
detect_speed
;
static
double
try_speed
;
// manual speed correction
static
double
test_speed
;
// for debugging --detect-speed
static
size_t
payload_size
;
// number of payload bits for the watermark
...
...
src/wmget.cc
View file @
66333870
...
...
@@ -549,9 +549,13 @@ 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)
* 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
)
{
double
speed
=
detect_speed
(
wav_data
,
!
orig_pattern
.
empty
());
double
speed
;
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
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