File audio flac error

1 visualizzazione (ultimi 30 giorni)
Ferz14
Ferz14 il 22 Gen 2016
Commentato: Ferz14 il 25 Gen 2016
How to create file audio in flac format? I have used audiowrite but it hasn't worked. The error is described as "Warning: Data clipped when writing file. > In audiowrite>clipInputData (line 396) In audiowrite (line 176) " Can you solve this problem please? Thank you!
  2 Commenti
Geoff Hayes
Geoff Hayes il 22 Gen 2016
Ferz14 - you are observing a warning and not an error or is there a problem with the audio file?
See Walter's answer at http://www.mathworks.com/matlabcentral/answers/257223-audiowrite-clipping-warning-issue for an explanation of the warning.
Ferz14
Ferz14 il 22 Gen 2016
Thank you! I need to create a sine wave with amplitude=5 but I can't do it. I've tried in wav format but in this way amplitude values are clipped to the range –1.0 <= y < +1.0. Could you explain me how to do?

Accedi per commentare.

Risposte (1)

Walter Roberson
Walter Roberson il 23 Gen 2016
You could write out an audio file with amplitude 5, but it would have to be integer 5, representing 5/255 of maximum amplitude (uint8) or 5/32767 of maximum amplitude (int16) or 5/(2^31-1) of maximum amplitude (int32)
If you are writing a floating point value, then the value always represents fraction of the maximum; if you were able to represent a value 5 times the maximum then the clearly the maximum would be high enough to encompass that 5 times value, so by way of contradiction the value cannot exceed 1.0 in floating point.
  24 Commenti
Walter Roberson
Walter Roberson il 25 Gen 2016
Why do you think you need a trigger? What document are you looking at?
Ferz14
Ferz14 il 25 Gen 2016
Because my work is to sample an analog input at the rising edge of the digital trigger. I send a file audio (a sine wave) and my DAQ samples the signal when receives the trigger. What am I doing wrong? Thanks.

Accedi per commentare.

Categorie

Scopri di più su Audio I/O and Waveform Generation in Help Center e File Exchange

Community Treasure Hunt

Find the treasures in MATLAB Central and discover how the community can help you!

Start Hunting!

Translated by