Mercurial > octave
diff m4/acinclude.m4 @ 32195:9cb43336c3b3
audiowrite: Allow writing mp3 through libsndfile API (bug #64388).
* m4/acinclude.m4 (OCTAVE_CHECK_LIB_SNDFILE_FORMATS): New function that checks
if libsndfile is able to write specific audio formats (currently MPEG audio
formats, including mp3).
* configure.ac: Call OCTAVE_CHECK_LIB_SNDFILE_FORMATS if libsndfile can be used.
* libinterp/dldfcn/audioread.cc (extension_to_format): Add m1a lookup.
(audiowrite): For file extenstions .mp1, .mp2, or .mp3, explicitly assign
corresponding format and MPEG layer.
* etc/NEWS.9.md: Add note about new feature.
author | John Donoghue <john.donoghue@ieee.org> |
---|---|
date | Thu, 06 Jul 2023 11:56:37 -0400 |
parents | 17a09d2bbe0f |
children | a9d6f8953ef0 |
line wrap: on
line diff
--- a/m4/acinclude.m4 Sat Jul 15 10:52:57 2023 +0200 +++ b/m4/acinclude.m4 Thu Jul 06 11:56:37 2023 -0400 @@ -1584,6 +1584,26 @@ : fi ]) + +dnl +dnl Check for support of some specific formats in sndfile library +dnl +AC_DEFUN([OCTAVE_CHECK_LIB_SNDFILE_FORMATS], [ + AC_CACHE_CHECK([whether sndfile library supports mp3], + [octave_cv_lib_sndfile_format_mp3], + [AC_COMPILE_IFELSE([AC_LANG_PROGRAM([[ + #include <sndfile.h> + ]], [[ + int x = SF_FORMAT_MPEG; + ]])], + octave_cv_lib_sndfile_format_mp3=yes, + octave_cv_lib_sndfile_format_mp3=no) + ]) + if test $octave_cv_lib_sndfile_format_mp3 = yes; then + AC_DEFINE(HAVE_LIB_SNDFILE_FORMAT_MP3, 1, + [Define to 1 if libsndfile supports mp3.]) + fi +]) dnl dnl Check whether new API is used with QHelpIndexWidget. dnl Under new API, QHelpIndexWidget emits documentActivates.