Mercurial > hg > octave-nkf
changeset 19670:2e174b5e7703
Fix audiodevinfo, audioinfo, audioread and audiowrite build process
* audiodevinfo.cc: added bits_to_format utility function
* audioinfo.cc, audioread.cc, audiowrite.cc: make sure to not attempt to
include sndfile.h if it is not present
author | Vytautas Jančauskas <unaudio@gmail.com> |
---|---|
date | Wed, 11 Sep 2013 22:05:47 +0300 |
parents | c2031ad6dbe7 |
children | 91ee78cdba6c |
files | libinterp/dldfcn/audiodevinfo.cc libinterp/dldfcn/audioinfo.cc libinterp/dldfcn/audioread.cc libinterp/dldfcn/audiowrite.cc |
diffstat | 4 files changed, 36 insertions(+), 4 deletions(-) [+] |
line wrap: on
line diff
--- a/libinterp/dldfcn/audiodevinfo.cc +++ b/libinterp/dldfcn/audiodevinfo.cc @@ -2,7 +2,33 @@ #include "ov-struct.h" #include <portaudio.h> -#include "common.h" +PaSampleFormat bits_to_format(int bits) +{ + if (bits == 8) + { + return paInt8; + } + else if (bits == 16) + { + return paInt16; + } + else if (bits == 24) + { + return paInt24; + } + else if (bits == 32) + { + return paInt32; + } + else if (bits == -1) + { + return paFloat32; + } + else + { + return 0; + } +} DEFUN_DLD(audiodevinfo, args, , "-*- texinfo -*-\n\
--- a/libinterp/dldfcn/audioinfo.cc +++ b/libinterp/dldfcn/audioinfo.cc @@ -1,6 +1,8 @@ #include "oct.h" #include "ov-struct.h" -#include <sndfile.h> +#ifdef HAVE_SNDFILE + #include <sndfile.h> +#endif DEFUN_DLD(audioinfo, args, , "-*- texinfo -*-\n\