Blame src/read-sound-file.h

Packit 3ae693
/*-*- Mode: C; c-basic-offset: 8 -*-*/
Packit 3ae693
Packit 3ae693
#ifndef foocanberrareadsoundfilehfoo
Packit 3ae693
#define foocanberrareadsoundfilehfoo
Packit 3ae693
Packit 3ae693
/***
Packit 3ae693
  This file is part of libcanberra.
Packit 3ae693
Packit 3ae693
  Copyright 2008 Lennart Poettering
Packit 3ae693
Packit 3ae693
  libcanberra is free software; you can redistribute it and/or modify
Packit 3ae693
  it under the terms of the GNU Lesser General Public License as
Packit 3ae693
  published by the Free Software Foundation, either version 2.1 of the
Packit 3ae693
  License, or (at your option) any later version.
Packit 3ae693
Packit 3ae693
  libcanberra is distributed in the hope that it will be useful, but
Packit 3ae693
  WITHOUT ANY WARRANTY; without even the implied warranty of
Packit 3ae693
  MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU
Packit 3ae693
  Lesser General Public License for more details.
Packit 3ae693
Packit 3ae693
  You should have received a copy of the GNU Lesser General Public
Packit 3ae693
  License along with libcanberra. If not, see
Packit 3ae693
  <http://www.gnu.org/licenses/>.
Packit 3ae693
***/
Packit 3ae693
Packit 3ae693
#include <sys/types.h>
Packit 3ae693
#include <inttypes.h>
Packit 3ae693
Packit 3ae693
typedef enum ca_sample_type {
Packit 3ae693
        CA_SAMPLE_S16NE,
Packit 3ae693
        CA_SAMPLE_S16RE,
Packit 3ae693
        CA_SAMPLE_U8
Packit 3ae693
} ca_sample_type_t;
Packit 3ae693
Packit 3ae693
typedef enum ca_channel_position {
Packit 3ae693
        CA_CHANNEL_MONO,
Packit 3ae693
        CA_CHANNEL_FRONT_LEFT,
Packit 3ae693
        CA_CHANNEL_FRONT_RIGHT,
Packit 3ae693
        CA_CHANNEL_FRONT_CENTER,
Packit 3ae693
        CA_CHANNEL_REAR_LEFT,
Packit 3ae693
        CA_CHANNEL_REAR_RIGHT,
Packit 3ae693
        CA_CHANNEL_REAR_CENTER,
Packit 3ae693
        CA_CHANNEL_LFE,
Packit 3ae693
        CA_CHANNEL_FRONT_LEFT_OF_CENTER,
Packit 3ae693
        CA_CHANNEL_FRONT_RIGHT_OF_CENTER,
Packit 3ae693
        CA_CHANNEL_SIDE_LEFT,
Packit 3ae693
        CA_CHANNEL_SIDE_RIGHT,
Packit 3ae693
        CA_CHANNEL_TOP_CENTER,
Packit 3ae693
        CA_CHANNEL_TOP_FRONT_LEFT,
Packit 3ae693
        CA_CHANNEL_TOP_FRONT_RIGHT,
Packit 3ae693
        CA_CHANNEL_TOP_FRONT_CENTER,
Packit 3ae693
        CA_CHANNEL_TOP_REAR_LEFT,
Packit 3ae693
        CA_CHANNEL_TOP_REAR_RIGHT,
Packit 3ae693
        CA_CHANNEL_TOP_REAR_CENTER,
Packit 3ae693
        _CA_CHANNEL_POSITION_MAX
Packit 3ae693
} ca_channel_position_t;
Packit 3ae693
Packit 3ae693
typedef struct ca_sound_file ca_sound_file;
Packit 3ae693
Packit 3ae693
int ca_sound_file_open(ca_sound_file **f, const char *fn);
Packit 3ae693
void ca_sound_file_close(ca_sound_file *f);
Packit 3ae693
Packit 3ae693
unsigned ca_sound_file_get_nchannels(ca_sound_file *f);
Packit 3ae693
unsigned ca_sound_file_get_rate(ca_sound_file *f);
Packit 3ae693
ca_sample_type_t ca_sound_file_get_sample_type(ca_sound_file *f);
Packit 3ae693
const ca_channel_position_t* ca_sound_file_get_channel_map(ca_sound_file *f);
Packit 3ae693
Packit 3ae693
off_t ca_sound_file_get_size(ca_sound_file *f);
Packit 3ae693
Packit 3ae693
int ca_sound_file_read_int16(ca_sound_file *f, int16_t *d, size_t *n);
Packit 3ae693
int ca_sound_file_read_uint8(ca_sound_file *f, uint8_t *d, size_t *n);
Packit 3ae693
Packit 3ae693
int ca_sound_file_read_arbitrary(ca_sound_file *f, void *d, size_t *n);
Packit 3ae693
Packit 3ae693
size_t ca_sound_file_frame_size(ca_sound_file *f);
Packit 3ae693
Packit 3ae693
#endif