[96fb8ad] | 1 | /* |
---|
[6a2478c] | 2 | Copyright (C) 2003-2009 Paul Brossier <piem@aubio.org> |
---|
[96fb8ad] | 3 | |
---|
[6a2478c] | 4 | This file is part of aubio. |
---|
[96fb8ad] | 5 | |
---|
[6a2478c] | 6 | aubio is free software: you can redistribute it and/or modify |
---|
| 7 | it under the terms of the GNU General Public License as published by |
---|
| 8 | the Free Software Foundation, either version 3 of the License, or |
---|
| 9 | (at your option) any later version. |
---|
| 10 | |
---|
| 11 | aubio is distributed in the hope that it will be useful, |
---|
| 12 | but WITHOUT ANY WARRANTY; without even the implied warranty of |
---|
| 13 | MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the |
---|
| 14 | GNU General Public License for more details. |
---|
| 15 | |
---|
| 16 | You should have received a copy of the GNU General Public License |
---|
| 17 | along with aubio. If not, see <http://www.gnu.org/licenses/>. |
---|
[96fb8ad] | 18 | |
---|
| 19 | */ |
---|
| 20 | |
---|
| 21 | #ifndef SNDFILEIO_H |
---|
| 22 | #define SNDFILEIO_H |
---|
| 23 | |
---|
| 24 | /** @file |
---|
| 25 | * sndfile functions |
---|
| 26 | */ |
---|
| 27 | |
---|
| 28 | #ifdef __cplusplus |
---|
| 29 | extern "C" { |
---|
| 30 | #endif |
---|
| 31 | |
---|
| 32 | /** |
---|
| 33 | * sndfile object |
---|
| 34 | */ |
---|
[5e9c68a] | 35 | typedef struct _aubio_sndfile_t aubio_sndfile_t; |
---|
[96fb8ad] | 36 | /** |
---|
| 37 | * Open a sound file for reading |
---|
| 38 | */ |
---|
[5e9c68a] | 39 | aubio_sndfile_t * new_aubio_sndfile_ro (const char * inputfile); |
---|
[96fb8ad] | 40 | /** |
---|
| 41 | * Copy file model from previously opened sound file. |
---|
| 42 | */ |
---|
[5e9c68a] | 43 | aubio_sndfile_t * new_aubio_sndfile_wo(aubio_sndfile_t * existingfile, const char * outputname); |
---|
[96fb8ad] | 44 | /** |
---|
| 45 | * Open a sound file for writing |
---|
| 46 | */ |
---|
[5e9c68a] | 47 | int aubio_sndfile_open_wo (aubio_sndfile_t * file, const char * outputname); |
---|
[96fb8ad] | 48 | /** |
---|
[fff7b92] | 49 | * Read frames data from file into an array of buffers |
---|
[96fb8ad] | 50 | */ |
---|
[4621cd6] | 51 | int aubio_sndfile_read(aubio_sndfile_t * file, int frames, fvec_t ** read); |
---|
[96fb8ad] | 52 | /** |
---|
[fff7b92] | 53 | * Read frames data from file into a single buffer |
---|
| 54 | */ |
---|
| 55 | int aubio_sndfile_read_mono (aubio_sndfile_t * f, int frames, fvec_t * read); |
---|
| 56 | /** |
---|
[96fb8ad] | 57 | * Write data of length frames to file |
---|
| 58 | */ |
---|
[4621cd6] | 59 | int aubio_sndfile_write(aubio_sndfile_t * file, int frames, fvec_t ** write); |
---|
[96fb8ad] | 60 | /** |
---|
| 61 | * Close file and delete file object |
---|
| 62 | */ |
---|
[5e9c68a] | 63 | int del_aubio_sndfile(aubio_sndfile_t * file); |
---|
[96fb8ad] | 64 | /** |
---|
| 65 | * Return some files facts |
---|
| 66 | */ |
---|
[5e9c68a] | 67 | void aubio_sndfile_info(aubio_sndfile_t * file); |
---|
[96fb8ad] | 68 | /** |
---|
| 69 | * Return number of channel in file |
---|
| 70 | */ |
---|
[5e9c68a] | 71 | uint_t aubio_sndfile_channels(aubio_sndfile_t * file); |
---|
| 72 | uint_t aubio_sndfile_samplerate(aubio_sndfile_t * file); |
---|
[96fb8ad] | 73 | |
---|
| 74 | #ifdef __cplusplus |
---|
| 75 | } |
---|
| 76 | #endif |
---|
| 77 | |
---|
| 78 | #endif |
---|
| 79 | |
---|