[Closed] Can a sound file cause another sound file to become muted on iOS device?

I am utterly puzzled and would like to know why this happens.

I have two sound effect files (sound A & D), and they both play fine on Simulator. However, when I generate a device build, D plays but A doesn’t.

What’s strange is that A does play on device without any problem if D is not to be played on device. Meaning, if I comment out the line that plays D, I can hear A. But when I allow D to play, A no longer plays.

The thing is, A and D do not play at the same time. I press a button associated with D, and D plays. When I press a button associated with A, A does not play, or simply it gets muted (when I have both A & D uncommented in the code.) However, if I comment out the button action for D (meaning, D is bundled with the project but there’s no line of code in the project that allows the D to play), pressing a button for A plays A.

Both A and D are aac files, and they were generated exactly the same way (that is, converting wav files to aac file format via iTunes.)

With my new project, I only have four sound files (A, B, C & D) so far, and B & C are not affected. It’s some bizarre conflict that suddenly appeared after I added D. (I added files in the order of A, B, C then D to the project.)

Does anyone have any insight as to what might cause something like this to happen? Is avoiding the use of D my only solution (meaning, do I need to look for another sound file and hope it doesn’t conflict with A, B or C)…?

Something like this did not happen in my previous project where I had a couple dozen sound files. I just don’t understand why this is happening now.

I’d appreciate any and all help and insights regarding this. (I don’t think it has anything to do with the build, but just in case, I’m using daily build 827 on Mac.)

Edit: Here’s an additional info. In my project, D has to be played first before A would ever be triggered. In fact, D has to be played before A, B or C ever gets played. However, B and C play without any problem, while A gets muted. A doesn’t get muted when playing D is removed (commenting out) from the code.

Edit2: As an experiment, I edited the code so that in place of A, it would play B, and B does not get muted. It’s only A that gets muted when D is involved. What could cause something like this to happen?

Naomi

[import]uid: 67217 topic_id: 27040 reply_id: 327040[/import]

That’s very strange. If this is Mac and iOS, the audio code for the two are virtually identical (shared code base). Could be an Apple bug if this works correctly on Windows and Android too.

The only thing I can think of:

  • You are passing a handle instead of channel or vice-versa (this came up twice in the past day) and random memory addresses are different on device/desktop so things behave differently when they don’t crash.

  • Something may be changing the volume like audio.fadeOut. Try resetting the channel volume to 1.0 when you play the next sample.

  • Try using a different file for D. Maybe there is something funny about the way D is encoded which is triggering a bug (likely an Apple bug). [import]uid: 7563 topic_id: 27040 reply_id: 109818[/import]

Thank you, Eric! I finally found another sound effect for D that feels good. A, B and C play along with it without any problem.

So it could be something to do with the previous D being encoded in a way it conflicts with A. As I noted, it conflicts only with A. B and C are never affected. Strange.

When searching for D replacement, I tried a dozen new sound files, and it felt like half of them had the same problem – and I just couldn’t see why this happens with certain sound files. Sound plays perfectly fine on Simulator. The problem manifests itself only on iOS device. And the problem manifest itself only with A (not D). I just don’t want to replace A (event if it’s not D but A that is causing the problem.)

Anyhow, I’m pretty happy with the new D sound, so I’ll just have to move on at this point.

Thanks again for your thoughts. If/when I find a pattern that can give me any sort of definitive clue, I’ll post here.

Naomi
[import]uid: 67217 topic_id: 27040 reply_id: 109822[/import]

Please, please! File a bug with Apple about this. Attach the working case and the broken case where only changing the file makes a difference.

[import]uid: 7563 topic_id: 27040 reply_id: 109824[/import]

So, Eric, how do I go about filing test case with Apple?

I’ve filed a bug with Apple before, so I know where I need to go to file it, but… do I file a zipped Corona test project folder like I might file with Ansca… but will Apple use Corona SDK to test this case? Or do I just describe the issue accompanied with the sound files in question…? Or do I compile a device build… but using what provisioning profile…? Hmmm… I’m not sure.

Naomi [import]uid: 67217 topic_id: 27040 reply_id: 109827[/import]

Please describe the issue in detail. Emphasize that it works fine on Mac but has a problem on iOS and you’ve been told that the code is virtually identical on both platforms (OpenAL+CoreAudio for decoding).

Send them two compiled/built binaries with the only change being that one app has the bad audio file and the other has the good file. It doesn’t matter which provisioning profile (just pick Developer). Apple has the ability to run anything.

You should also send them all the audio files in use.

It wouldn’t hurt to include the Corona project folder with everything either. I doubt they will look at that, but the more information you give them, the more likely they are going to look seriously at the problem.

You may also say you are using Corona and you may mention that they may contact me (Eric Wing) if they need more information. Most of the Core Audio team knows who I am from the numerous bugs I file.
[import]uid: 7563 topic_id: 27040 reply_id: 109833[/import]

OT:
I opened this thread to se if I could find out why Audio.Play would stop music that the user is playing on their iPad.

(The reason for a bug report received from a user excitingly titled:
‘You app killed Michael Buble’)
[import]uid: 108660 topic_id: 27040 reply_id: 109834[/import]

jeff472: Please look up the (advanced) Audio Session APIs. A link can be found to the forum thread on the Audio Notes page.
[import]uid: 7563 topic_id: 27040 reply_id: 109837[/import]

Hey, Eric, a quick note to let you know that I haven’t forgotten this. I will file a bug with Apple as soon as I generate a test project and check it on a device that has the latest version of iOS. (FWIW, I was working with iOS 5.1 device.)

BTW, I saw the blog post encouraging everyone to report & file bug(s) with Apple:

http://blog.anscamobile.com/2012/06/a-complete-guide-to-filing-bugs-with-apple/

Thank you for prompting us to take action.

Naomi [import]uid: 67217 topic_id: 27040 reply_id: 110715[/import]

Thanks for mentioning the blog post. Please continue to spread the word. It’s an ongoing thing.

[import]uid: 7563 topic_id: 27040 reply_id: 110763[/import]