Skip to main content
Inspiring
October 2, 2011
Question

AIR 3 ios sound issues

  • October 2, 2011
  • 37 replies
  • 12759 views

hey all

i am using the AIR 3 sdk overlayed Flash Pro 5.5 and i am having 2 sound issues:

first of all, my iPhone 3g's physical mute/silent button does not affect my app, and it should

secondly, the app records sound from the microphone when the user presses a button,

but on playback (with another button) you can hear that the sound is missing half a second or so from the beginning

this does not happen when testing on the desktop

any ideas?

thanx, Saar

This topic has been closed for replies.

37 replies

Participating Frequently
February 17, 2012

@undereyes @skatc Do either of you have an example application of how this native extension should work? When I include this ANE in my application it won't even compile, Flash Builder gives this error: "Some classes used in the application could not be resolved for packaging. See error log for more details."

Inspiring
February 18, 2012

paus akid wrote:

@undereyes @skatc Do either of you have an example application of how this native extension should work? When I include this ANE in my application it won't even compile, Flash Builder gives this error: "Some classes used in the application could not be resolved for packaging. See error log for more details."

You may not have set -extdir in your call to atd. To install the extension you need to:

- include mute.SWC in your project (I set it as External library (not included))

- call Mute.Enabled() when your project starts:

          Mute.Enable(Mute.AMBIENT_SOUND);

- Add the class to your application.xml:

          <extensions>

                    <extensionID>com.devilishgames.nativeextensions.mute</extensionID>

          </extensions>

 

- Add "-extdir PATH_TO_ANE" to your atd package call (my .ANEs are in a directory called rsrc):

          call adt -package -target %TYPE%%TARGET% %OPTIONS% %SIGNING_OPTIONS%

          "%OUTPUT%" "%APP_XML%" %FILE_OR_DIR% -extdir rsrc

Participating Frequently
February 22, 2012

@skatc thanks for the response! Somehow I've gone a step backward rather than forward by trying to make a stripped down example. Here's my steps so far:

- include mute.swc

in FlashBuilder Package Explorer > right click project name > Properties > ActionScript Build Path > Library path tab > Add SWC... > mute.swc

- import class

in my main class:

import com.devilishgames.nativeextensions.Mute

I actually notice some trouble here: Flash Builder reports "1172: Definition com.devilishgames.nativeextensions:Mute could not be found." which is strange to me, I don't have this issue with any other SWC files (ANE or otherwise). Any ideas?

Also of note: when using FlashBuilder 4.6 I haven't had to do the last step you mention (modifying the atd package call), it's taken care of automatically if the ANE is specified for packaging, which I did.

February 3, 2012

Is there a way to make a sound continue playing even when the phone goes to sleep? My app consists of 2 buttons that each play a different relaxation sound that lasts several minutes. It works great until the phone's screen automatically goes black, and then the currently playing sound stops.

Inspiring
February 4, 2012

snoopyhoff wrote:

Is there a way to make a sound continue playing even when the phone goes to sleep? My app consists of 2 buttons that each play a different relaxation sound that lasts several minutes. It works great until the phone's screen automatically goes black, and then the currently playing sound stops.

According to the iOS developer library, Ambient and SoloAmbient are muted both when the mute switch is on and when the screen locks, whereas Playback (which I think is AIR 3's default) does not mute in either situation. So the mute switch + screen locking behavior seem to be tied together. It sounds like your app behaves similarly to Apple's built-in music app which ignores both mute button and when the screen locks. So I'm guessing you'd want to use AIR's default configuration and ignore the mute button.

If you're doing that and your app is still getting silenced when it sleeps, it may have to do with Event.DEACTIVATE getting called, although I thought this was only a problem with Android phones and not iOS.

Inspiring
February 2, 2012

Thanks a lot!!! If you want to see this ANE running (and adMob ANE for iOS) you can download Pompo & Pompa for free: http://itunes.apple.com/en/app/pompo-y-pompa/id459422523?mt=8 (sorry for the spam)

Inspiring
February 1, 2012

Hi!, I have ready the Native Extension to mute sounds when mute button is off. You can download and read documentation here: http://www.enriquedavid.es/adobe-native-extensions-ios-mute-button.html

Be happy!

Inspiring
February 1, 2012

Yes! Your extension works perfectly, and is so simple - it just lets you pick the AVAudioSession type to use (AMBIENT_SOUND obeys the mute switch and allows itunes music to continue playing). I was under the impression that this couldn't be changed after the initial session was instanciated in Adobe's code, but this may be wrong. However you did it, thank you!

Inspiring
January 28, 2012

It looks like Colin's Bug has been closed with a reason of "ThirdParty", which I guess means Adobe thinks this is Apple's problem? It also appears that Apple changed their AudioSession api in iOS5 so that it no longer provides the state of the mute switch, so native extensions are no longer a possible solution. I guess unless Adobe changes the AVAudioSession category to AVAudioSessionCategoryAmbient or lets developers change that somehow, we are out of luck.

Meanwhile, I continue to receive complaints about my app disobeying the mute switch.

Colin Holgate
Inspiring
January 28, 2012

Flash apps that were made with AIR 2.0 continue to honor the mute switch under iOS 5, so it's still a simple case of if Adobe handled the mute in AIR 3.x in the same way they did with AIR 2.0, the mute would work. It isn't an iOS 5 or Apple problem.

Inspiring
November 23, 2011

I voted. Mainwhile when I have some time I upload my Native Extension for this issue.

Inspiring
November 22, 2011

AIR-3 have disabled it. Now you have to use a Native Extension to see if mute or not, and thus able to control it sounds like they sound and what not. I am using a Native Extension own and works perfectly.

robobobo76
Participant
November 22, 2011

Would you be able to post a link to the native extension you are using ?

Much apriciated!

chris.campbell
Legend
November 23, 2011

Hi Colin,

Do you have a bug number handy?  I'll do a bit of research on my side to see if I can find an ETA.  Also, if you can spread the bug link around, I'd recommend anyone effected to vote if they feel like it should be fixed.  We use these votes to help determine priority.

Thanks,

Chris

saarikoAuthor
Inspiring
October 18, 2011

i will add a feature request soon

in the meantime, this is a quote from Apple's App Store Review Guidelines

"Apps that alter the functions of standard switches, such as the Volume Up/Down and Ring/Silent switches, will be rejected"

has anyone been rejected by Apple because of the silent switch's behavior in AIR 3?

Colin Holgate
Inspiring
October 18, 2011

AIR not reacting to the mute switch isn't the same as repurposing it. Also, the rules may have changed with iOS 5, because Apple themselves have repurposed the volume up button.

robobobo76
Participant
November 22, 2011

Its definatelly a bug. This works 100% using 2.6 or 2.7. However its broken using 3.0.

Adobe Employee
October 16, 2011

First limitation is a known limitation for all sounds being played in iOS platform. We will discussing the second concern in this post http://forums.adobe.com/message/3973662#3973662 by you.

I hope that helps you.

saarikoAuthor
Inspiring
October 16, 2011

thanx

sorry for the duplication

Adobe Employee
October 17, 2011

I have some more infor regarding the first issue. Even ipod app doesnot acknowdledge the mute button. This is because the mute switch is meant for the silencing the alarms and ringer tones and not the app music. I hope this tells you why we the mute switch should not silence the app.