Hello,
Is there a way to play sound files from romfs or any other place without having an extra folder for sounds on the sdcard?
I tried this:
void audio_load(const char *audio){
FILE *file = fopen(audio, "rb");
fseek(file, 0, SEEK_END);
off_t size = ftell(file);
fseek(file, 0, SEEK_SET);
buffer = linearAlloc(size);
off_t bytesRead = fread(buffer, 1, size, file);
fclose(file);
csndPlaySound(8, SOUND_FORMAT_16BIT | SOUND_REPEAT, 48000, 1, 0, buffer, buffer, size);
linearFree(buffer);
}
audio_load("romfs:/audio/original_raw.bin");//and then call it like this.
When i try to run it, it will crash my 3ds with an Error message. Pls help.
Bye Tim
Is there a way to play sound files from romfs or any other place without having an extra folder for sounds on the sdcard?
I tried this:
void audio_load(const char *audio){
FILE *file = fopen(audio, "rb");
fseek(file, 0, SEEK_END);
off_t size = ftell(file);
fseek(file, 0, SEEK_SET);
buffer = linearAlloc(size);
off_t bytesRead = fread(buffer, 1, size, file);
fclose(file);
csndPlaySound(8, SOUND_FORMAT_16BIT | SOUND_REPEAT, 48000, 1, 0, buffer, buffer, size);
linearFree(buffer);
}
audio_load("romfs:/audio/original_raw.bin");//and then call it like this.
When i try to run it, it will crash my 3ds with an Error message. Pls help.
Bye Tim