| 252 | } |
| 253 | |
| 254 | float SoundSystemOAL::GetWaveDuration(const char* filename) |
| 255 | { |
| 256 | // SoundLoadFile dispatches by extension (.ogg/.wav, else .wss); WSSLoadFile alone returned |
| 257 | // null for .ogg, so any OGG duration query (speech/dialog clips, soundLength) read as 0. |
| 258 | WaveStream* s = SoundLoadFile(filename); |
| 259 | if (!s) |
| 260 | return 0.f; |
| 261 | WAVEFORMATEX fmt; |
| 262 | s->GetFormat(fmt); |
| 263 | float dur = fmt.nAvgBytesPerSec > 0 |
| 264 | ? static_cast<float>(s->GetUncompressedSize()) / static_cast<float>(fmt.nAvgBytesPerSec) |
| 265 | : 0.f; |
| 266 | s->Release(); |
| 267 | return dur; |
| 268 | } |
| 269 | |
| 270 | IWave* SoundSystemOAL::CreateEmptyWave(float duration) |
| 271 | { |
nothing calls this directly
no test coverage detected