MCPcopy Create free account
hub / github.com/defold/defold / FindSoundFile

Function FindSoundFile

engine/sound/src/test/test_sound.cpp:2286–2313  ·  view source on GitHub ↗

Source from the content-addressed store, hash-verified

2284}
2285
2286static const char* FindSoundFile(int argc, char** argv, dmSound::SoundDataType* type)
2287{
2288 for (int i = 0; i < argc; ++i)
2289 {
2290 const char* arg = argv[i];
2291 const char* suffix = strrchr(arg, '.');
2292 if (!suffix)
2293 continue;
2294 if (dmStrCaseCmp(suffix, ".wav")==0)
2295 {
2296 *type = dmSound::SOUND_DATA_TYPE_WAV;
2297 return arg;
2298 }
2299
2300 if (dmStrCaseCmp(suffix, ".ogg")==0)
2301 {
2302 *type = dmSound::SOUND_DATA_TYPE_OGG_VORBIS;
2303 return arg;
2304 }
2305
2306 if (dmStrCaseCmp(suffix, ".opus")==0)
2307 {
2308 *type = dmSound::SOUND_DATA_TYPE_OPUS;
2309 return arg;
2310 }
2311 }
2312 return 0;
2313}
2314
2315#define CHECK_ERROR(RESULT) \
2316 if (dmSound::RESULT_OK != RESULT) { \

Callers 1

mainFunction · 0.85

Calls 1

dmStrCaseCmpFunction · 0.85

Tested by

no test coverage detected