DI-Guy SDK Documentation  13.1
diguySound.h
Go to the documentation of this file.
1 
2 /*********************************************************************
3  ** Copyright (c) 1992-2015 VT MAK
4  ** All rights reserved.
5  *********************************************************************/
6 
7 
8 /*********************************************************************
9  **
10  *t diguySound
11  **
12  */
13 
14 #ifndef __diguySound_H
15 #define __diguySound_H
16 
17 
18 #ifdef SWIG
19 %module diguySound
20 #else
21 #define CPLUSPLUS_ONLY
22 #endif
23 
24 #ifdef CPLUSPLUS_ONLY
25 class bdiSound;
26 #endif
27 
28 
29 #include <declspec_diguy.h>
30 
31 /****************************************************************************/
43 class BDI_DECLSPEC_diguy diguySound
44 {
45 
46 public:
47 
48  /*l
49  **
50  *b Returns:
51  **
52  ** name of this object
53  */
54  const char* get_name();
55 
56  /*l
57  *b Returns:
58  **
59  ** type name of the object; this value will never be NULL
60  */
61  const char* get_type_name();
62 
63  /*l
64  *b Description:
65  **
66  ** This function sets the name of the file that contains the waveform
67  ** data for the sound. The file should typically be located in the
68  ** $(DIGUY)/sfx or $(DIGUY)/custom/sfx directory.
69  **
70  *b Arguments:
71  **
72  *a sound_filename - name of file containing waveform data
73  **
74  *b Returns:
75  **
76  ** 0 on success, -1 on failure
77  */
78  int set_sound_filename(const char* sound_filename);
79 
80  /*l
81  *b Returns:
82  **
83  ** name of file containing waveform data for sound as set by
84  ** set_sound_filename(); will never be NULL, but may be the empty
85  ** string ""
86  */
87  const char* get_sound_filename();
88 
89  /*l
90  *b Returns:
91  **
92  ** the length of the sound in seconds
93  */
94  float get_duration();
95 
96  /*l
97  *b Returns:
98  **
99  ** the number of samples per second
100  */
101  int get_samples_per_second();
102 
103  /*l
104  *b Returns:
105  **
106  ** the number of sound channels either 1 (mono) or 2 (stereo)
107  */
108  int get_number_of_channels();
109 
110  /*l
111  *b Returns:
112  **
113  ** the bit depth of a sound, either 8 or 16
114  */
115  int get_bit_depth();
116 
121 #ifdef CPLUSPLUS_ONLY
122 
123  bdiSound* get_scripted_object() {return m_scripted_object;}
124 
125  /*l
126  *b Deprecated as of DI-Guy 13
127  */
128  int set_phoneme_filename(const char* phoneme_filename);
129 
130  /*l
131  *b Deprecated as of DI-Guy 13
132  */
133  const char* get_phoneme_filename();
134 
135 private:
136 
137  friend class bdiSound;
138 
139  /*l
140  ** A private constructor.
141  */
142  diguySound(bdiSound* scripted_object);
143 
144  /*l
145  ** A private destructor.
146  */
147  virtual ~diguySound();
148 
149  /*l
150  ** A pointer to internal data.
151  */
152  bdiSound* m_scripted_object;
153 
154 #endif
155 
156 };
157 
158 
159 #endif /* __diguySound_H */
160 
161 
162 /*********************************************************************
163  ** Copyright (c) 1992-2015 VT MAK
164  ** All rights reserved.
165  *********************************************************************/
166 
This class is represents a sound file on disk.
Definition: diguySound.h:39