| 420 | } |
| 421 | |
| 422 | result WavStream::loadogg(File * fp) |
| 423 | { |
| 424 | fp->seek(0); |
| 425 | int e; |
| 426 | stb_vorbis *v; |
| 427 | v = stb_vorbis_open_file((Soloud_Filehack *)fp, 0, &e, 0); |
| 428 | if (v == NULL) |
| 429 | return FILE_LOAD_FAILED; |
| 430 | stb_vorbis_info info = stb_vorbis_get_info(v); |
| 431 | mChannels = info.channels; |
| 432 | if (info.channels > MAX_CHANNELS) |
| 433 | { |
| 434 | mChannels = MAX_CHANNELS; |
| 435 | } |
| 436 | mBaseSamplerate = (float)info.sample_rate; |
| 437 | int samples = stb_vorbis_stream_length_in_samples(v); |
| 438 | stb_vorbis_close(v); |
| 439 | mFiletype = WAVSTREAM_OGG; |
| 440 | |
| 441 | mSampleCount = samples; |
| 442 | |
| 443 | return 0; |
| 444 | } |
| 445 | |
| 446 | result WavStream::loadflac(File * fp) |
| 447 | { |
nothing calls this directly
no test coverage detected