Mercurial > octave-nkf
annotate libinterp/dldfcn/audioread.cc @ 19578:827394ba8eb2
Backed out changeset 5f313345912f
Undo accidental changes from previous changeset.
author | John W. Eaton <jwe@octave.org> |
---|---|
date | Wed, 07 Jan 2015 18:11:05 -0500 |
parents | 5f313345912f |
children | 57efd0a020cf |
rev | line source |
---|---|
19534
8bb399569393
Add Octave copyright header block to audio project files
Mike Miller <mtmiller@ieee.org>
parents:
19532
diff
changeset
|
1 /* |
8bb399569393
Add Octave copyright header block to audio project files
Mike Miller <mtmiller@ieee.org>
parents:
19532
diff
changeset
|
2 |
8bb399569393
Add Octave copyright header block to audio project files
Mike Miller <mtmiller@ieee.org>
parents:
19532
diff
changeset
|
3 Copyright (C) 2013 Vytautas JanĨauskas |
8bb399569393
Add Octave copyright header block to audio project files
Mike Miller <mtmiller@ieee.org>
parents:
19532
diff
changeset
|
4 |
8bb399569393
Add Octave copyright header block to audio project files
Mike Miller <mtmiller@ieee.org>
parents:
19532
diff
changeset
|
5 This file is part of Octave. |
8bb399569393
Add Octave copyright header block to audio project files
Mike Miller <mtmiller@ieee.org>
parents:
19532
diff
changeset
|
6 |
8bb399569393
Add Octave copyright header block to audio project files
Mike Miller <mtmiller@ieee.org>
parents:
19532
diff
changeset
|
7 Octave is free software; you can redistribute it and/or modify it |
8bb399569393
Add Octave copyright header block to audio project files
Mike Miller <mtmiller@ieee.org>
parents:
19532
diff
changeset
|
8 under the terms of the GNU General Public License as published by the |
8bb399569393
Add Octave copyright header block to audio project files
Mike Miller <mtmiller@ieee.org>
parents:
19532
diff
changeset
|
9 Free Software Foundation; either version 3 of the License, or (at your |
8bb399569393
Add Octave copyright header block to audio project files
Mike Miller <mtmiller@ieee.org>
parents:
19532
diff
changeset
|
10 option) any later version. |
8bb399569393
Add Octave copyright header block to audio project files
Mike Miller <mtmiller@ieee.org>
parents:
19532
diff
changeset
|
11 |
8bb399569393
Add Octave copyright header block to audio project files
Mike Miller <mtmiller@ieee.org>
parents:
19532
diff
changeset
|
12 Octave is distributed in the hope that it will be useful, but WITHOUT |
8bb399569393
Add Octave copyright header block to audio project files
Mike Miller <mtmiller@ieee.org>
parents:
19532
diff
changeset
|
13 ANY WARRANTY; without even the implied warranty of MERCHANTABILITY or |
8bb399569393
Add Octave copyright header block to audio project files
Mike Miller <mtmiller@ieee.org>
parents:
19532
diff
changeset
|
14 FITNESS FOR A PARTICULAR PURPOSE. See the GNU General Public License |
8bb399569393
Add Octave copyright header block to audio project files
Mike Miller <mtmiller@ieee.org>
parents:
19532
diff
changeset
|
15 for more details. |
8bb399569393
Add Octave copyright header block to audio project files
Mike Miller <mtmiller@ieee.org>
parents:
19532
diff
changeset
|
16 |
8bb399569393
Add Octave copyright header block to audio project files
Mike Miller <mtmiller@ieee.org>
parents:
19532
diff
changeset
|
17 You should have received a copy of the GNU General Public License |
8bb399569393
Add Octave copyright header block to audio project files
Mike Miller <mtmiller@ieee.org>
parents:
19532
diff
changeset
|
18 along with Octave; see the file COPYING. If not, see |
8bb399569393
Add Octave copyright header block to audio project files
Mike Miller <mtmiller@ieee.org>
parents:
19532
diff
changeset
|
19 <http://www.gnu.org/licenses/>. |
8bb399569393
Add Octave copyright header block to audio project files
Mike Miller <mtmiller@ieee.org>
parents:
19532
diff
changeset
|
20 |
8bb399569393
Add Octave copyright header block to audio project files
Mike Miller <mtmiller@ieee.org>
parents:
19532
diff
changeset
|
21 */ |
8bb399569393
Add Octave copyright header block to audio project files
Mike Miller <mtmiller@ieee.org>
parents:
19532
diff
changeset
|
22 |
19535
1f551d169db2
Include config.h in audio project source files
Mike Miller <mtmiller@ieee.org>
parents:
19534
diff
changeset
|
23 #ifdef HAVE_CONFIG_H |
1f551d169db2
Include config.h in audio project source files
Mike Miller <mtmiller@ieee.org>
parents:
19534
diff
changeset
|
24 #include <config.h> |
1f551d169db2
Include config.h in audio project source files
Mike Miller <mtmiller@ieee.org>
parents:
19534
diff
changeset
|
25 #endif |
1f551d169db2
Include config.h in audio project source files
Mike Miller <mtmiller@ieee.org>
parents:
19534
diff
changeset
|
26 |
19544 | 27 #include <string> |
28 #include <map> | |
29 | |
19547
4cb4210bd392
use C++ style casts in audio code
John W. Eaton <jwe@octave.org>
parents:
19546
diff
changeset
|
30 #include "oct-locbuf.h" |
4cb4210bd392
use C++ style casts in audio code
John W. Eaton <jwe@octave.org>
parents:
19546
diff
changeset
|
31 |
19545
19f75d156ffe
don't include oct.h in Octave source files
John W. Eaton <jwe@octave.org>
parents:
19544
diff
changeset
|
32 #include "defun-dld.h" |
19f75d156ffe
don't include oct.h in Octave source files
John W. Eaton <jwe@octave.org>
parents:
19544
diff
changeset
|
33 #include "error.h" |
19f75d156ffe
don't include oct.h in Octave source files
John W. Eaton <jwe@octave.org>
parents:
19544
diff
changeset
|
34 #include "gripes.h" |
19f75d156ffe
don't include oct.h in Octave source files
John W. Eaton <jwe@octave.org>
parents:
19544
diff
changeset
|
35 #include "oct-obj.h" |
19f75d156ffe
don't include oct.h in Octave source files
John W. Eaton <jwe@octave.org>
parents:
19544
diff
changeset
|
36 #include "ov.h" |
19497
157eeaa53277
Fix includes in audioread, audiowrite and audioinfo
Vytautas Jančauskas <unaudio@gmail.com>
parents:
19496
diff
changeset
|
37 #include "ov-struct.h" |
19544 | 38 |
19507
2e174b5e7703
Fix audiodevinfo, audioinfo, audioread and audiowrite build process
Vytautas Jančauskas <unaudio@gmail.com>
parents:
19502
diff
changeset
|
39 #ifdef HAVE_SNDFILE |
19537
36a26a131209
Apply Octave coding style to audio project additions
Mike Miller <mtmiller@ieee.org>
parents:
19535
diff
changeset
|
40 #include <sndfile.h> |
19507
2e174b5e7703
Fix audiodevinfo, audioinfo, audioread and audiowrite build process
Vytautas Jančauskas <unaudio@gmail.com>
parents:
19502
diff
changeset
|
41 #endif |
19537
36a26a131209
Apply Octave coding style to audio project additions
Mike Miller <mtmiller@ieee.org>
parents:
19535
diff
changeset
|
42 |
36a26a131209
Apply Octave coding style to audio project additions
Mike Miller <mtmiller@ieee.org>
parents:
19535
diff
changeset
|
43 DEFUN_DLD (audioread, args, , |
19539
ce02743b6f2a
Fix texinfo docstring syntax for all audio functions
Mike Miller <mtmiller@ieee.org>
parents:
19537
diff
changeset
|
44 "-*- texinfo -*-\n\ |
ce02743b6f2a
Fix texinfo docstring syntax for all audio functions
Mike Miller <mtmiller@ieee.org>
parents:
19537
diff
changeset
|
45 @deftypefn {Loadable Function} {[@var{y}, @var{fs}] =} audioread (@var{filename})\n\ |
19550
fc85d9026bb6
doc fixes for audio functions
John W. Eaton <jwe@octave.org>
parents:
19547
diff
changeset
|
46 @deftypefnx {Loadable Function} {[@var{y}, @var{fs}] =} audioread (@var{filename}, @var{samples})\n\ |
19496
0243b86b3cee
Added libsndfile based audio file utilities to the source tree
Vytautas Jančauskas <unaudio@gmail.com>
parents:
diff
changeset
|
47 \n\ |
19550
fc85d9026bb6
doc fixes for audio functions
John W. Eaton <jwe@octave.org>
parents:
19547
diff
changeset
|
48 @deftypefnx {Loadable Function} {[@var{y}, @var{fs}] =} audioread (@var{filename}, @var{datatype})\n\ |
fc85d9026bb6
doc fixes for audio functions
John W. Eaton <jwe@octave.org>
parents:
19547
diff
changeset
|
49 @deftypefnx {Loadable Function} {[@var{y}, @var{fs}] =} audioread (@var{filename}, @var{samples}, @var{datatype})\n\ |
fc85d9026bb6
doc fixes for audio functions
John W. Eaton <jwe@octave.org>
parents:
19547
diff
changeset
|
50 Read the audio file @var{filename} and return the audio data and sampling\n\ |
fc85d9026bb6
doc fixes for audio functions
John W. Eaton <jwe@octave.org>
parents:
19547
diff
changeset
|
51 rate. The audio data is stored as matrix with rows corresponding\n\ |
fc85d9026bb6
doc fixes for audio functions
John W. Eaton <jwe@octave.org>
parents:
19547
diff
changeset
|
52 to audio frames and columns corresponding to channels.\n\ |
19496
0243b86b3cee
Added libsndfile based audio file utilities to the source tree
Vytautas Jančauskas <unaudio@gmail.com>
parents:
diff
changeset
|
53 \n\ |
19550
fc85d9026bb6
doc fixes for audio functions
John W. Eaton <jwe@octave.org>
parents:
19547
diff
changeset
|
54 The optional two-element vector argument @var{samples} specifies starting\n\ |
fc85d9026bb6
doc fixes for audio functions
John W. Eaton <jwe@octave.org>
parents:
19547
diff
changeset
|
55 and ending frames.\n\ |
19496
0243b86b3cee
Added libsndfile based audio file utilities to the source tree
Vytautas Jančauskas <unaudio@gmail.com>
parents:
diff
changeset
|
56 \n\ |
19550
fc85d9026bb6
doc fixes for audio functions
John W. Eaton <jwe@octave.org>
parents:
19547
diff
changeset
|
57 The optional argument @var{datatype} specifies the datatype to return.\n\ |
fc85d9026bb6
doc fixes for audio functions
John W. Eaton <jwe@octave.org>
parents:
19547
diff
changeset
|
58 If it is @qcode{\"native\"}, then the type of data depends on how the\n\ |
fc85d9026bb6
doc fixes for audio functions
John W. Eaton <jwe@octave.org>
parents:
19547
diff
changeset
|
59 data is stored in the audio file.\n\ |
19496
0243b86b3cee
Added libsndfile based audio file utilities to the source tree
Vytautas Jančauskas <unaudio@gmail.com>
parents:
diff
changeset
|
60 \n\ |
19539
ce02743b6f2a
Fix texinfo docstring syntax for all audio functions
Mike Miller <mtmiller@ieee.org>
parents:
19537
diff
changeset
|
61 Read a file and return a specified range of frames in an array of specified type.\n\ |
19496
0243b86b3cee
Added libsndfile based audio file utilities to the source tree
Vytautas Jančauskas <unaudio@gmail.com>
parents:
diff
changeset
|
62 \n\ |
19550
fc85d9026bb6
doc fixes for audio functions
John W. Eaton <jwe@octave.org>
parents:
19547
diff
changeset
|
63 @end deftypefn") |
19496
0243b86b3cee
Added libsndfile based audio file utilities to the source tree
Vytautas Jančauskas <unaudio@gmail.com>
parents:
diff
changeset
|
64 { |
0243b86b3cee
Added libsndfile based audio file utilities to the source tree
Vytautas Jančauskas <unaudio@gmail.com>
parents:
diff
changeset
|
65 octave_value_list retval; |
19553
e616c2830413
various style fixes for audio code
John W. Eaton <jwe@octave.org>
parents:
19550
diff
changeset
|
66 |
19502
9161b7653392
compile audio file utilities even when sndfile is not present
Vytautas Jančauskas <unaudio@gmail.com>
parents:
19497
diff
changeset
|
67 #ifdef HAVE_SNDFILE |
19553
e616c2830413
various style fixes for audio code
John W. Eaton <jwe@octave.org>
parents:
19550
diff
changeset
|
68 |
e616c2830413
various style fixes for audio code
John W. Eaton <jwe@octave.org>
parents:
19550
diff
changeset
|
69 int nargin = args.length (); |
e616c2830413
various style fixes for audio code
John W. Eaton <jwe@octave.org>
parents:
19550
diff
changeset
|
70 |
e616c2830413
various style fixes for audio code
John W. Eaton <jwe@octave.org>
parents:
19550
diff
changeset
|
71 if (nargin < 1 || nargin > 3) |
e616c2830413
various style fixes for audio code
John W. Eaton <jwe@octave.org>
parents:
19550
diff
changeset
|
72 { |
e616c2830413
various style fixes for audio code
John W. Eaton <jwe@octave.org>
parents:
19550
diff
changeset
|
73 print_usage (); |
e616c2830413
various style fixes for audio code
John W. Eaton <jwe@octave.org>
parents:
19550
diff
changeset
|
74 return retval; |
e616c2830413
various style fixes for audio code
John W. Eaton <jwe@octave.org>
parents:
19550
diff
changeset
|
75 } |
e616c2830413
various style fixes for audio code
John W. Eaton <jwe@octave.org>
parents:
19550
diff
changeset
|
76 |
e616c2830413
various style fixes for audio code
John W. Eaton <jwe@octave.org>
parents:
19550
diff
changeset
|
77 std::string filename = args(0).string_value (); |
e616c2830413
various style fixes for audio code
John W. Eaton <jwe@octave.org>
parents:
19550
diff
changeset
|
78 |
e616c2830413
various style fixes for audio code
John W. Eaton <jwe@octave.org>
parents:
19550
diff
changeset
|
79 if (error_state) |
e616c2830413
various style fixes for audio code
John W. Eaton <jwe@octave.org>
parents:
19550
diff
changeset
|
80 return retval; |
e616c2830413
various style fixes for audio code
John W. Eaton <jwe@octave.org>
parents:
19550
diff
changeset
|
81 |
19496
0243b86b3cee
Added libsndfile based audio file utilities to the source tree
Vytautas Jančauskas <unaudio@gmail.com>
parents:
diff
changeset
|
82 SF_INFO info; |
0243b86b3cee
Added libsndfile based audio file utilities to the source tree
Vytautas Jančauskas <unaudio@gmail.com>
parents:
diff
changeset
|
83 info.format = 0; |
19553
e616c2830413
various style fixes for audio code
John W. Eaton <jwe@octave.org>
parents:
19550
diff
changeset
|
84 SNDFILE *file = sf_open (filename.c_str (), SFM_READ, &info); |
e616c2830413
various style fixes for audio code
John W. Eaton <jwe@octave.org>
parents:
19550
diff
changeset
|
85 int start = 0; |
e616c2830413
various style fixes for audio code
John W. Eaton <jwe@octave.org>
parents:
19550
diff
changeset
|
86 int end = info.frames; |
19547
4cb4210bd392
use C++ style casts in audio code
John W. Eaton <jwe@octave.org>
parents:
19546
diff
changeset
|
87 OCTAVE_LOCAL_BUFFER (float, data, info.frames * info.channels); |
19537
36a26a131209
Apply Octave coding style to audio project additions
Mike Miller <mtmiller@ieee.org>
parents:
19535
diff
changeset
|
88 sf_read_float (file, data, info.frames * info.channels); |
19553
e616c2830413
various style fixes for audio code
John W. Eaton <jwe@octave.org>
parents:
19550
diff
changeset
|
89 |
e616c2830413
various style fixes for audio code
John W. Eaton <jwe@octave.org>
parents:
19550
diff
changeset
|
90 if ((nargin == 2 && ! args(1).is_string ()) || nargin == 3) |
19496
0243b86b3cee
Added libsndfile based audio file utilities to the source tree
Vytautas Jančauskas <unaudio@gmail.com>
parents:
diff
changeset
|
91 { |
0243b86b3cee
Added libsndfile based audio file utilities to the source tree
Vytautas Jančauskas <unaudio@gmail.com>
parents:
diff
changeset
|
92 RowVector range = args(1).row_vector_value (); |
19553
e616c2830413
various style fixes for audio code
John W. Eaton <jwe@octave.org>
parents:
19550
diff
changeset
|
93 |
e616c2830413
various style fixes for audio code
John W. Eaton <jwe@octave.org>
parents:
19550
diff
changeset
|
94 if (error_state) |
e616c2830413
various style fixes for audio code
John W. Eaton <jwe@octave.org>
parents:
19550
diff
changeset
|
95 return retval; |
e616c2830413
various style fixes for audio code
John W. Eaton <jwe@octave.org>
parents:
19550
diff
changeset
|
96 |
19496
0243b86b3cee
Added libsndfile based audio file utilities to the source tree
Vytautas Jančauskas <unaudio@gmail.com>
parents:
diff
changeset
|
97 start = range(0); |
0243b86b3cee
Added libsndfile based audio file utilities to the source tree
Vytautas Jančauskas <unaudio@gmail.com>
parents:
diff
changeset
|
98 end = range(1); |
0243b86b3cee
Added libsndfile based audio file utilities to the source tree
Vytautas Jančauskas <unaudio@gmail.com>
parents:
diff
changeset
|
99 } |
19553
e616c2830413
various style fixes for audio code
John W. Eaton <jwe@octave.org>
parents:
19550
diff
changeset
|
100 |
e616c2830413
various style fixes for audio code
John W. Eaton <jwe@octave.org>
parents:
19550
diff
changeset
|
101 Matrix audio (end - start, info.channels); |
e616c2830413
various style fixes for audio code
John W. Eaton <jwe@octave.org>
parents:
19550
diff
changeset
|
102 |
19496
0243b86b3cee
Added libsndfile based audio file utilities to the source tree
Vytautas Jančauskas <unaudio@gmail.com>
parents:
diff
changeset
|
103 for (int i = start; i < end; i++) |
0243b86b3cee
Added libsndfile based audio file utilities to the source tree
Vytautas Jančauskas <unaudio@gmail.com>
parents:
diff
changeset
|
104 { |
0243b86b3cee
Added libsndfile based audio file utilities to the source tree
Vytautas Jančauskas <unaudio@gmail.com>
parents:
diff
changeset
|
105 for (int channel = 0; channel < info.channels; channel++) |
19553
e616c2830413
various style fixes for audio code
John W. Eaton <jwe@octave.org>
parents:
19550
diff
changeset
|
106 audio(i - start, channel) = data[i * info.channels + channel]; |
19537
36a26a131209
Apply Octave coding style to audio project additions
Mike Miller <mtmiller@ieee.org>
parents:
19535
diff
changeset
|
107 } |
19547
4cb4210bd392
use C++ style casts in audio code
John W. Eaton <jwe@octave.org>
parents:
19546
diff
changeset
|
108 |
19553
e616c2830413
various style fixes for audio code
John W. Eaton <jwe@octave.org>
parents:
19550
diff
changeset
|
109 octave_value ret_audio; |
e616c2830413
various style fixes for audio code
John W. Eaton <jwe@octave.org>
parents:
19550
diff
changeset
|
110 |
e616c2830413
various style fixes for audio code
John W. Eaton <jwe@octave.org>
parents:
19550
diff
changeset
|
111 if ((nargin == 2 && args(1).is_string ()) || nargin == 3) |
19496
0243b86b3cee
Added libsndfile based audio file utilities to the source tree
Vytautas Jančauskas <unaudio@gmail.com>
parents:
diff
changeset
|
112 { |
0243b86b3cee
Added libsndfile based audio file utilities to the source tree
Vytautas Jančauskas <unaudio@gmail.com>
parents:
diff
changeset
|
113 std::string type; |
19553
e616c2830413
various style fixes for audio code
John W. Eaton <jwe@octave.org>
parents:
19550
diff
changeset
|
114 if (nargin == 3) |
19537
36a26a131209
Apply Octave coding style to audio project additions
Mike Miller <mtmiller@ieee.org>
parents:
19535
diff
changeset
|
115 type = args(2).string_value (); |
19496
0243b86b3cee
Added libsndfile based audio file utilities to the source tree
Vytautas Jančauskas <unaudio@gmail.com>
parents:
diff
changeset
|
116 else |
19537
36a26a131209
Apply Octave coding style to audio project additions
Mike Miller <mtmiller@ieee.org>
parents:
19535
diff
changeset
|
117 type = args(1).string_value (); |
36a26a131209
Apply Octave coding style to audio project additions
Mike Miller <mtmiller@ieee.org>
parents:
19535
diff
changeset
|
118 |
19553
e616c2830413
various style fixes for audio code
John W. Eaton <jwe@octave.org>
parents:
19550
diff
changeset
|
119 if (error_state) |
e616c2830413
various style fixes for audio code
John W. Eaton <jwe@octave.org>
parents:
19550
diff
changeset
|
120 return retval; |
e616c2830413
various style fixes for audio code
John W. Eaton <jwe@octave.org>
parents:
19550
diff
changeset
|
121 |
19496
0243b86b3cee
Added libsndfile based audio file utilities to the source tree
Vytautas Jančauskas <unaudio@gmail.com>
parents:
diff
changeset
|
122 if (type == "native") |
0243b86b3cee
Added libsndfile based audio file utilities to the source tree
Vytautas Jančauskas <unaudio@gmail.com>
parents:
diff
changeset
|
123 { |
0243b86b3cee
Added libsndfile based audio file utilities to the source tree
Vytautas Jančauskas <unaudio@gmail.com>
parents:
diff
changeset
|
124 if (info.format & SF_FORMAT_PCM_S8) |
19553
e616c2830413
various style fixes for audio code
John W. Eaton <jwe@octave.org>
parents:
19550
diff
changeset
|
125 ret_audio = int8NDArray (audio * 127); |
19496
0243b86b3cee
Added libsndfile based audio file utilities to the source tree
Vytautas Jančauskas <unaudio@gmail.com>
parents:
diff
changeset
|
126 else if (info.format & SF_FORMAT_PCM_U8) |
19553
e616c2830413
various style fixes for audio code
John W. Eaton <jwe@octave.org>
parents:
19550
diff
changeset
|
127 ret_audio = uint8NDArray (audio * 127 + 127); |
19496
0243b86b3cee
Added libsndfile based audio file utilities to the source tree
Vytautas Jančauskas <unaudio@gmail.com>
parents:
diff
changeset
|
128 else if (info.format & SF_FORMAT_PCM_16) |
19553
e616c2830413
various style fixes for audio code
John W. Eaton <jwe@octave.org>
parents:
19550
diff
changeset
|
129 ret_audio = int16NDArray (audio * 32767); |
19496
0243b86b3cee
Added libsndfile based audio file utilities to the source tree
Vytautas Jančauskas <unaudio@gmail.com>
parents:
diff
changeset
|
130 else if (info.format & SF_FORMAT_PCM_24) |
19553
e616c2830413
various style fixes for audio code
John W. Eaton <jwe@octave.org>
parents:
19550
diff
changeset
|
131 ret_audio = int32NDArray (audio * 8388608); |
19496
0243b86b3cee
Added libsndfile based audio file utilities to the source tree
Vytautas Jančauskas <unaudio@gmail.com>
parents:
diff
changeset
|
132 else if (info.format & SF_FORMAT_PCM_32) |
19553
e616c2830413
various style fixes for audio code
John W. Eaton <jwe@octave.org>
parents:
19550
diff
changeset
|
133 ret_audio = int32NDArray (audio * 2147483648); |
19496
0243b86b3cee
Added libsndfile based audio file utilities to the source tree
Vytautas Jančauskas <unaudio@gmail.com>
parents:
diff
changeset
|
134 else |
19553
e616c2830413
various style fixes for audio code
John W. Eaton <jwe@octave.org>
parents:
19550
diff
changeset
|
135 ret_audio = audio; |
19496
0243b86b3cee
Added libsndfile based audio file utilities to the source tree
Vytautas Jančauskas <unaudio@gmail.com>
parents:
diff
changeset
|
136 } |
0243b86b3cee
Added libsndfile based audio file utilities to the source tree
Vytautas Jančauskas <unaudio@gmail.com>
parents:
diff
changeset
|
137 else |
19553
e616c2830413
various style fixes for audio code
John W. Eaton <jwe@octave.org>
parents:
19550
diff
changeset
|
138 ret_audio = audio; |
19496
0243b86b3cee
Added libsndfile based audio file utilities to the source tree
Vytautas Jančauskas <unaudio@gmail.com>
parents:
diff
changeset
|
139 } |
0243b86b3cee
Added libsndfile based audio file utilities to the source tree
Vytautas Jančauskas <unaudio@gmail.com>
parents:
diff
changeset
|
140 else |
19553
e616c2830413
various style fixes for audio code
John W. Eaton <jwe@octave.org>
parents:
19550
diff
changeset
|
141 ret_audio = audio; |
19537
36a26a131209
Apply Octave coding style to audio project additions
Mike Miller <mtmiller@ieee.org>
parents:
19535
diff
changeset
|
142 |
19496
0243b86b3cee
Added libsndfile based audio file utilities to the source tree
Vytautas Jančauskas <unaudio@gmail.com>
parents:
diff
changeset
|
143 retval(1) = info.samplerate; |
19553
e616c2830413
various style fixes for audio code
John W. Eaton <jwe@octave.org>
parents:
19550
diff
changeset
|
144 retval(0) = ret_audio; |
e616c2830413
various style fixes for audio code
John W. Eaton <jwe@octave.org>
parents:
19550
diff
changeset
|
145 |
19502
9161b7653392
compile audio file utilities even when sndfile is not present
Vytautas Jančauskas <unaudio@gmail.com>
parents:
19497
diff
changeset
|
146 #else |
19553
e616c2830413
various style fixes for audio code
John W. Eaton <jwe@octave.org>
parents:
19550
diff
changeset
|
147 |
19537
36a26a131209
Apply Octave coding style to audio project additions
Mike Miller <mtmiller@ieee.org>
parents:
19535
diff
changeset
|
148 error ("sndfile not found on your system and thus audioread is not functional"); |
19553
e616c2830413
various style fixes for audio code
John W. Eaton <jwe@octave.org>
parents:
19550
diff
changeset
|
149 |
19502
9161b7653392
compile audio file utilities even when sndfile is not present
Vytautas Jančauskas <unaudio@gmail.com>
parents:
19497
diff
changeset
|
150 #endif |
19553
e616c2830413
various style fixes for audio code
John W. Eaton <jwe@octave.org>
parents:
19550
diff
changeset
|
151 |
e616c2830413
various style fixes for audio code
John W. Eaton <jwe@octave.org>
parents:
19550
diff
changeset
|
152 return retval; |
19496
0243b86b3cee
Added libsndfile based audio file utilities to the source tree
Vytautas Jančauskas <unaudio@gmail.com>
parents:
diff
changeset
|
153 } |
19544 | 154 |
155 #ifdef HAVE_SNDFILE | |
19560
7f271cef5850
protect all portaudio and sndfile dependent code with #ifdefs
John W. Eaton <jwe@octave.org>
parents:
19553
diff
changeset
|
156 |
19544 | 157 static void |
158 fill_extension_table (std::map<std::string, int> &table) | |
159 { | |
160 table["wav"] = SF_FORMAT_WAV; | |
161 table["aiff"] = SF_FORMAT_AIFF; | |
162 table["au"] = SF_FORMAT_AU; | |
163 table["raw"] = SF_FORMAT_RAW; | |
164 table["paf"] = SF_FORMAT_PAF; | |
165 table["svx"] = SF_FORMAT_SVX; | |
166 table["nist"] = SF_FORMAT_NIST; | |
167 table["voc"] = SF_FORMAT_VOC; | |
168 table["ircam"] = SF_FORMAT_IRCAM; | |
169 table["w64"] = SF_FORMAT_W64; | |
170 table["mat4"] = SF_FORMAT_MAT4; | |
171 table["mat5"] = SF_FORMAT_MAT5; | |
172 table["pvf"] = SF_FORMAT_PVF; | |
173 table["xi"] = SF_FORMAT_XI; | |
174 table["htk"] = SF_FORMAT_HTK; | |
175 table["sds"] = SF_FORMAT_SDS; | |
176 table["avr"] = SF_FORMAT_AVR; | |
177 table["wavex"] = SF_FORMAT_WAVEX; | |
178 table["sd2"] = SF_FORMAT_SD2; | |
179 table["flac"] = SF_FORMAT_FLAC; | |
180 table["caf"] = SF_FORMAT_CAF; | |
181 table["wve"] = SF_FORMAT_WVE; | |
182 table["ogg"] = SF_FORMAT_OGG; | |
183 table["mpc2k"] = SF_FORMAT_MPC2K; | |
184 table["rf64"] = SF_FORMAT_RF64; | |
185 } | |
19560
7f271cef5850
protect all portaudio and sndfile dependent code with #ifdefs
John W. Eaton <jwe@octave.org>
parents:
19553
diff
changeset
|
186 |
19544 | 187 #endif |
188 | |
189 DEFUN_DLD (audiowrite, args, , | |
190 "-*- texinfo -*-\n\ | |
191 @deftypefn {Loadable Function} {} audiowrite (@var{filename}, @var{y}, @var{fs})\n\ | |
19550
fc85d9026bb6
doc fixes for audio functions
John W. Eaton <jwe@octave.org>
parents:
19547
diff
changeset
|
192 @deftypefnx {Loadable Function} {} audiowrite (@var{filename}, @var{y}, @var{fs}, @var{name}, @var{value}, @dots{})\n\ |
19544 | 193 \n\ |
19550
fc85d9026bb6
doc fixes for audio functions
John W. Eaton <jwe@octave.org>
parents:
19547
diff
changeset
|
194 Write audio data from the matrix @var{y} to @var{filename} with the file\n\ |
fc85d9026bb6
doc fixes for audio functions
John W. Eaton <jwe@octave.org>
parents:
19547
diff
changeset
|
195 format determined by the file extension.\n\ |
19544 | 196 \n\ |
19550
fc85d9026bb6
doc fixes for audio functions
John W. Eaton <jwe@octave.org>
parents:
19547
diff
changeset
|
197 Additional name and value argument pairs may be used to specify the\n\ |
fc85d9026bb6
doc fixes for audio functions
John W. Eaton <jwe@octave.org>
parents:
19547
diff
changeset
|
198 following options:\n\ |
19544 | 199 \n\ |
200 @table @samp\n\ | |
201 @item BitsPerSample\n\ | |
202 Number of bits per sample, valid values are 8, 16, 24 and 32. Default is 16.\n\ | |
203 @item BitRate\n\ | |
19550
fc85d9026bb6
doc fixes for audio functions
John W. Eaton <jwe@octave.org>
parents:
19547
diff
changeset
|
204 Valid argument name, but ignored. Left for compatibility with @sc{matlab}.\n\ |
19544 | 205 @item Quality\n\ |
206 Quality setting for the Ogg Vorbis compressor. Values can range between 0 and 100 with 100 being the highest quality setting. Default is 75.\n\ | |
207 @item Title\n\ | |
208 Title for the audio file.\n\ | |
209 @item Artist\n\ | |
210 Artist name.\n\ | |
211 @item Comment\n\ | |
212 Comment.\n\ | |
213 @end table\n\ | |
214 @end deftypefn") | |
215 { | |
19553
e616c2830413
various style fixes for audio code
John W. Eaton <jwe@octave.org>
parents:
19550
diff
changeset
|
216 // FIXME: shouldn't we return something to indicate whether the file |
e616c2830413
various style fixes for audio code
John W. Eaton <jwe@octave.org>
parents:
19550
diff
changeset
|
217 // was written successfully? |
e616c2830413
various style fixes for audio code
John W. Eaton <jwe@octave.org>
parents:
19550
diff
changeset
|
218 |
e616c2830413
various style fixes for audio code
John W. Eaton <jwe@octave.org>
parents:
19550
diff
changeset
|
219 octave_value retval; |
e616c2830413
various style fixes for audio code
John W. Eaton <jwe@octave.org>
parents:
19550
diff
changeset
|
220 |
19544 | 221 #ifdef HAVE_SNDFILE |
19553
e616c2830413
various style fixes for audio code
John W. Eaton <jwe@octave.org>
parents:
19550
diff
changeset
|
222 |
e616c2830413
various style fixes for audio code
John W. Eaton <jwe@octave.org>
parents:
19550
diff
changeset
|
223 int nargin = args.length (); |
e616c2830413
various style fixes for audio code
John W. Eaton <jwe@octave.org>
parents:
19550
diff
changeset
|
224 |
e616c2830413
various style fixes for audio code
John W. Eaton <jwe@octave.org>
parents:
19550
diff
changeset
|
225 if (nargin < 3) |
e616c2830413
various style fixes for audio code
John W. Eaton <jwe@octave.org>
parents:
19550
diff
changeset
|
226 { |
e616c2830413
various style fixes for audio code
John W. Eaton <jwe@octave.org>
parents:
19550
diff
changeset
|
227 print_usage (); |
e616c2830413
various style fixes for audio code
John W. Eaton <jwe@octave.org>
parents:
19550
diff
changeset
|
228 return retval; |
e616c2830413
various style fixes for audio code
John W. Eaton <jwe@octave.org>
parents:
19550
diff
changeset
|
229 } |
e616c2830413
various style fixes for audio code
John W. Eaton <jwe@octave.org>
parents:
19550
diff
changeset
|
230 |
e616c2830413
various style fixes for audio code
John W. Eaton <jwe@octave.org>
parents:
19550
diff
changeset
|
231 std::string filename = args(0).string_value (); |
e616c2830413
various style fixes for audio code
John W. Eaton <jwe@octave.org>
parents:
19550
diff
changeset
|
232 |
e616c2830413
various style fixes for audio code
John W. Eaton <jwe@octave.org>
parents:
19550
diff
changeset
|
233 if (error_state) |
e616c2830413
various style fixes for audio code
John W. Eaton <jwe@octave.org>
parents:
19550
diff
changeset
|
234 return retval; |
e616c2830413
various style fixes for audio code
John W. Eaton <jwe@octave.org>
parents:
19550
diff
changeset
|
235 |
19544 | 236 std::map<std::string, int> extension_to_format; |
237 fill_extension_table (extension_to_format); | |
19553
e616c2830413
various style fixes for audio code
John W. Eaton <jwe@octave.org>
parents:
19550
diff
changeset
|
238 |
19544 | 239 std::string extension = filename.substr (filename.find_last_of (".") + 1); |
240 std::transform (extension.begin (), extension.end (), extension.begin (), ::tolower); | |
19553
e616c2830413
various style fixes for audio code
John W. Eaton <jwe@octave.org>
parents:
19550
diff
changeset
|
241 |
19544 | 242 Matrix audio = args(1).matrix_value (); |
19553
e616c2830413
various style fixes for audio code
John W. Eaton <jwe@octave.org>
parents:
19550
diff
changeset
|
243 |
e616c2830413
various style fixes for audio code
John W. Eaton <jwe@octave.org>
parents:
19550
diff
changeset
|
244 if (error_state) |
e616c2830413
various style fixes for audio code
John W. Eaton <jwe@octave.org>
parents:
19550
diff
changeset
|
245 return retval; |
e616c2830413
various style fixes for audio code
John W. Eaton <jwe@octave.org>
parents:
19550
diff
changeset
|
246 |
19544 | 247 SNDFILE *file; |
248 SF_INFO info; | |
19553
e616c2830413
various style fixes for audio code
John W. Eaton <jwe@octave.org>
parents:
19550
diff
changeset
|
249 |
19547
4cb4210bd392
use C++ style casts in audio code
John W. Eaton <jwe@octave.org>
parents:
19546
diff
changeset
|
250 OCTAVE_LOCAL_BUFFER (float, data, audio.rows () * audio.cols ()); |
4cb4210bd392
use C++ style casts in audio code
John W. Eaton <jwe@octave.org>
parents:
19546
diff
changeset
|
251 |
19578
827394ba8eb2
Backed out changeset 5f313345912f
John W. Eaton <jwe@octave.org>
parents:
19577
diff
changeset
|
252 for (int i = 0; i < audio.cols (); i++) |
19544 | 253 { |
19578
827394ba8eb2
Backed out changeset 5f313345912f
John W. Eaton <jwe@octave.org>
parents:
19577
diff
changeset
|
254 for (int j = 0; j < audio.rows (); j++) |
827394ba8eb2
Backed out changeset 5f313345912f
John W. Eaton <jwe@octave.org>
parents:
19577
diff
changeset
|
255 data[j * audio.cols () + i] = audio(j, i); |
19544 | 256 } |
257 | |
258 if (extension == "ogg") | |
259 info.format = SF_FORMAT_VORBIS; | |
260 else | |
261 info.format = SF_FORMAT_PCM_16; | |
262 | |
263 std::string title = ""; | |
264 std::string artist = ""; | |
265 std::string comment = ""; | |
19546
a5eb03a7e2a5
eliminate unused variable and parameter warnings
John W. Eaton <jwe@octave.org>
parents:
19545
diff
changeset
|
266 // Quality is currently unused? |
a5eb03a7e2a5
eliminate unused variable and parameter warnings
John W. Eaton <jwe@octave.org>
parents:
19545
diff
changeset
|
267 // |
a5eb03a7e2a5
eliminate unused variable and parameter warnings
John W. Eaton <jwe@octave.org>
parents:
19545
diff
changeset
|
268 // float quality = 0.75; |
19553
e616c2830413
various style fixes for audio code
John W. Eaton <jwe@octave.org>
parents:
19550
diff
changeset
|
269 for (int i = 3; i < nargin; i += 2) |
19544 | 270 { |
271 if (args(i).string_value () == "BitsPerSample") | |
272 { | |
273 int bits = args(i + 1).int_value (); | |
274 if (bits == 8) | |
275 info.format |= SF_FORMAT_PCM_S8; | |
276 else if (bits == 16) | |
277 info.format |= SF_FORMAT_PCM_16; | |
278 else if (bits == 24) | |
279 info.format |= SF_FORMAT_PCM_24; | |
280 else if (bits == 32) | |
281 info.format |= SF_FORMAT_PCM_32; | |
282 else | |
19553
e616c2830413
various style fixes for audio code
John W. Eaton <jwe@octave.org>
parents:
19550
diff
changeset
|
283 { |
e616c2830413
various style fixes for audio code
John W. Eaton <jwe@octave.org>
parents:
19550
diff
changeset
|
284 error ("audiowrite: wrong number of bits specified"); |
e616c2830413
various style fixes for audio code
John W. Eaton <jwe@octave.org>
parents:
19550
diff
changeset
|
285 return retval; |
e616c2830413
various style fixes for audio code
John W. Eaton <jwe@octave.org>
parents:
19550
diff
changeset
|
286 } |
19544 | 287 } |
288 else if (args(i).string_value () == "BitRate") | |
289 ; | |
19546
a5eb03a7e2a5
eliminate unused variable and parameter warnings
John W. Eaton <jwe@octave.org>
parents:
19545
diff
changeset
|
290 // Quality is currently unused? |
a5eb03a7e2a5
eliminate unused variable and parameter warnings
John W. Eaton <jwe@octave.org>
parents:
19545
diff
changeset
|
291 // |
a5eb03a7e2a5
eliminate unused variable and parameter warnings
John W. Eaton <jwe@octave.org>
parents:
19545
diff
changeset
|
292 // else if (args(i).string_value () == "Quality") |
a5eb03a7e2a5
eliminate unused variable and parameter warnings
John W. Eaton <jwe@octave.org>
parents:
19545
diff
changeset
|
293 // quality = args(i + 1).int_value () * 0.01; |
19544 | 294 else if (args(i).string_value () == "Title") |
295 title = args(i + 1).string_value (); | |
296 else if (args(i).string_value () == "Artist") | |
297 artist = args(i + 1).string_value (); | |
298 else if (args(i).string_value () == "Comment") | |
299 comment = args(i + 1).string_value (); | |
300 else | |
19553
e616c2830413
various style fixes for audio code
John W. Eaton <jwe@octave.org>
parents:
19550
diff
changeset
|
301 { |
e616c2830413
various style fixes for audio code
John W. Eaton <jwe@octave.org>
parents:
19550
diff
changeset
|
302 error ("audiowrite: wrong argument name"); |
e616c2830413
various style fixes for audio code
John W. Eaton <jwe@octave.org>
parents:
19550
diff
changeset
|
303 return retval; |
e616c2830413
various style fixes for audio code
John W. Eaton <jwe@octave.org>
parents:
19550
diff
changeset
|
304 } |
19544 | 305 } |
19553
e616c2830413
various style fixes for audio code
John W. Eaton <jwe@octave.org>
parents:
19550
diff
changeset
|
306 |
19544 | 307 info.samplerate = args(2).int_value (); |
308 info.channels = audio.cols (); | |
309 info.format |= extension_to_format[extension]; | |
19553
e616c2830413
various style fixes for audio code
John W. Eaton <jwe@octave.org>
parents:
19550
diff
changeset
|
310 |
19544 | 311 file = sf_open (filename.c_str (), SFM_WRITE, &info); |
19553
e616c2830413
various style fixes for audio code
John W. Eaton <jwe@octave.org>
parents:
19550
diff
changeset
|
312 |
19544 | 313 if (title != "") |
314 sf_set_string (file, SF_STR_TITLE, title.c_str ()); | |
19553
e616c2830413
various style fixes for audio code
John W. Eaton <jwe@octave.org>
parents:
19550
diff
changeset
|
315 |
19544 | 316 if (artist != "") |
317 sf_set_string (file, SF_STR_ARTIST, artist.c_str ()); | |
19553
e616c2830413
various style fixes for audio code
John W. Eaton <jwe@octave.org>
parents:
19550
diff
changeset
|
318 |
19544 | 319 if (comment != "") |
320 sf_set_string (file, SF_STR_COMMENT, comment.c_str ()); | |
19553
e616c2830413
various style fixes for audio code
John W. Eaton <jwe@octave.org>
parents:
19550
diff
changeset
|
321 |
19578
827394ba8eb2
Backed out changeset 5f313345912f
John W. Eaton <jwe@octave.org>
parents:
19577
diff
changeset
|
322 sf_write_float (file, data, audio.rows () * audio.cols ()); |
19544 | 323 sf_close (file); |
19553
e616c2830413
various style fixes for audio code
John W. Eaton <jwe@octave.org>
parents:
19550
diff
changeset
|
324 |
19544 | 325 #else |
19553
e616c2830413
various style fixes for audio code
John W. Eaton <jwe@octave.org>
parents:
19550
diff
changeset
|
326 |
19544 | 327 error ("sndfile not found on your system and thus audiowrite is not functional"); |
19553
e616c2830413
various style fixes for audio code
John W. Eaton <jwe@octave.org>
parents:
19550
diff
changeset
|
328 |
19544 | 329 #endif |
19553
e616c2830413
various style fixes for audio code
John W. Eaton <jwe@octave.org>
parents:
19550
diff
changeset
|
330 |
e616c2830413
various style fixes for audio code
John W. Eaton <jwe@octave.org>
parents:
19550
diff
changeset
|
331 return retval; |
19544 | 332 } |
333 | |
334 DEFUN_DLD (audioinfo, args, , | |
335 "-*- texinfo -*-\n\ | |
336 @deftypefn {Loadable Function} {@var{info} =} audioinfo (@var{filename})\n\ | |
337 Return information about an audio file specified by @var{filename}.\n\ | |
338 @end deftypefn") | |
339 { | |
19553
e616c2830413
various style fixes for audio code
John W. Eaton <jwe@octave.org>
parents:
19550
diff
changeset
|
340 octave_value retval; |
e616c2830413
various style fixes for audio code
John W. Eaton <jwe@octave.org>
parents:
19550
diff
changeset
|
341 |
19560
7f271cef5850
protect all portaudio and sndfile dependent code with #ifdefs
John W. Eaton <jwe@octave.org>
parents:
19553
diff
changeset
|
342 #ifdef HAVE_SNDFILE |
7f271cef5850
protect all portaudio and sndfile dependent code with #ifdefs
John W. Eaton <jwe@octave.org>
parents:
19553
diff
changeset
|
343 |
19553
e616c2830413
various style fixes for audio code
John W. Eaton <jwe@octave.org>
parents:
19550
diff
changeset
|
344 if (args.length () != 1) |
19544 | 345 { |
346 print_usage (); | |
19553
e616c2830413
various style fixes for audio code
John W. Eaton <jwe@octave.org>
parents:
19550
diff
changeset
|
347 return retval; |
19544 | 348 } |
19553
e616c2830413
various style fixes for audio code
John W. Eaton <jwe@octave.org>
parents:
19550
diff
changeset
|
349 |
19544 | 350 SF_INFO info; |
351 info.format = 0; | |
19553
e616c2830413
various style fixes for audio code
John W. Eaton <jwe@octave.org>
parents:
19550
diff
changeset
|
352 SNDFILE *file = sf_open (args(0).string_value ().c_str (), SFM_READ, &info); |
e616c2830413
various style fixes for audio code
John W. Eaton <jwe@octave.org>
parents:
19550
diff
changeset
|
353 |
e616c2830413
various style fixes for audio code
John W. Eaton <jwe@octave.org>
parents:
19550
diff
changeset
|
354 octave_scalar_map result; |
e616c2830413
various style fixes for audio code
John W. Eaton <jwe@octave.org>
parents:
19550
diff
changeset
|
355 |
e616c2830413
various style fixes for audio code
John W. Eaton <jwe@octave.org>
parents:
19550
diff
changeset
|
356 result.assign ("Filename", args(0).string_value ()); |
e616c2830413
various style fixes for audio code
John W. Eaton <jwe@octave.org>
parents:
19550
diff
changeset
|
357 result.assign ("CompressionMethod", ""); |
e616c2830413
various style fixes for audio code
John W. Eaton <jwe@octave.org>
parents:
19550
diff
changeset
|
358 result.assign ("NumChannels", info.channels); |
e616c2830413
various style fixes for audio code
John W. Eaton <jwe@octave.org>
parents:
19550
diff
changeset
|
359 result.assign ("SampleRate", info.samplerate); |
e616c2830413
various style fixes for audio code
John W. Eaton <jwe@octave.org>
parents:
19550
diff
changeset
|
360 result.assign ("TotalSamples", info.frames); |
e616c2830413
various style fixes for audio code
John W. Eaton <jwe@octave.org>
parents:
19550
diff
changeset
|
361 |
19547
4cb4210bd392
use C++ style casts in audio code
John W. Eaton <jwe@octave.org>
parents:
19546
diff
changeset
|
362 double dframes = info.frames; |
4cb4210bd392
use C++ style casts in audio code
John W. Eaton <jwe@octave.org>
parents:
19546
diff
changeset
|
363 double drate = info.samplerate; |
19553
e616c2830413
various style fixes for audio code
John W. Eaton <jwe@octave.org>
parents:
19550
diff
changeset
|
364 result.assign ("Duration", dframes / drate); |
19544 | 365 |
366 int bits; | |
367 if (info.format & SF_FORMAT_PCM_S8) | |
368 bits = 8; | |
369 else if (info.format & SF_FORMAT_PCM_U8) | |
370 bits = 8; | |
371 else if (info.format & SF_FORMAT_PCM_16) | |
372 bits = 16; | |
373 else if (info.format & SF_FORMAT_PCM_24) | |
374 bits = 24; | |
375 else if (info.format & SF_FORMAT_PCM_32) | |
376 bits = 32; | |
377 else | |
378 bits = -1; | |
379 | |
19553
e616c2830413
various style fixes for audio code
John W. Eaton <jwe@octave.org>
parents:
19550
diff
changeset
|
380 result.assign ("BitsPerSample", bits); |
e616c2830413
various style fixes for audio code
John W. Eaton <jwe@octave.org>
parents:
19550
diff
changeset
|
381 result.assign ("BitRate", -1); |
e616c2830413
various style fixes for audio code
John W. Eaton <jwe@octave.org>
parents:
19550
diff
changeset
|
382 result.assign ("Title", sf_get_string (file, SF_STR_TITLE)); |
e616c2830413
various style fixes for audio code
John W. Eaton <jwe@octave.org>
parents:
19550
diff
changeset
|
383 result.assign ("Artist", sf_get_string (file, SF_STR_ARTIST)); |
e616c2830413
various style fixes for audio code
John W. Eaton <jwe@octave.org>
parents:
19550
diff
changeset
|
384 result.assign ("Comment", sf_get_string (file, SF_STR_COMMENT)); |
e616c2830413
various style fixes for audio code
John W. Eaton <jwe@octave.org>
parents:
19550
diff
changeset
|
385 |
e616c2830413
various style fixes for audio code
John W. Eaton <jwe@octave.org>
parents:
19550
diff
changeset
|
386 retval = result; |
e616c2830413
various style fixes for audio code
John W. Eaton <jwe@octave.org>
parents:
19550
diff
changeset
|
387 |
19544 | 388 #else |
19553
e616c2830413
various style fixes for audio code
John W. Eaton <jwe@octave.org>
parents:
19550
diff
changeset
|
389 |
19544 | 390 error ("sndfile not found on your system and thus audioinfo is not functional"); |
19553
e616c2830413
various style fixes for audio code
John W. Eaton <jwe@octave.org>
parents:
19550
diff
changeset
|
391 |
19544 | 392 #endif |
19553
e616c2830413
various style fixes for audio code
John W. Eaton <jwe@octave.org>
parents:
19550
diff
changeset
|
393 |
e616c2830413
various style fixes for audio code
John W. Eaton <jwe@octave.org>
parents:
19550
diff
changeset
|
394 return retval; |
19544 | 395 } |