MCPcopy Create free account
hub / github.com/ObEngine/ObEngine / loadogg

Method loadogg

extlibs/soloud/src/audiosource/wav/soloud_wavstream.cpp:422–444  ·  view source on GitHub ↗

Source from the content-addressed store, hash-verified

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 {

Callers

nothing calls this directly

Calls 5

stb_vorbis_open_fileFunction · 0.85
stb_vorbis_get_infoFunction · 0.85
stb_vorbis_closeFunction · 0.85
seekMethod · 0.45

Tested by

no test coverage detected