File audio flac error

조회 수: 1 (최근 30일)
Ferz14
Ferz14 2016년 1월 22일
댓글: Ferz14 2016년 1월 25일
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
Geoff Hayes
Geoff Hayes 2016년 1월 22일
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 2016년 1월 22일
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?

댓글을 달려면 로그인하십시오.

답변 (1개)

Walter Roberson
Walter Roberson 2016년 1월 23일
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
Walter Roberson
Walter Roberson 2016년 1월 25일
Why do you think you need a trigger? What document are you looking at?
Ferz14
Ferz14 2016년 1월 25일
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.

댓글을 달려면 로그인하십시오.

카테고리

Help CenterFile Exchange에서 Audio I/O and Waveform Generation에 대해 자세히 알아보기

태그

Community Treasure Hunt

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

Start Hunting!

Translated by