0
votes

I am trying to run ios module of a libgdx project(using android studio). Not facing this issue for desktop or android modules.

I am trying to read mp3 file using

Gdx.audio.newMusic(Gdx.files.internal(filepath));

I get the following error:

2015-08-28 14:55:20.079 IOSLauncher[354:28520] OAL Error: -[OALAudioTrack preloadUrl:seekTime:]: : Could not load URL file:///private/var/mobile/Containers/Bundle/Application/8D3A4B05-D747-4E9E-84F6-FF0A492D77A6/IOSLauncher.app/data/Sound/gamemusic.mp3: The operation couldn’t be completed. (OSStatus error 2003334207.)

com.badlogic.gdx.utils.GdxRuntimeException: Error opening music file at /private/var/mobile/Containers/Bundle/Application/8D3A4B05-D747-4E9E-84F6-FF0A492D77A6/IOSLauncher.app/data/Sound/gamemusic.mp3 at com.badlogic.gdx.backends.iosrobovm.IOSAudio.newMusic(IOSAudio.java)

I tried to load same file in same location using

Gdx.audio.newSound(Gdx.files.internal(filepath));

It works fine and I am able to run the game without any issues.

Have found a few mentions about this error in many places but no clear answers.

Please advice.

1

1 Answers

0
votes

The error description was not clear. What it actually means is that the file was not to be found. It appears the project was pointing at the android project's assets folder. Whereas I was making changes in iOS resources folder.