How to compress audio for filename extensions .flac(FLAC), .alac(ALAC), .wv(Wavpack) with varying bitrates ?

3 次查看(过去 30 天)
Hello, all,
I want to ask about audio compression with bitrate,
How to compress audio for filename extensions .flac(FLAC), .alac(ALAC), .wv(Wavpack) with varying bitrates ?
I have tried with the code below, but there is an error
[y,Fs]=audioread('water.flac');
audiowrite('waterkompres.flac',y,Fs,'BitRate',128);
So is there any other simple coding?
or what should we do to remove the error in the coding?
thank you very much

回答(1 个)

Walter Roberson
Walter Roberson 2021-7-18
Bitrate: "Only available for MPEG-4 (.m4a, .mp4) files."
so you will not be able to do it using audiowrite() and will need to find third party libraries or tools.
  7 个评论
Walter Roberson
Walter Roberson 2021-7-18
It does not matter what kind of file you read from; it matters what kind of file you write to, and that you get the right rate.
[y,Fs]=audioread('water.m4a');
yr = resample(y, 44100, Fs);
audiowrite('waterkompresflac.m4a',yr,4r100,'BitRate',256);

请先登录,再进行评论。

类别

Help CenterFile Exchange 中查找有关 Audio I/O and Waveform Generation 的更多信息

产品


版本

R2021a

Community Treasure Hunt

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

Start Hunting!

Translated by