In my current project, I load a MP3 UI sound fairly early on in my main.lua file, although before that, the init.lua and main.lua load a number of standard libraries (like strict and inspect), and a heavily modified iOS native uikit plugin.
I'm finding that around maybe 70 to 80% of the time, the Gideros IDE reports:
UI_prefs.mp3: No such file or directory.
stack traceback:
main.lua:40: in main chunk
when I attempt to run the project. If I keep persisting by hitting Command-R to run, it'll eventually run without falling over on line 40.
The sound code is very simple:
-- sound manager for UI sounds
sound_manager = {};
sound_manager.prefs_click = Sound.new("UI_prefs.mp3") |
Could it be a race condition or something that's making the IDE fail to recognize or parse the mp3 file in adequate time to run? The mp3 is definitely in the filesystem correctly, and it does work that remaining 20% to 30% of the time.
I've attached the MP3 so you can possibly repro this bug.
Best,
- Ian
Comments
1) can you try removing mp3 from your project and re-adding it back
If that does not work
2) can you try simple example without any of the additions like plugins and other lua libraries.
@atilim - thank you. Don't spend too much time on it for now, as I can just keep hitting Command-R until it runs. (3 out of 10 ain't too bad ). If you can't repro for now, I'll build a testbed in a couple of weeks where you can repro and isolate the problem.
Many thanks,
- Ian
u-law WAV mono 13.6Kb
IMA-ADPCM mono 8.1Kb
mp3 48KHz stereo 5Kb
It's a problem within Gideros Studio though - not the audio file. I'd much prefer the audio engine got the fix than making workarounds with audio files.
( @atilim - that's a good point - I've never seen a crash in the exported app due to the MP3 file not being found/not loading. It's a bug isolated to the Studio IDE running the app on a remote device.)
Best,
- Ian
but try to add collectgarbage() before Sound.new()
http://www.nightspade.com
- Ian