Given the two following files, which are identical apart from the file extension:
didier@MacBook-Pro-de-Didier ~ % ls -l ~/Documents/Code/Playdate/test/Source/Sounds
total 16
-rw-rw-r--@ 1 didier staff 3716 18 avr 20:13 test.aif
-rw-rw-r--@ 1 didier staff 3716 18 avr 20:13 test.raw
and the given C code trying to open them:
//const char* filepath = "Sounds/test.raw";
const char* filepath = "Sounds/test.aif";
pb_log("Loading file at '%s'.", filepath);
SDFile* file = pd->file->open(filepath, kFileRead);
if (file == NULL) {
pb_log("Error loading file at '%s' (%s).", filepath, pd->file->geterr());
return 0;
}
It seems like opening test.raw
works fine while opening test.aif
fails with the following output:
Loading file at 'Sounds/test.aif'.
Error loading file at 'Sounds/test.aif' (No such file).
main.lua:21: assertion failed!
stack traceback:
[C]: in function 'assert'
main.lua:21: in function 'setup'
main.lua:33: in function <main.lua:31>
Am I missing something obvious (probably )?