]> icculus.org git repositories - taylor/freespace2.git/blob - include/rtvoice.h
fix issue with looping audio streams
[taylor/freespace2.git] / include / rtvoice.h
1 /*
2  * Copyright (C) Volition, Inc. 1999.  All rights reserved.
3  *
4  * All source code herein is the property of Volition, Inc. You may not sell 
5  * or otherwise commercially exploit the source or things you created based on
6  * the source.
7  */
8
9 /*
10  * $Logfile: /Freespace2/code/Sound/rtvoice.h $
11  * $Revision$
12  * $Date$
13  * $Author$
14  *
15  * Header file for real-time voice code
16  *
17  * $Log$
18  * Revision 1.2  2002/06/09 04:41:14  relnev
19  * added copyright header
20  *
21  * Revision 1.1.1.1  2002/05/03 03:28:12  root
22  * Initial import.
23  *
24  * 
25  * 2     10/07/98 10:54a Dave
26  * Initial checkin.
27  * 
28  * 1     10/07/98 10:51a Dave
29  * 
30  * 12    4/21/98 4:44p Dave
31  * Implement Vasudan ships in multiplayer. Added a debug function to bash
32  * player rank. Fixed a few rtvoice buffer overrun problems. Fixed ui
33  * problem in options screen. 
34  * 
35  * 11    4/17/98 5:27p Dave
36  * More work on the multi options screen. Fixed many minor ui todo bugs.
37  * 
38  * 10    3/25/98 9:56a Dave
39  * Increase buffer size to handle 8 seconds of voice data.
40  * 
41  * 9     3/22/98 7:13p Lawrance
42  * Get streaming of recording voice working
43  * 
44  * 8     2/24/98 11:56p Lawrance
45  * Change real-time voice code to provide the uncompressed size on decode.
46  * 
47  * 7     2/24/98 10:13p Dave
48  * Put in initial support for multiplayer voice streaming.
49  * 
50  * 6     2/23/98 6:54p Lawrance
51  * Make interface to real-time voice more generic and useful.
52  * 
53  * 5     2/16/98 7:31p Lawrance
54  * get compression/decompression of voice working
55  * 
56  * 4     2/15/98 4:43p Lawrance
57  * work on real-time voice
58  * 
59  * 3     2/03/98 11:53p Lawrance
60  * Adding support for DirectSoundCapture
61  * 
62  * 2     1/31/98 5:48p Lawrance
63  * Start on real-time voice recording
64  *
65  * $NoKeywords: $
66  */
67
68 #ifndef __RTVOICE_H__
69 #define __RTVOICE_H__
70
71 // general
72 void  rtvoice_set_qos(int qos);
73
74 // recording
75 int     rtvoice_init_recording(int qos);
76 void    rtvoice_close_recording();
77 int     rtvoice_start_recording( void (*user_callback)() = NULL, int callback_time = 175 );
78 void    rtvoice_stop_recording();
79 void    rtvoice_get_data(unsigned char **outbuf, int *compressed_size, int *uncompressed_size, double *gain, unsigned char **outbuf_raw = NULL, int *outbuf_size_raw = NULL);
80
81 // playback
82 int     rtvoice_init_playback();
83 void    rtvoice_close_playback();
84 int     rtvoice_get_decode_buffer_size();
85
86 int     rtvoice_create_playback_buffer();
87 void    rtvoice_free_playback_buffer(int index);
88
89 void    rtvoice_uncompress(unsigned char *data_in, int size_in, double gain, unsigned char *data_out, int size_out);
90
91 // return a sound handle, _NOT_ a buffer handle
92 int     rtvoice_play_compressed(int handle, unsigned char *data, int compressed_size, int uncompressed_size, double gain);
93 int     rtvoice_play_uncompressed(int handle, unsigned char *data, int size);
94
95 // pass in buffer handle returned from rtvoice_create_playback_buffer(), kills the _sound_ only
96 void    rtvoice_stop_playback(int handle);
97 void    rtvoice_stop_playback_all();
98
99 #endif
100