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
8710667a
Commit
8710667a
authored
Nov 30, 2018
by
Stefan Westerfeld
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
Warn if adding watermark produces clipping.
Signed-off-by:
Stefan Westerfeld
<
stefan@space.twc.de
>
parent
21f66422
Changes
1
Hide whitespace changes
Inline
Side-by-side
Showing
1 changed file
with
10 additions
and
0 deletions
+10
-0
audiowmark.cc
src/audiowmark.cc
+10
-0
No files found.
src/audiowmark.cc
View file @
8710667a
...
...
@@ -396,6 +396,16 @@ add_watermark (const string& infile, const string& outfile, const string& bits)
}
}
bool
clipping_warning
=
false
;
for
(
auto
value
:
out_signal
)
{
if
(
fabs
(
value
)
>=
1.0
&&
!
clipping_warning
)
{
fprintf
(
stderr
,
"audiowmark: warning: clipping occured in watermarked audio signal
\n
"
);
clipping_warning
=
true
;
}
}
WavData
out_wav_data
(
out_signal
,
wav_data
.
n_channels
(),
wav_data
.
mix_freq
(),
wav_data
.
bit_depth
());
if
(
!
out_wav_data
.
save
(
outfile
))
{
...
...
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