Skip navigation
Currently Being Moderated

AIR 3 ios sound issues

Oct 2, 2011 2:01 PM

Tags: #air #microphone #mobile #ios #sound

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

 
Replies
  • Currently Being Moderated
    Oct 16, 2011 10:16 AM   in reply to saariko

    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.

     
    |
    Mark as:
  • Currently Being Moderated
    Oct 17, 2011 3:56 AM   in reply to saariko

    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.

     
    |
    Mark as:
  • Currently Being Moderated
    Oct 17, 2011 4:29 AM   in reply to saariko

    Actually iOS SDK provides 5 different ways to play media out of which only 2 respect the mute switch. The modes we use in our SDK donot respect the mute switch and there is no way we can enable this too. Angry birds might be using one of the 2 modes that respect the mute switch. iPod app on the other way uses a mode that doesnot respect the mute switch. I hope you understand.

     
    |
    Mark as:
  • Currently Being Moderated
    Oct 17, 2011 12:36 PM   in reply to saariko

    I accidentally did a test of the mute situation, in that I had made an AIR 2.6 and an AIR 3 version of the same app, while checking out some non-sound related things. By chance I played the AIR 3 one while the mute button was in the sound off position, and I still heard the audio, which goes along with what you are saying. When I played the AIR 2.6 version I didn't hear sound until I turned the mute button to the sound on position.

     

    So, regardless of why things happen the way they do, AIR 2.6 honored the mute switch, and AIR 3 doesn't.

     
    |
    Mark as:
  • Currently Being Moderated
    Oct 18, 2011 1:57 AM   in reply to saariko

    @saariko

    You might want to add a feature request for this over at http://ideas.adobe.com/ct/ct_list.bix?c=9D564F43-979A-4E35-AA21-85A61B 6AB8DE and http://bugbase.adobe.com.

    In case you decide to add the request, post back the URL so that others can also vote and comment.

     

    Thanks.

    Sanika

     
    |
    Mark as:
  • Currently Being Moderated
    Oct 18, 2011 10:26 AM   in reply to saariko

    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.

     
    |
    Mark as:
  • Currently Being Moderated
    Nov 22, 2011 5:38 AM   in reply to Colin Holgate

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

     
    |
    Mark as:
  • Currently Being Moderated
    Nov 22, 2011 5:48 AM   in reply to georgesi

    I logged a bug about this and currently it's listed as a known issue, and is deferred. That is, they hopefully realize it's wrong but will fix it at some future date. I don't know when that date will be.

     
    |
    Mark as:
  • Currently Being Moderated
    Nov 22, 2011 5:48 AM   in reply to saariko

    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.

     
    |
    Mark as:
  • Currently Being Moderated
    Nov 22, 2011 6:10 AM   in reply to undereyes

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

    Much apriciated!

     
    |
    Mark as:
  • Chris Campbell
    9,456 posts
    May 4, 2010
    Currently Being Moderated
    Nov 22, 2011 5:21 PM   in reply to georgesi

    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

     
    |
    Mark as:
  • Currently Being Moderated
    Nov 22, 2011 5:36 PM   in reply to Chris Campbell

    The bug number is 3003849, but I don't think it's somewhere that most people can see.

     
    |
    Mark as:
  • Chris Campbell
    9,456 posts
    May 4, 2010
    Currently Being Moderated
    Nov 22, 2011 6:00 PM   in reply to Colin Holgate

    Ah, I see, it was added through the prerelease database.  It might not be a bad idea to create a seperate feature request over at bugbase.adobe.com.  We can link them internally and that way others can still vote on it.

     

    Chris

     
    |
    Mark as:
  • Currently Being Moderated
    Nov 22, 2011 6:12 PM   in reply to Chris Campbell
     
    |
    Mark as:
  • Chris Campbell
    9,456 posts
    May 4, 2010
    Currently Being Moderated
    Nov 22, 2011 6:18 PM   in reply to Colin Holgate

    Thanks Colin.

     

    Everyone else, I'd like to encourage you to visit Colins bug and vote for this issue if you think it's important for your applications.  Please pass this around the community so others are aware of it.

     

    Chris

     
    |
    Mark as:
  • Currently Being Moderated
    Nov 23, 2011 12:28 AM   in reply to saariko

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

     
    |
    Mark as:
  • Currently Being Moderated
    Jan 27, 2012 6:06 PM   in reply to saariko

    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.

     
    |
    Mark as:
  • Currently Being Moderated
    Jan 28, 2012 2:18 AM   in reply to SarahNorthway

    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.

     
    |
    Mark as:
  • Currently Being Moderated
    Feb 1, 2012 9:03 AM   in reply to saariko

    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.htm l

     

    Be happy!

     
    |
    Mark as:
  • Currently Being Moderated
    Feb 1, 2012 12:47 PM   in reply to undereyes

    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!

     
    |
    Mark as:
  • Currently Being Moderated
    Feb 2, 2012 4:02 AM   in reply to saariko

    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)

     
    |
    Mark as:
  • Currently Being Moderated
    Feb 3, 2012 9:27 AM   in reply to saariko

    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.

     
    |
    Mark as:
  • Currently Being Moderated
    Feb 4, 2012 9:40 AM   in reply to snoopyhoff

    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.

     
    |
    Mark as:
  • Currently Being Moderated
    Feb 6, 2012 1:29 AM   in reply to snoopyhoff
     
    |
    Mark as:
  • Currently Being Moderated
    Feb 17, 2012 3:11 PM   in reply to saariko

    @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."

     
    |
    Mark as:
  • Currently Being Moderated
    Feb 18, 2012 10:16 AM   in reply to paus akid

    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</exten sionID>

              </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

     
    |
    Mark as:
  • Currently Being Moderated
    Feb 22, 2012 12:46 PM   in reply to SarahNorthway

    @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.

     
    |
    Mark as:
  • Currently Being Moderated
    Feb 22, 2012 1:18 PM   in reply to paus akid

    I figured something out: I'm able to get my previous error (Some classes used in the application could not be resolved for packaging. See error log for more details) when I include the mute.ane durring Export Release Build, even if I don't import or use the class. So adt can't find the class when exporting and FlashBuilder can't find the class when it processes the code for hinting and error detection.

     

    But knowing that doesn't help me much any other thoughts appreciated! Thoughts that crossed my mind: I'm compiling on OSX so maybe it's something case sensitive, I'm compiling with Flex SDK 4.6 and the ANE was compiled with 4.5.1 from what I see by unzipping it.

     
    |
    Mark as:
  • Currently Being Moderated
    Feb 22, 2012 7:24 PM   in reply to paus akid

    paus akid wrote:

     

    Thoughts that crossed my mind: I'm compiling on OSX so maybe it's something case sensitive, I'm compiling with Flex SDK 4.6 and the ANE was compiled with 4.5.1 from what I see by unzipping it.

     

    I'm using Flex SDK 4.6 and AIR 3.1 so that's probably not it. Maybe it's to do with whether the library is included as Internal or External. I use another extension that needs to be Internal while testing in ADL (or the class can't be found - the same error you're having), and needs to be External when building the production IPA or it won't run. However I don't have this issue with Mute. Internal/External inclusion is an explicit setting in FlashDevelop (right-click the swc/options) but I'm not sure about FlashBuilder 4.6 or developing on a Mac. Maybe try removing the reference to the swc entirely, or the reference to the ane?

     

    I just ran across another extension that you might have more luck with. It doesn't give you any options, but simply forces the app to use kAudioSessionCategory_AmbientSound:

     

    https://github.com/StickSports/ANE-Silent-Switch

     
    |
    Mark as:
  • Currently Being Moderated
    Feb 23, 2012 1:02 PM   in reply to SarahNorthway

    @skatc Yes, I was able to get ANE Silent Switch going without any trouble. I feel it's a bit less elegant of a solution since you have to call SilentSwitch.apply() after every .play() of a sound.

     

    I'm not sure what external mode for libraries in flash develop are. From the little bit of reading I just did, it sounds like a way to link to libraries that are outside the path of your project. AFAIK FB4.6 doesn't care where your swc or ane sit on the file system as long as you browse to them in the project properties.

     

    I've been emailing with @undereyes and neither of us is sure why the ANE won't work for me (when others do). If anyone with FlashBuilder4.6 is willing to take a look, the barebones test project I created is here:

     

    http://starpause.com/job/HelloMuteSwitch-ExampleFlashBuilder4.6-projec t.zip

     

    Thanks!

     
    |
    Mark as:
  • Currently Being Moderated
    Mar 4, 2012 7:43 PM   in reply to undereyes

    This is a really great extension

     

    I had a bit of trouble getting the packaging process to work as it was my first native extension I've used. I have put together a bit of a guide for other users that covers not just this extension but the whole packaging process if you're used to the Flash IDE.

     

    See here: http://teampokpok.com/2012/adobe-air-native-extensions-for-ios/

     

    Hopefully this can help others.

     
    |
    Mark as:

More Like This

  • Retrieving data ...

Bookmarked By (0)

Answers + Points = Status

  • 10 points awarded for Correct Answers
  • 5 points awarded for Helpful Answers
  • 10,000+ points
  • 1,001-10,000 points
  • 501-1,000 points
  • 5-500 points