question-mark
Stuck on an issue?

Lightrun Answers was designed to reduce the constant googling that comes with debugging 3rd party libraries. It collects links to all the places you might be looking at while hunting down a tough bug.

And, if you’re still stuck at the end, we’re happy to hop on a call to see how we can help out.

audio amplitude out of range, auto clipped

See original GitHub issue

Hi there just want to ask something regarding the warning below:

> def audio(tag, tensor, sample_rate=44100):
>     tensor = make_np(tensor)
>     tensor = tensor.squeeze()
>     if abs(tensor).max() > 1:
>         print('warning: audio amplitude out of range, auto clipped.')
>         tensor = tensor.clip(-1, 1)
  1. What are the reason if i’am getting the warning on my terminal during training at the end of the validation phase?

  2. At which part of my audio data that i should modify to avoid my audio from being clipped?

  3. What would be the effect on my output if im getting the warning?

Looking forward to see your explanation on this 😃

Issue Analytics

  • State:closed
  • Created 4 years ago
  • Comments:5 (3 by maintainers)

github_iconTop GitHub Comments

1reaction
lanpacommented, Apr 11, 2020

Hi, I don’t think the clipping operation will affect the training loss. The data you passed (which should be some output from your network) is first cloned and then been applied the clip if necessary.

For the second question, lets take imageNet classification as an example. The classification score is represented as a 1000-dim vector and its value is not guaranteed to lie in [0, 1]. To make them in [0, 1], you can either add a sigmoid layer after the last layer or compute the maximum of the output and divide all of the elements by that max value. Even more, you can clip the value by yourself before passing to add_audio.

Why the need of clipping ya? -> to meet the data format standard. Is it mean that my audio amplitude is very high? Should i edit my audio amplitude on the audio editor before i start the training? -> maybe. check the datatype carefully and inspect each layer’s output if possible.

0reactions
haqkiemdaimcommented, Apr 10, 2020

@lanpa hey there, again just want to ask, what if i just comment the clipping code:

#tensor = tensor.clip(-1, 1)

because i noticed that the clipping make my loss become higher AND

I still confuse on:

To avoid the clipping, you can normalize the input by yourself. For example, x = x/max(x)

Where is exactly the part of the code should i add the above normalization operation ya?

And one more thing, i still don’t understand:

  1. Why the need of clipping ya?
  2. Is it mean that my audio amplitude is very high? Should i edit my audio amplitude on the audio editor before i start the training?

sory again if i ask a lot …

Read more comments on GitHub >

github_iconTop Results From Across the Web

Audio generated with TTS is a Bip
I am training TTS on a custom language dataset composed by 500 wavs. warning: audio amplitude out of range, auto clipped.
Read more >
Developers - audio amplitude out of range, auto clipped -
Hi there just want to ask something regarding the warning below: > def audio(tag, tensor, sample_rate=44100): > tensor = make_np(tensor) ...
Read more >
How do I get started training a custom voice model with ...
The Mozilla TTS project has documentation and tutorials, but I'm having trouble putting the pieces together -- it seems like there's some basic ......
Read more >
What is Audio Clipping: Examples, Causes, & the Easy Fix
The basic cause of peaking is that somewhere along the line leading to your speakers or headphones, the audio signal has become too...
Read more >
Torchaudio.transforms.griffinlim output to tensorboard audio
GriffinLim to TensorBoard, I get warning: audio amplitude out of range, auto clipped. and there is no “audio” tab in TensorBoard.
Read more >

github_iconTop Related Medium Post

No results found

github_iconTop Related StackOverflow Question

No results found

github_iconTroubleshoot Live Code

Lightrun enables developers to add logs, metrics and snapshots to live code - no restarts or redeploys required.
Start Free

github_iconTop Related Reddit Thread

No results found

github_iconTop Related Hackernoon Post

No results found

github_iconTop Related Tweet

No results found

github_iconTop Related Dev.to Post

No results found

github_iconTop Related Hashnode Post

No results found