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
fe5b3742
Commit
fe5b3742
authored
Feb 20, 2019
by
Stefan Westerfeld
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
Add --test-truncate: makes input file shorter before decoding.
Signed-off-by:
Stefan Westerfeld
<
stefan@space.twc.de
>
parent
f997afda
Changes
1
Hide whitespace changes
Inline
Side-by-side
Showing
1 changed file
with
16 additions
and
0 deletions
+16
-0
audiowmark.cc
src/audiowmark.cc
+16
-0
No files found.
src/audiowmark.cc
View file @
fe5b3742
...
...
@@ -49,6 +49,7 @@ namespace Params
static
int
test_cut
=
0
;
// for sync test
static
bool
test_no_sync
=
false
;
// disable sync
static
int
test_truncate
=
0
;
}
void
...
...
@@ -183,6 +184,10 @@ parse_options (int *argc_p,
{
Params
::
test_no_sync
=
true
;
}
else
if
(
check_arg
(
argc
,
argv
,
&
i
,
"--test-truncate"
,
&
opt_arg
))
{
Params
::
test_truncate
=
atoi
(
opt_arg
);
}
}
/* resort argc/argv */
...
...
@@ -1351,6 +1356,17 @@ get_watermark (const string& infile, const string& orig_pattern)
return
1
;
}
if
(
Params
::
test_truncate
)
{
const
size_t
want_n_samples
=
wav_data
.
sample_rate
()
*
wav_data
.
n_channels
()
*
Params
::
test_truncate
;
vector
<
float
>
short_samples
=
wav_data
.
samples
();
if
(
want_n_samples
<
short_samples
.
size
())
{
short_samples
.
resize
(
want_n_samples
);
wav_data
.
set_samples
(
short_samples
);
}
}
if
(
wav_data
.
sample_rate
()
==
Params
::
mark_sample_rate
)
{
return
decode_and_report
(
wav_data
,
orig_pattern
);
...
...
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