I saw in all examples, the audio files are supposed to be put at some external folders like /sdcard/fmod/
Can fmod open audio files inside the .apk package ?
I tried to use FMOD_EventSystem_Load with the file path in apk, it failed with FMOD_ERR_FILE_NOTFOUND
So, how do I read audio files inside apk ?
- qiqian82 asked 3 years ago
FMOD4 has no way of doing this, you would need to use the asset API to fetch the file yourself, then give it to FMOD as a memory pointer or provide file callbacks.
FMOD5 (FMOD Studio) has this functionality built in, just prefix the filename with "file:///android_asset/" and it will load.
I’m also having the same problem.
I’ve put all my .ogg files in the assets folder and prefixed the filename with "file:///android_asset/", but I’m still getting the FMOD_ERR_FILE_NOTFOUND error.
eg. result = s_system->createSound("file:///android_asset/sfx.ogg", mode, 0, &sound);
Is there some sort of conflict with using the asset manager elsewhere? Do I need to set something in the manifest file?
BTW: I ran the eclipse example play_stream and it worked fine. I really can’t tell what the difference between the example project and my project is.
ALSO: I am able to get FMOD sounds playing if I load them into memory, but I want to use the load by filename functionality (esp for streaming)
EDIT: Problem solved. I wasn’t calling FMODAudioDevice.init(this);. What a dork.
- tcharlton answered 3 years ago
Please login first to submit.