| 2284 | } |
| 2285 | |
| 2286 | static 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) { \ |