| 212 | } |
| 213 | |
| 214 | bool AudioClip::ExtractDataRaw(Array<byte>& resultData, AudioDataInfo& resultDataInfo) |
| 215 | { |
| 216 | if (WaitForLoaded()) |
| 217 | return true; |
| 218 | ScopeLock lock(Locker); |
| 219 | switch (Format()) |
| 220 | { |
| 221 | case AudioFormat::Raw: |
| 222 | { |
| 223 | return ExtractData(resultData, resultDataInfo); |
| 224 | } |
| 225 | case AudioFormat::Vorbis: |
| 226 | { |
| 227 | #if COMPILE_WITH_OGG_VORBIS |
| 228 | Array<byte> vorbisData; |
| 229 | AudioDataInfo vorbisDataInfo; |
| 230 | if (ExtractData(vorbisData, vorbisDataInfo)) |
| 231 | return true; |
| 232 | |
| 233 | OggVorbisDecoder decoder; |
| 234 | MemoryReadStream stream(vorbisData.Get(), vorbisData.Count()); |
| 235 | return decoder.Convert(&stream, resultDataInfo, resultData); |
| 236 | #else |
| 237 | LOG(Warning, "OggVorbisDecoder is disabled."); |
| 238 | return true; |
| 239 | #endif |
| 240 | } |
| 241 | } |
| 242 | |
| 243 | return true; |
| 244 | } |
| 245 | |
| 246 | void AudioClip::CancelStreaming() |
| 247 | { |
no test coverage detected