dsp.AudioFileReader. What happens when the audio is shorter than 'SamplesPerFrame'?

8 ビュー (過去 30 日間)
Jesus Sanchez
Jesus Sanchez 2018 年 7 月 30 日
回答済み: Dinesh Iyer 2018 年 8 月 3 日
Hello everybody!
While looking to the dsp.AudioFileReader, a question came to me. Imagine that you are processing an audio whose duration is 10 secons in a loop. For each iteration you pick 3 s. of audio to process it using SamplesPerFrame = 3*Fs from dsp.AudioFileReader, where Fs is audio sampling frequency. The thing is that, after 3 iterations, only 1 s of audio is left to be read, but SamplesPerFrame forces to get 3 s. My question is, will this throw an error? Will Matlab perform zero-padding for the last 2 seconds? Will it grab only the second remaning?
Thanks in advance :)

採用された回答

Dinesh Iyer
Dinesh Iyer 2018 年 8 月 3 日
It will zero pad to the frame size.

その他の回答 (0 件)

カテゴリ

Help Center および File ExchangeAudio Processing Algorithm Design についてさらに検索

Community Treasure Hunt

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

Start Hunting!

Translated by