Changing input sizes error when writing data with dsp.AudioFileWriter

조회 수: 11 (최근 30일)
I am using "dsp.AudioFileWriter" to write audio files. When I divide the file into multiple pieces, the last piece will have a different size compared with the previous ones, therefore MATLAB throws the following error message:
Error using dsp.AudioFileWriter/parenReference
Changing the size on input 1 is not allowed without first calling the release() method.
Is there a workaround for this?

채택된 답변

MathWorks Support Team
MathWorks Support Team 2020년 8월 11일
At the current time dsp.AudioFileWriter does not support variable sized inputs and the error is due to the fact that the last frame size is different than the original frame size the object was locked with. Zero-padding is the best way to avoid this error.
You may also consider the following as possible workarounds:
1. Bufffer the audio file data using dsp.AsyncBuffer
2. Write the data to the file in using dsp.AudioFileWriter or audiowrite
An enhancement request has been submitted to the development team to consider supporting this functionality in a future release.

추가 답변 (0개)

카테고리

Help CenterFile Exchange에서 Signal Attributes and Indexing에 대해 자세히 알아보기

제품


릴리스

R2020a

Community Treasure Hunt

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

Start Hunting!

Translated by