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
25ab6d00
Commit
25ab6d00
authored
Oct 20, 2020
by
Stefan Westerfeld
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
Move truncation out of the inner speed detect loop.
Signed-off-by:
Stefan Westerfeld
<
stefan@space.twc.de
>
parent
77c5f06d
Changes
1
Hide whitespace changes
Inline
Side-by-side
Showing
1 changed file
with
2 additions
and
1 deletion
+2
-1
wmget.cc
src/wmget.cc
+2
-1
No files found.
src/wmget.cc
View file @
25ab6d00
...
@@ -1049,6 +1049,7 @@ truncate (const WavData& in_data, int seconds)
...
@@ -1049,6 +1049,7 @@ truncate (const WavData& in_data, int seconds)
static
double
static
double
detect_speed
(
const
WavData
&
wav_data
,
double
center
,
double
step
,
int
n_steps
,
int
seconds
)
detect_speed
(
const
WavData
&
wav_data
,
double
center
,
double
step
,
int
n_steps
,
int
seconds
)
{
{
WavData
wd_truncated
=
truncate
(
wav_data
,
seconds
*
1.5
);
double
best_speed
=
1.0
;
double
best_speed
=
1.0
;
double
best_quality
=
0
;
double
best_quality
=
0
;
printf
(
"## range [%f..%f], n_steps=%d
\n
"
,
center
*
pow
(
step
,
-
n_steps
),
center
*
pow
(
step
,
n_steps
),
n_steps
);
printf
(
"## range [%f..%f], n_steps=%d
\n
"
,
center
*
pow
(
step
,
-
n_steps
),
center
*
pow
(
step
,
n_steps
),
n_steps
);
...
@@ -1056,7 +1057,7 @@ detect_speed (const WavData& wav_data, double center, double step, int n_steps,
...
@@ -1056,7 +1057,7 @@ detect_speed (const WavData& wav_data, double center, double step, int n_steps,
{
{
double
speed
=
center
*
pow
(
step
,
p
);
double
speed
=
center
*
pow
(
step
,
p
);
WavData
wd_resampled
=
truncate
(
wav_data
,
seconds
*
1.5
)
;
WavData
wd_resampled
=
wd_truncated
;
if
(
p
!=
0
)
if
(
p
!=
0
)
wd_resampled
=
resample
(
wd_resampled
,
Params
::
mark_sample_rate
*
speed
);
wd_resampled
=
resample
(
wd_resampled
,
Params
::
mark_sample_rate
*
speed
);
...
...
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