Add check for Opus file type
Signed-off-by: Mahyar Koshkouei <deltabeard@users.noreply.github.com>
This commit is contained in:
@@ -223,8 +223,17 @@ int getFileType(const char *file)
|
||||
|
||||
// "OggS"
|
||||
case 0x5367674f:
|
||||
file_type = FILE_TYPE_OGG;
|
||||
printf("\nFile type is OGG.");
|
||||
if(isOpus(file) == 0)
|
||||
{
|
||||
printf("\nFile type is Opus.");
|
||||
file_type = FILE_TYPE_OPUS;
|
||||
}
|
||||
else
|
||||
{
|
||||
file_type = FILE_TYPE_OGG;
|
||||
printf("\nFile type is OGG.");
|
||||
}
|
||||
|
||||
break;
|
||||
}
|
||||
|
||||
|
||||
@@ -1,6 +1,16 @@
|
||||
#include <3ds.h>
|
||||
#include <opus/opusfile.h>
|
||||
|
||||
int playOpus(const char* in)
|
||||
{
|
||||
return 0;
|
||||
}
|
||||
|
||||
int isOpus(const char* in)
|
||||
{
|
||||
int err = 0;
|
||||
OggOpusFile* opusTest = op_test_file(in, &err);
|
||||
|
||||
op_free(opusTest);
|
||||
return err;
|
||||
}
|
||||
|
||||
@@ -1 +1,3 @@
|
||||
int playOpus(const char* in);
|
||||
|
||||
int isOpus(const char* in);
|
||||
|
||||
Reference in New Issue
Block a user