| 134 | } |
| 135 | |
| 136 | void StartVoice(char *filename, int flags) { |
| 137 | #ifdef DEMO |
| 138 | return; |
| 139 | #endif |
| 140 | if ((!PlayVoices) && (!(flags & VF_FORCE))) |
| 141 | return; |
| 142 | |
| 143 | if (flags & VF_PLAYTABLE) { |
| 144 | CurrentVoiceHandle.flags = flags; |
| 145 | CurrentVoiceHandle.inuse = true; |
| 146 | CurrentVoiceHandle.chandle = -1; |
| 147 | int index = FindSoundName(IGNORE_TABLE(filename)); |
| 148 | CurrentVoiceHandle.handle = Sound_system.Play2dSound(index); |
| 149 | return; |
| 150 | } |
| 151 | |
| 152 | bool compressed = (flags & VF_COMPRESSED) ? true : false; |
| 153 | bool bit8 = (flags & VF_8BIT) ? true : false; |
| 154 | bool stereo = (flags & VF_STEREO) ? true : false; |
| 155 | |
| 156 | int vf = 0; |
| 157 | |
| 158 | // if(bit8){ |
| 159 | // if(stereo) |
| 160 | // vf = SAF_8BIT_S; |
| 161 | // else |
| 162 | // vf = SAF_8BIT_M; |
| 163 | // }else{ |
| 164 | // if(stereo) |
| 165 | // vf = SAF_16BIT_S; |
| 166 | // else |
| 167 | // vf = SAF_16BIT_M; |
| 168 | // } |
| 169 | // if(compressed) |
| 170 | // vf |= SAF_COMPRESSED; |
| 171 | |
| 172 | CurrentVoiceHandle.chandle = StreamPlay(filename, (MAX_GAME_VOLUME / 2.0), vf); |
| 173 | if (CurrentVoiceHandle.chandle != -1) |
| 174 | CurrentVoiceHandle.handle = StreamGetSoundHandle(CurrentVoiceHandle.chandle); |
| 175 | |
| 176 | CurrentVoiceHandle.flags = flags; |
| 177 | CurrentVoiceHandle.inuse = true; |
| 178 | } |
| 179 | |
| 180 | void StopVoice(void) { |
| 181 | if (CurrentVoiceHandle.inuse) { |
no test coverage detected