diff options
author | Lennart Poettering <lennart@poettering.net> | 2008-05-23 15:58:32 +0000 |
---|---|---|
committer | Lennart Poettering <lennart@poettering.net> | 2008-05-23 15:58:32 +0000 |
commit | 3f00b1697f7304bb565232f5378ec38a23e12649 (patch) | |
tree | 18678affac93691c733eede17b99f1bf0ce39793 /read-sound-file.h | |
parent | 1559476e75534b4b4896a9fdb08f78af0ad7882e (diff) |
add wav/ogg reader, rework API
git-svn-id: file:///home/lennart/svn/public/libcanberra/trunk@6 01b60673-d06a-42c0-afdd-89cb8e0f78ac
Diffstat (limited to 'read-sound-file.h')
-rw-r--r-- | read-sound-file.h | 44 |
1 files changed, 44 insertions, 0 deletions
diff --git a/read-sound-file.h b/read-sound-file.h new file mode 100644 index 0000000..8dcc1e0 --- /dev/null +++ b/read-sound-file.h @@ -0,0 +1,44 @@ +#ifndef foocareadsoundfilehfoo +#define foocareadsoundfilehfoo + +/* $Id$ */ + +/*** + This file is part of libcanberra. + + Copyright 2008 Lennart Poettering + + libcanberra is free software; you can redistribute it and/or modify + it under the terms of the GNU Lesser General Public License as + published by the Free Software Foundation, either version 2.1 of the + License, or (at your option) any later version. + + libcanberra is distributed in the hope that it will be useful, but + WITHOUT ANY WARRANTY; without even the implied warranty of + MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU + Lesser General Public License for more details. + + You should have received a copy of the GNU Lesser General Public + License along with libcanberra. If not, If not, see + <http://www.gnu.org/licenses/>. +***/ + +typedef enum ca_sample_type { + CA_SAMPLE_S16NE, + CA_SAMPLE_S16RE, + CA_SAMPLE_U8 +} ca_sample_type_t; + +typedef struct ca_sound_file wa_sound_file; + +int ca_sound_file_open(ca_sound_file *f, const char *fn); +void ca_sound_file_close(ca_sound_file *f); + +unsigned ca_sound_file_get_nchannels(ca_sound_file *f); +unsigned ca_sound_file_get_rate(ca_sound_file *f); +ca_sample_type_t ca_sound_file_get_sample_type(ca_sound_file *f); + +int ca_sound_file_read_int16(ca_sound_file *f, int16_t *d, unsigned *n); +int ca_sound_file_read_uint8(ca_sound_file *f, uint8_t *d, unsigned *n); + +#endif |