BASIC

Author Topic: [SOLVED] Problems playing ogg and mp3 on android  (Read 4185 times)

Offline erico

  • Community Developer
  • Prof. Inline
  • ******
  • Posts: 4177
    • View Profile
    • Portfolio
Re: Problems playing ogg and mp3 on android
« Reply #15 on: 2016-Jun-24 »
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.

Offline spacefractal

  • Community Developer
  • Prof. Inline
  • ******
  • Posts: 3604
    • View Profile
    • Space Fractal
Re: Problems playing ogg and mp3 on android
« Reply #16 on: 2016-Jun-24 »
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.
Greedy Mouse - Karma Miwa - Spot Race - CatchOut - Android Extras - is on a vacation trip, home before end of few days in jan.

Offline msx

  • Prof. Inline
  • *****
  • Posts: 773
    • View Profile
Re: Problems playing ogg and mp3 on android
« Reply #17 on: 2016-Jun-26 »
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.

Offline spacefractal

  • Community Developer
  • Prof. Inline
  • ******
  • Posts: 3604
    • View Profile
    • Space Fractal
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.
Greedy Mouse - Karma Miwa - Spot Race - CatchOut - Android Extras - is on a vacation trip, home before end of few days in jan.

Offline mentalthink

  • Prof. Inline
  • *****
  • Posts: 3357
  • Integrated Brain
    • View Profile
Thanks for the info,...  I don't know about this...  :booze: