Skip to content

Commit

Permalink
Forgot FMT
Browse files Browse the repository at this point in the history
  • Loading branch information
Hrick87 committed Dec 16, 2023
1 parent 7304fcb commit 7eb1a7e
Show file tree
Hide file tree
Showing 2 changed files with 14 additions and 17 deletions.
Original file line number Diff line number Diff line change
Expand Up @@ -46,22 +46,19 @@ void SndfileBackend::discover_drivers(core::Array<DriverInfo, MaxDrivers>& drive

const char* driver = format_info.extension;

if(strcmp(driver, "wav") == 0){
if(wav_count == 1){
if (strcmp(driver, "wav") == 0) {
if (wav_count == 1) {
driver = "nist";
}
else if(wav_count == 2){
} else if (wav_count == 2) {
driver = "wavex";
}
wav_count++;
}

if(strcmp(driver, "mat") == 0){

if(mat_count == 0){
if (strcmp(driver, "mat") == 0) {
if (mat_count == 0) {
driver = "mat4";
}
else if(mat_count == 1){
} else if (mat_count == 1) {
driver = "mat5";
}
mat_count++;
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -19,14 +19,14 @@ struct FileMap {
const char* format_cstring;
int format_enum;
} file_type_map[] = {
{ "aiff", SF_FORMAT_AIFF }, { "au", SF_FORMAT_AU }, { "avr", SF_FORMAT_AVR },
{ "caf", SF_FORMAT_CAF }, { "htk", SF_FORMAT_HTK }, { "iff", SF_FORMAT_SVX },
{ "mat", SF_FORMAT_MAT4 }, {"mat4", SF_FORMAT_MAT4}, { "mat5", SF_FORMAT_MAT5 }, { "mpc", SF_FORMAT_MPC2K },
{ "paf", SF_FORMAT_PAF }, { "pvf", SF_FORMAT_PVF }, { "raw", SF_FORMAT_RAW },
{ "rf64", SF_FORMAT_RF64 }, { "sd2", SF_FORMAT_SD2 }, { "sds", SF_FORMAT_SDS },
{ "sf", SF_FORMAT_IRCAM }, { "voc", SF_FORMAT_VOC }, { "w64", SF_FORMAT_W64 },
{ "wav", SF_FORMAT_WAV }, { "nist", SF_FORMAT_NIST }, { "wavex", SF_FORMAT_WAVEX },
{ "wve", SF_FORMAT_WVE }, { "xi", SF_FORMAT_XI },
{ "aiff", SF_FORMAT_AIFF }, { "au", SF_FORMAT_AU }, { "avr", SF_FORMAT_AVR },
{ "caf", SF_FORMAT_CAF }, { "htk", SF_FORMAT_HTK }, { "iff", SF_FORMAT_SVX },
{ "mat", SF_FORMAT_MAT4 }, { "mat4", SF_FORMAT_MAT4 }, { "mat5", SF_FORMAT_MAT5 },
{ "mpc", SF_FORMAT_MPC2K }, { "paf", SF_FORMAT_PAF }, { "pvf", SF_FORMAT_PVF },
{ "raw", SF_FORMAT_RAW }, { "rf64", SF_FORMAT_RF64 }, { "sd2", SF_FORMAT_SD2 },
{ "sds", SF_FORMAT_SDS }, { "sf", SF_FORMAT_IRCAM }, { "voc", SF_FORMAT_VOC },
{ "w64", SF_FORMAT_W64 }, { "wav", SF_FORMAT_WAV }, { "nist", SF_FORMAT_NIST },
{ "wavex", SF_FORMAT_WAVEX }, { "wve", SF_FORMAT_WVE }, { "xi", SF_FORMAT_XI },
};

bool detect_file_extension(const char** driver, const char* path) {
Expand Down

0 comments on commit 7eb1a7e

Please sign in to comment.