[SOLVED] Problems playing ogg and mp3 on android

Previous topic - Next topic

erico

I think this is either related to path and file name or maybe your android machine is a very unusual one.
I´ve heard report of unique android phones not playing music as it should, but it is extremely rare.

It could be something else, the only way to find out is that you post an example code that doesn´t run on android.

Codecs on PC won´t affect android, android should be able to handle ogg by itself I guess.

My example worked fine with v12 and v14 on my win7 64b.

spacefractal

can you show me some piece of code?

Make sure to add GetCurrentDir$() to the load command. Its might require full path. With glbasic own commands only ogg files works. If you using Android Extras commands, which uses own set of commands, then mp3 can also been used as well. That was added as a alternative player for android, which also can fix various issues.

Checkout the Android Extras sample for it. Its mightbeen nicer to create a FUNCTION, so its can use android extras for android and glbasic own for rest.

Im choiced not to integrate the SoundPool rutine to glbasic, due there was few difference, but more can used it as a alternative.
Genius.Greedy Mouse - Karma Miwa - Spot Race - CatchOut - PowerUp Elevation - The beagle Jam - Cave Heroes 2023 - https://spacefractal.itch.io/

msx

Finally OGG file works. The PLAYMUSIC command is not compatible with SETCURRENTDIR. It is not possible to host the sound files within other folder in Media folder, PLAYMUSIC will not find them.

I want to thank you all for helping me.

spacefractal

ahhh. Nice for pointing and a nice bug.

On Android, anything needs to been in Media folder, because glbasic will auto extract them from APK file to the internal memory, before using. This is happens automatic with Android Extras and in glbasic 14 (which using it).

Actuelly its a bug. Its should have skip the auto extract path, if the file allready exists when full path have been used.

ALso PLAYMUSIC only works with OGG files. If you using SoundPool method, both Ogg and Mp3 can been used.
Genius.Greedy Mouse - Karma Miwa - Spot Race - CatchOut - PowerUp Elevation - The beagle Jam - Cave Heroes 2023 - https://spacefractal.itch.io/

mentalthink

Thanks for the info,...  I don't know about this...  :booze: