What FLAC compression level does audiowrite use?
8 visualizaciones (últimos 30 días)
Mostrar comentarios más antiguos
Selene Fregosi
el 18 de Abr. de 2025
Respondida: Anushka
el 7 de Mayo de 2025
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.
0 comentarios
Respuesta aceptada
Anushka
el 7 de Mayo de 2025
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 comentarios
Más respuestas (0)
Ver también
Categorías
Más información sobre Measurements and Spatial Audio en Help Center y File Exchange.
Community Treasure Hunt
Find the treasures in MATLAB Central and discover how the community can help you!
Start Hunting!