Checks if the file specified in FileName is a valid MP3 file.
| 35 | |
| 36 | //! Checks if the file specified in FileName is a valid MP3 file. |
| 37 | ILboolean ilIsValidMp3(ILconst_string FileName) |
| 38 | { |
| 39 | ILHANDLE Mp3File; |
| 40 | ILboolean bMp3 = IL_FALSE; |
| 41 | |
| 42 | if (!iCheckExtension(FileName, IL_TEXT("mp3"))) { |
| 43 | ilSetError(IL_INVALID_EXTENSION); |
| 44 | return bMp3; |
| 45 | } |
| 46 | |
| 47 | Mp3File = iopenr(FileName); |
| 48 | if (Mp3File == NULL) { |
| 49 | ilSetError(IL_COULD_NOT_OPEN_FILE); |
| 50 | return bMp3; |
| 51 | } |
| 52 | |
| 53 | bMp3 = ilIsValidMp3F(Mp3File); |
| 54 | icloser(Mp3File); |
| 55 | |
| 56 | return bMp3; |
| 57 | } |
| 58 | |
| 59 | |
| 60 | //! Checks if the ILHANDLE contains a valid MP3 file at the current position. |
no test coverage detected