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

Method loadmp3

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

Source from the content-addressed store, hash-verified

466 }
467
468 result WavStream::loadmp3(File * fp)
469 {
470 fp->seek(0);
471 drmp3 decoder;
472 if (!drmp3_init(&decoder, drmp3_read_func, drmp3_seek_func, (void*)fp, NULL))
473 return FILE_LOAD_FAILED;
474
475
476 mChannels = decoder.channels;
477 if (mChannels > MAX_CHANNELS)
478 {
479 mChannels = MAX_CHANNELS;
480 }
481
482 drmp3_uint64 samples = drmp3_get_pcm_frame_count(&decoder);
483
484 mBaseSamplerate = (float)decoder.sampleRate;
485 mSampleCount = (unsigned int)samples;
486 mFiletype = WAVSTREAM_MP3;
487 drmp3_uninit(&decoder);
488
489 return SO_NO_ERROR;
490 }
491
492 result WavStream::load(const char *aFilename)
493 {

Callers

nothing calls this directly

Calls 4

drmp3_initFunction · 0.85
drmp3_uninitFunction · 0.85
seekMethod · 0.45

Tested by

no test coverage detected