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

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

Risposte (1)

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 Commenti

thank you
but I've tried using .m4a. format
[y,Fs]=audioread('water.m4a');
audiowrite('waterkompresflac.m4a',y,Fs,'BitRate',256);
but still error
this is an error
Error using audiowrite>validateExtension (line 379)
Incorrect file extension for file waterkompresflac.m4a.
Supported extensions are:
.flac
.oga
.ogg
.wav
Error in audiowrite>validateFilename (line 394)
validateExtension(filepath.Extension,filename)
Error in audiowrite (line 165)
[props.filename, fileExisted] = validateFilename( props.filename );
Error in test4 (line 5)
audiowrite('waterkompresflac.m4a',y,Fs,'BitRate',256);
therefore which part of the program should be replaced to get rid of the error ?
I'm sorry, i can't speak english very well
thanks for your help
I suspect you are using Linux; .m4a is supported on Mac and Windows.
I use matlab online free trial
And I'm a windows 8 user
I can't download the app because my laptop's memory is full
MATLAB Online uses Linux.
Perhaps you could archive some of your files onto a USB memory stick, and then load MATLAB onto your laptop.
ok, I'll try
it means there is no problem with the program, right?
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);

Accedi per commentare.

Categorie

Scopri di più su Audio I/O and Waveform Generation in Centro assistenza e File Exchange

Prodotti

Release

R2021a

Richiesto:

il 18 Lug 2021

Commentato:

il 18 Lug 2021

Community Treasure Hunt

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

Start Hunting!

Translated by