What FLAC compression level does audiowrite use?

10 次查看(过去 30 天)
FLAC audio compression has 9 levels (0-8). Higher levels lead to higher compression levels but take longer to encode. What level does the audiowrite function use? I cannot find this anywhere in the the audiowrite documentation.

采纳的回答

Anushka
Anushka 2025-5-7
MATLAB’s ‘audiowrite’ function supports writing FLAC files, but unfortunately, it does not provide any parameter to control the FLAC compression level (which ranges from 0 to 8). Additionally, the documentation does not specify what default level is used internally.
Here is a workaround you can use if you need to control the compression level:
1.Write a WAV file using ‘audiowrite’:
audiowrite(audio.temp_wav,y,Fs);
2. Then, convert it to FLAC using the FLAC command-line tool:
system(flac -f -8 audio_temp.wav);
% You can use -0 to -8 compression level
This approach gives you full control over the compression level. It relies on MATLAB’s system command and the external FLAC encoder, which must be installed separately. Make sure the ‘flac’ command is accessible from your system’s PATH.
Hope this helps!

更多回答(0 个)

类别

Help CenterFile Exchange 中查找有关 Measurements and Spatial Audio 的更多信息

产品


版本

R2024b

Community Treasure Hunt

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

Start Hunting!

Translated by