File tree Expand file tree Collapse file tree
Expand file tree Collapse file tree Original file line number Diff line number Diff line change @@ -681,3 +681,28 @@ void SDLSoundDevice::MarkMem()
681681 MarkMemObj (_psdlsn);
682682}
683683#endif // DEBUG
684+
685+ bool FValidSoundFile (PFNI pfniSoundFile)
686+ {
687+ AssertPo (pfniSoundFile, 0 );
688+
689+ bool fRet = fFalse ;
690+ STN stnFilePath;
691+ Mix_Chunk *pchunk = pvNil;
692+
693+ pfniSoundFile->GetStnPath (&stnFilePath);
694+
695+ pchunk = Mix_LoadWAV (stnFilePath.Psz ());
696+ if (pchunk != pvNil)
697+ {
698+ fRet = fTrue ;
699+ Mix_FreeChunk (pchunk);
700+ pchunk = pvNil;
701+ }
702+ else
703+ {
704+ Bug (Mix_GetError ());
705+ }
706+
707+ return fRet ;
708+ }
Original file line number Diff line number Diff line change @@ -64,4 +64,7 @@ class SDLSoundDevice : public SDLSoundDevice_PAR
6464 void NotifyChannelFinished (int channel);
6565};
6666
67+ // Return true if this sound can be loaded by SDL_Mixer
68+ bool FValidSoundFile (PFNI pfniSoundFile);
69+
6770#endif // SNDSDL_H
You can’t perform that action at this time.
0 commit comments