Android Question Audio Lib 1.63 Pitch Issue

Discussion in 'Android Questions' started by wonder, May 25, 2015.

  1. wonder

    wonder Expert Licensed User

    Hello Erel,

    I've noticed a small issue with the Audio lib.
    In my game "Project Ryu", the attached mp3 file plays at the beginning of the match.
    snd_effect.Play(voice_fightID, 11000)
    The problem is that the pitch isn't the same across different devices.
    It seems to me that, on faster devices the pitch is higher.

    [Tablet] Asus ME173X: Normal Pitch
    [Tablet] nVidia Shield: Higher Pitch
    [Phone] Sony Xperia P: Normal Pitch
    [PC] Google Chrome (Arc Welder): Higher Pitch

    How to solve this without resorting to use another library?

    Attached Files:

    Last edited: May 25, 2015
  2. Erel

    Erel Administrator Staff Member Licensed User

    The Audio library is a thin wrapper above the native SoundPool API. Switching to a different library will not help as the playback is handled by the native API.
  3. wonder

    wonder Expert Licensed User

    I've just tested it. When using the LibGDX audio functions the pitch inconsistency doesn't happen, it plays fine.
    There might be something going on with the regular audio lib... o_O
  4. Cableguy

    Cableguy Expert Licensed User

    Hi Bruno, have you tri playing the file outside the game environment, just as you would do with any mp3 file? If so, were there any differences in pitch? I'm aiming at more of an hardware issue...(speaker quality)
    wonder likes this.
  5. wonder

    wonder Expert Licensed User

    I've just finished rewriting my code to work with the libGDX internal sound engine instead of the the Audio lib.
    The problem's solved for me, but the issue still exists in the default lib.
    Yes, the pitch is entirely different. I even compared it head-to-head, [PC Winamp Media Player] vs. [nVidia Shield] and [Chrome Arc Welder].
    Furthermore, my speakers are fine. I've tested across different devices, headphones and speakers.
    Also, I've re-encoded the original sound file to mp3 and ogg various times with different bitrate options. No effect.
    Cableguy likes this.
  6. Cableguy

    Cableguy Expert Licensed User

    Seems you covered all bases!
    wonder likes this.
  7. wonder

    wonder Expert Licensed User

    Peter Simpson likes this.
  1. This site uses cookies to help personalise content, tailor your experience and to keep you logged in if you register.
    By continuing to use this site, you are consenting to our use of cookies.
    Dismiss Notice