1
/* Copyright (C) 2002, 2003 Vincent Penquerc'h.
2
This file is part of the alogg library.
3
Written by Vincent Penquerc'h <lyrian -at- kezako -dot- net>.
5
The alogg library is free software; you can redistribute it and/or
6
modify it under the terms of the GNU Lesser General Public
7
License as published by the Free Software Foundation; either
8
version 2.1 of the License, or (at your option) any later version.
10
The alogg library is distributed in the hope that it will be useful,
11
but WITHOUT ANY WARRANTY; without even the implied warranty of
12
MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU
13
Lesser General Public License for more details.
15
You should have received a copy of the GNU Lesser General Public
16
License along with the alogg Library; if not, write to the Free
17
Software Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA
20
As a special exception, if you link this library statically with a
21
program, you do not have to distribute the object files for this
23
This exception does not however invalidate any other reasons why
24
you would have to distribute the object files for this program. */
33
#define ALOGG_MAKE_VERSION(x,y,z) (((x)*10000)+((y)*100)+(z))
34
#define ALOGG_VERSION ALOGG_MAKE_VERSION(ALOGG_MAJOR,ALOGG_MINOR,ALOGG_PATCH)
35
#define ALOGG_ID "alogg 1.3.3"
37
#define DAT_OGG_VORBIS DAT_ID('O','G','G','V')
47
struct OggVorbis_File;
51
struct alogg_encoding_data;
53
extern int alogg_error_code;
62
/* Integration with Allegro's SAMPLE management */
63
struct SAMPLE *alogg_load_ogg(AL_CONST char *filename);
64
struct SAMPLE *alogg_create_sample(struct DATAFILE *dat);
66
#ifndef ALOGG_USE_TREMOR
67
int alogg_save_ogg_param(
68
AL_CONST char *filename,struct SAMPLE *sample,float quality,
69
size_t ncomments,char **comments
71
int alogg_save_ogg(AL_CONST char *filename,struct SAMPLE *sample);
74
/* Streaming support */
75
struct alogg_stream *alogg_start_streaming(
76
AL_CONST char *filename,size_t block_size
78
struct alogg_stream *alogg_start_streaming_datafile(
79
AL_CONST struct DATAFILE *dat,size_t block_size
81
struct alogg_stream *alogg_start_streaming_callbacks(
82
void *datasource,struct ov_callbacks *callbacks,size_t block_size,
83
int (*update)(struct alogg_stream*,void*)
85
int alogg_read_stream_data(struct alogg_stream*,void *buffer,size_t size);
86
int alogg_update_streaming(struct alogg_stream*);
87
int alogg_stop_streaming(struct alogg_stream*);
88
struct AUDIOSTREAM *alogg_get_audio_stream(struct alogg_stream*);
89
struct OggVorbis_File *alogg_get_vorbis_file(struct alogg_stream*);
91
#ifndef ALOGG_USE_TREMOR
94
struct alogg_encoding_data *alogg_start_encoding(
95
size_t channels,size_t freq,float quality,size_t ncomments,char **comments,
96
void (*write)(void*,size_t,unsigned long),unsigned long write_data
98
int alogg_update_encoding(
99
struct alogg_encoding_data*,AL_CONST void *buffer,
100
size_t num_samples,size_t channels,size_t bits
102
int alogg_stop_encoding(struct alogg_encoding_data*);