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