00001
00002
00003
00004
00005
00006
00007
00008
00009
00010
00011
00012
00013
00014
00015
00016
00017
00018
00019
00020
00021 #ifndef __GUAC_AUDIO_H
00022 #define __GUAC_AUDIO_H
00023
00030 #include "audio-fntypes.h"
00031 #include "audio-types.h"
00032 #include "client-types.h"
00033 #include "stream-types.h"
00034
00035 struct guac_audio_encoder {
00036
00041 const char* mimetype;
00042
00046 guac_audio_encoder_begin_handler* begin_handler;
00047
00052 guac_audio_encoder_write_handler* write_handler;
00053
00057 guac_audio_encoder_flush_handler* flush_handler;
00058
00062 guac_audio_encoder_end_handler* end_handler;
00063
00068 guac_audio_encoder_join_handler* join_handler;
00069
00070 };
00071
00072 struct guac_audio_stream {
00073
00077 guac_audio_encoder* encoder;
00078
00082 guac_client* client;
00083
00087 guac_stream* stream;
00088
00092 int rate;
00093
00098 int channels;
00099
00104 int bps;
00105
00109 void* data;
00110
00111 };
00112
00154 guac_audio_stream* guac_audio_stream_alloc(guac_client* client,
00155 guac_audio_encoder* encoder, int rate, int channels, int bps);
00156
00182 void guac_audio_stream_reset(guac_audio_stream* audio,
00183 guac_audio_encoder* encoder, int rate, int channels, int bps);
00184
00198 void guac_audio_stream_add_user(guac_audio_stream* audio, guac_user* user);
00199
00206 void guac_audio_stream_free(guac_audio_stream* stream);
00207
00222 void guac_audio_stream_write_pcm(guac_audio_stream* stream,
00223 const unsigned char* data, int length);
00224
00233 void guac_audio_stream_flush(guac_audio_stream* stream);
00234
00235 #endif
00236