• Global community
    • Language:
      • Deutsch
      • English
      • Español
      • Français
      • Português
  • 日本語コミュニティ
    Dedicated community for Japanese speakers
  • 한국 커뮤니티
    Dedicated community for Korean speakers
Exit
Locked
0

Best settings for Audio + play() latency

Engaged ,
May 06, 2011 May 06, 2011

Copy link to clipboard

Copied

Can anyone reccomend the best audio settings/audio export settings to use for game sound effects in android and/or iOS.

I have done a little bit of experimenting, but not sure on the best to use yet.

my concerns are performance, size, and of delay when calling play()

The delay when calling play() is still very present for me on android.I have tried many settings, wavs and mp3s. Hopefuly i am doing something wrong here...

TOPICS
Development

Views

10.5K

Translate

Translate

Report

Report
Community guidelines
Be kind and respectful, give credit to the original source of content, and search for duplicates before posting. Learn more
community guidelines
New Here ,
Jun 20, 2011 Jun 20, 2011

Copy link to clipboard

Copied

I'm hoping to try it today, once I get my developer membership  authorized by apple ($99 - yuck!) and I'll post my results to this thread.

Jack

Votes

Translate

Translate

Report

Report
Community guidelines
Be kind and respectful, give credit to the original source of content, and search for duplicates before posting. Learn more
community guidelines
LEGEND ,
Jun 20, 2011 Jun 20, 2011

Copy link to clipboard

Copied

The bug number is #2877303. Audio on iOS works well.

Votes

Translate

Translate

Report

Report
Community guidelines
Be kind and respectful, give credit to the original source of content, and search for duplicates before posting. Learn more
community guidelines
Guest
Jun 20, 2011 Jun 20, 2011

Copy link to clipboard

Copied

Given that the sole reason I'm testing AIR mobile development is for the cross-platform development time savings, I have no reason to use it for a single platform.  I think there's an over-focus on iOS packager right now.  If it becomes the only mobile platform that runs this stuff effectively, serious developers will just do native iOS development, because what's the point in tolerating all the overhead otherwise?

I'm shelving it until either audio works on Android or AIR for Windows Mobile blows me away.

Votes

Translate

Translate

Report

Report
Community guidelines
Be kind and respectful, give credit to the original source of content, and search for duplicates before posting. Learn more
community guidelines
LEGEND ,
Jun 20, 2011 Jun 20, 2011

Copy link to clipboard

Copied

Other non-native tools also get audio lag on Android, and the forums for people doing native Android apps have some lengthy debates about the audio latency issues. So, you may have a long wait!

Votes

Translate

Translate

Report

Report
Community guidelines
Be kind and respectful, give credit to the original source of content, and search for duplicates before posting. Learn more
community guidelines
Guest
Jun 20, 2011 Jun 20, 2011

Copy link to clipboard

Copied

Those discussions are about ultra-low latency for things like music processing applications.  My performance tests in java with the SDK have been great.  AIR has failed to achieve even a level of casual usability where a human perceives the sound as happening at about the same time as another event.

Votes

Translate

Translate

Report

Report
Community guidelines
Be kind and respectful, give credit to the original source of content, and search for duplicates before posting. Learn more
community guidelines
New Here ,
Jun 20, 2011 Jun 20, 2011

Copy link to clipboard

Copied

I just looked at the Corona forum and found this, which doesn't bode well:

We are working on this, but Android audio is a really hard  problem. Android audio is currently just terrible so we don't have much  to work with. You just need to Google it to see for yourself.

http://code.google.com/p/android/issues/detail?id=3434
http://kile.stravaganza.org/blog/post/android-audio-api-sucks
http://www.badlogicgames.com/wordpress/?p=1315
http://groups.google.com/group/android-ndk/browse_thread/thread/29f88a99...
http://mindtherobot.com/blog/555/android-audio-problems-hidden-limitatio...
http://music.columbia.edu/pipermail/portaudio/2010-December/011146.html

That said, I just pushed some new changes to the Android OpenAL  backend today that try to improve the latency. This needs to be tested  by all of you to make sure it doesn't break things in other ways.

