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

Method loadwav

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

Source from the content-addressed store, hash-verified

398#define MAKEDWORD(a,b,c,d) (((d) << 24) | ((c) << 16) | ((b) << 8) | (a))
399
400 result WavStream::loadwav(File * fp)
401 {
402 fp->seek(0);
403 drwav* decoder = drwav_open(drwav_read_func, drwav_seek_func, (void*)fp);
404
405 if (decoder == NULL)
406 return FILE_LOAD_FAILED;
407
408 mChannels = decoder->channels;
409 if (mChannels > MAX_CHANNELS)
410 {
411 mChannels = MAX_CHANNELS;
412 }
413
414 mBaseSamplerate = (float)decoder->sampleRate;
415 mSampleCount = (unsigned int)decoder->totalSampleCount;
416 mFiletype = WAVSTREAM_WAV;
417 drwav_close(decoder);
418
419 return SO_NO_ERROR;
420 }
421
422 result WavStream::loadogg(File * fp)
423 {

Callers

nothing calls this directly

Calls 3

drwav_openFunction · 0.85
drwav_closeFunction · 0.85
seekMethod · 0.45

Tested by

no test coverage detected