-
1. Re: AIR 3 ios sound issues
Varun Bhatia Oct 16, 2011 10:16 AM (in response 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.
-
2. Re: AIR 3 ios sound issues
saariko Oct 16, 2011 10:18 AM (in response to Varun Bhatia)thanx
sorry for the duplication
-
3. Re: AIR 3 ios sound issues
Varun Bhatia Oct 17, 2011 3:56 AM (in response 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.
-
4. Re: AIR 3 ios sound issues
saariko Oct 17, 2011 4:19 AM (in response to Varun Bhatia)@Varun Bhatia,
that is not correct. as i have mentioned here: http://forums.adobe.com/thread/909164, all games (like Angry Birds) follow the mute switch on iOS
i think a future sdk should let the developer decide about this through actionscript
cheers
Saar
-
5. Re: AIR 3 ios sound issues
Varun Bhatia Oct 17, 2011 4:29 AM (in response 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.
-
6. Re: AIR 3 ios sound issues
saariko Oct 17, 2011 5:11 AM (in response to Varun Bhatia)every game i have on my iPhone 3gs respects the switch. i don't have an iPod.
i understand switching between the 2 options (respecting or ignoring the mute switch) is not and wont be a runtime option.
this isn't a huge problem since i have a software mute in my app. also i could use native extentions as mentioned by your co-worker Saumitra Bhave at the same link: http://forums.adobe.com/thread/909164
thanx again for all the help!
Saar
-
7. Re: AIR 3 ios sound issues
Colin Holgate Oct 17, 2011 12:36 PM (in response 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.
-
8. Re: AIR 3 ios sound issues
sanika Kulshreshtha Oct 18, 2011 1:57 AM (in response 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-85A61B6AB8DE 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
-
9. Re: AIR 3 ios sound issues
saariko Oct 18, 2011 10:22 AM (in response to saariko)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?
-
10. Re: AIR 3 ios sound issues
Colin Holgate Oct 18, 2011 10:26 AM (in response 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.
-
11. Re: AIR 3 ios sound issues
robobobo76 Nov 22, 2011 5:38 AM (in response to Colin Holgate)Its definatelly a bug. This works 100% using 2.6 or 2.7. However its broken using 3.0.
-
12. Re: AIR 3 ios sound issues
Colin Holgate Nov 22, 2011 5:48 AM (in response to robobobo76)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.
-
13. Re: AIR 3 ios sound issues
undereyes Nov 22, 2011 5:48 AM (in response 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.
-
14. Re: AIR 3 ios sound issues
robobobo76 Nov 22, 2011 6:10 AM (in response to undereyes)Would you be able to post a link to the native extension you are using ?
Much apriciated!
-
15. Re: AIR 3 ios sound issues
chris.campbell Nov 22, 2011 5:21 PM (in response to robobobo76)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
-
16. Re: AIR 3 ios sound issues
Colin Holgate Nov 22, 2011 5:36 PM (in response to chris.campbell)The bug number is 3003849, but I don't think it's somewhere that most people can see.
-
17. Re: AIR 3 ios sound issues
chris.campbell Nov 22, 2011 6:00 PM (in response 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
-
18. Re: AIR 3 ios sound issues
Colin Holgate Nov 22, 2011 6:12 PM (in response to chris.campbell)Ok, added it there too: https://bugbase.adobe.com/index.cfm?event=bug&id=3053008
-
19. Re: AIR 3 ios sound issues
chris.campbell Nov 22, 2011 6:18 PM (in response 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
-
20. Re: AIR 3 ios sound issues
undereyes Nov 23, 2011 12:28 AM (in response to saariko)I voted. Mainwhile when I have some time I upload my Native Extension for this issue.
-
21. Re: AIR 3 ios sound issues
saariko Nov 23, 2011 5:36 AM (in response to Colin Holgate)I also voted, and would like to see the (meanwhile) ANE solution too!! thanx
-
22. Re: AIR 3 ios sound issues
SarahNorthway Jan 27, 2012 6:06 PM (in response 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.
-
23. Re: AIR 3 ios sound issues
Colin Holgate Jan 28, 2012 2:18 AM (in response 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.
-
24. Re: AIR 3 ios sound issues
undereyes Feb 1, 2012 9:03 AM (in response 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.html
Be happy!
-
25. Re: AIR 3 ios sound issues
SarahNorthway Feb 1, 2012 12:47 PM (in response 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!
-
26. Re: AIR 3 ios sound issues
saariko Feb 2, 2012 3:42 AM (in response to undereyes)havn't implemented your ANE yet but according to skatc's post i'll say: THANK YOU! THANK YOU!
-
27. Re: AIR 3 ios sound issues
undereyes Feb 2, 2012 4:02 AM (in response 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)
-
28. Re: AIR 3 ios sound issues
snoopyhoff Feb 3, 2012 9:27 AM (in response 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.
-
29. Re: AIR 3 ios sound issues
SarahNorthway Feb 4, 2012 9:40 AM (in response 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.
-
30. Re: AIR 3 ios sound issues
undereyes Feb 6, 2012 1:29 AM (in response to snoopyhoff)you can use my Native Extension to do it: http://www.enriquedavid.es/adobe-native-extensions-ios-mute-button.html
-
31. Re: AIR 3 ios sound issues
paus akid Feb 17, 2012 3:11 PM (in response 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."
-
32. Re: AIR 3 ios sound issues
SarahNorthway Feb 18, 2012 10:16 AM (in response 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</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
-
33. Re: AIR 3 ios sound issues
paus akid Feb 22, 2012 12:46 PM (in response 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.
-
34. Re: AIR 3 ios sound issues
paus akid Feb 22, 2012 1:18 PM (in response 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.
-
35. Re: AIR 3 ios sound issues
SarahNorthway Feb 22, 2012 7:24 PM (in response 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:
-
36. Re: AIR 3 ios sound issues
paus akid Feb 23, 2012 1:02 PM (in response 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-project.zip
Thanks!
-
37. Re: AIR 3 ios sound issues
adijans Mar 4, 2012 7:43 PM (in response 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.