We are investigating OpenSL ES as a new backend to OpenAL, but it  requires Android 2.3+. But early word on the internet is that the  performance is still terrible. I suspect that we will need to wait for  hardware makers to get their act together as well to take advantage of  OpenSL ES.

We've got to hope that adobe can fix this problem for us - I was very psyched to do a music-oriented cross-platform app in AIR.

Jack

Votes

Translate

Translate

Report

Report
Community guidelines
Be kind and respectful, give credit to the original source of content, and search for duplicates before posting. Learn more
community guidelines
Engaged ,
Jun 20, 2011 Jun 20, 2011

Copy link to clipboard

Copied

yes i also hope adobe can come up with a fix, I also was thinking we might be able to create a work around when air apps get the ability to call native code...which i think might be out later this year.

Votes

Translate

Translate

Report

Report
Community guidelines
Be kind and respectful, give credit to the original source of content, and search for duplicates before posting. Learn more
community guidelines
Explorer ,
Sep 01, 2011 Sep 01, 2011

Copy link to clipboard

Copied

Just to put in a current two cents: this is happening still. Hope someone addresses it as it makes any sort of game - or for that matter any UI - pretty amateurish looking/sounding. I am using Flash CS5.5 and Air for Android and running the app on a Galaxy Tab 10.1 with Air 2.7.1.1961. I see terible delays in sound effects playing. Like more than 1/4 second delay on a sound effect tied to a button press. And even worse on the in game FX.

Any word on a possible fix any time soon?

Votes

Translate

Translate

Report

Report
Community guidelines
Be kind and respectful, give credit to the original source of content, and search for duplicates before posting. Learn more
community guidelines
Community Beginner ,
Apr 24, 2012 Apr 24, 2012

Copy link to clipboard

Copied

Count us in. We're seeing pretty bad sound latency on Nook and Kindle Fire too.

Votes

Translate

Translate

Report

Report
Community guidelines
Be kind and respectful, give credit to the original source of content, and search for duplicates before posting. Learn more
community guidelines
Participant ,
May 04, 2013 May 04, 2013

Copy link to clipboard

Copied

LATEST

Let's be clear:

1) There is "acceptable" latency of the order of half a sec or so ( often less ), which according to the post by Holgate, #7 above, is an issue with -- some versions of ( ? ) -- Android ( not Air specifically ).

2) Then, there is unacceptable delay, which appears to be specific to Air on some Android devices ( particularly Nook Color and Kindle Fire ), where a sound will sometimes play in near sync ( with "normal" Android latency ), and sometimes with a delay of SEVERAL SECONDS ( like 5 or 10, in one of my apps! ), which apparently has something to do with garbage collection ( Holgate post #14, above ).

I can confirm that the unacceptable delay has NOT been fixed as of Air 3.6, testing on Nook Color and Kindle Fire, though it is fine ( no delay ) on the Nexus One.

As pointed out in another forum, playing all your sounds in a silent loop, will prevent sounds from being garbage collected, and will eliminate the delay issue whenever you play a sound, like so:

private function initSounds():void

{

     var silentSndXF:SoundTransform = new SoundTransform( 0 );

     _sound01.play( 0, int.MAX_VALUE, silentSndXF );

     _sound02.play( 0, int.MAX_VALUE, silentSndXF );

     _sound03.play( 0, int.MAX_VALUE, silentSndXF );

     // Note: int.MAX_VALUE is about 2 billion, so even a very short "click" sound of 1/20

     // of a sec would play for 3 years or so -- if the app was never closed !!

}

private function onButtonClick( evt:MouseEvent ):void

{

     _sound01.play();

}

This hack eliminated the severe delay I was getting on Nook Color and Kindle Fire ( several seconds for some sounds, in some situations ), leaving me with the "regular", acceptable Android latency.

Votes

Translate

Translate

Report

Report
Community guidelines
Be kind and respectful, give credit to the original source of content, and search for duplicates before posting. Learn more
community guidelines