Quick Links: Gideros Home | Download Gideros | Developer Guide
OGG music playback
  • antixantix +1 -1
    Member
    How do I playback OGG music files? I don't seem to see anything in the documentation on how it works.

    And with normal MP3 file playback there is an issue (in Android its self) where the tune does not loop once completed and this requires adding more code in an on complete listener to restart it. Does this issue affect OGG playback also?
    Check out my DevBlog, my GitHub, and my games Falling Animals | Breaky Wall | Exetor
  • hgy29hgy29 +1 -1
    Maintainer
    For ogg just include ogg plugin in your custom player, and it shouldn’t be affected by the mp3 issue since they don’t use the same playback system. MP3 is played by android itself while ogg is decoded and played by gideros.
  • Also, it may be that mp3 files now loop properly - a bug was fixed that released the wrong memory in some cases. Can you try the MP3 again (with the 2017.11 release)?
  • antixantix +1 -1
    Member
    so..
    local sound = Sound.new("music.ogg")
    local channel = sound:play()

    will work?

    I will upgrade to the latest version of Gideros today (I'm still on 2017.4.1) :bz

    It would be great if the mp3 thing was fixed too, I'll totally test that :)
    Check out my DevBlog, my GitHub, and my games Falling Animals | Breaky Wall | Exetor
  • hgy29hgy29 +1 -1 (+1 / -0 )
    Maintainer Accepted Answer
    Yes, it will work. just be sure to enable ogg plugin, nothing more to do. the plugin will register himself to register as a handler for .ogg/.oga/.ogv sound files.

    Likes: antix

  • @antix can you try the mp3 again with the new version?
  • antixantix +1 -1
    Member
    We were out most of the day so will attempt to upgrade and test in the morning :)
    Check out my DevBlog, my GitHub, and my games Falling Animals | Breaky Wall | Exetor
  • antixantix +1 -1
    Member
    Right. With 2017.11 installed MP3 repeats fine on Pixel-C but not on my old Nexus 4.

    OGG plays but will not repeat on either device using the following code..
    local sound = Sound.new("music.ogg")
    local channel = sound:play(0, true)

    Oh, I exported APK files to my devices to test.
    Check out my DevBlog, my GitHub, and my games Falling Animals | Breaky Wall | Exetor
  • hgy29hgy29 +1 -1
    Maintainer Accepted Answer
    @antix yes you are right, seeking is not implemented in ogg so gideros don’t know how to make the sound restart from the beginning. I need to find a proper way to do this.
  • antixantix +1 -1
    Member
    @hgy29 ahh darn. I suppose I should just stick to plain old MP3 for now then :)

    So is there any way to get seemless looping for any music in Gideros?
    Check out my DevBlog, my GitHub, and my games Falling Animals | Breaky Wall | Exetor
  • hgy29hgy29 +1 -1
    Maintainer
    If someone could provide me with a test app that could reproduce the issue on my Iconia 7 tablet, I'd happily have a look at this long standing issue for mp3
  • antixantix +1 -1
    Member
    @hgy29 it seems kind of hard to pin down. The issue for me only happens on my Nexus 4 so it is either an issue with the older version of Android that it runs or some hardware issue associated with that phone.

    For me personally I can just use the following code with any old mp3 file and it will play once and fail to repeat.
    local sound = Sound.new("music.mp3")
    local channel = sound:play(0, true)
    Check out my DevBlog, my GitHub, and my games Falling Animals | Breaky Wall | Exetor
  • For me it was intermittent - but the event catches it every time (to restart manually).

    Is the OS told to repeat or is it an event in gideros that also sends off the completed event if there is no repeat?

    If it's gideros that sorts out the repeat then somehow it's not resetting the position to 0.
  • I can replicate the issue on all my Android devices including my current Pixel XL phone. On iOS it normally loops ok, with a very slight gap on slow devices.

    I thought the problem happens because of the way Android handles mp3 files?
    My Gideros games: www.totebo.com
  • Probably. I haven't tested with ogg yet to see if it has a gap between ending and restarting yet. Having seemless looping music would be pretty good :)
    Check out my DevBlog, my GitHub, and my games Falling Animals | Breaky Wall | Exetor

Howdy, Stranger!

It looks like you're new here. If you want to get involved, click one of these buttons!

Login with Facebook Sign In with OpenID

In this Discussion

Top Posters