Changing input sizes error when writing data with dsp.AudioFileWriter

18 次查看(过去 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
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 个)

产品


版本

R2020a

Community Treasure Hunt

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

Start Hunting!

Translated by