-
-
Notifications
You must be signed in to change notification settings - Fork 243
Description
Developing Environment:
Xcode 26.0.1
axmol 2.8.1
Test Device:
iPhone SE
iOS 18.6.2
Hello Axmol community. Lately I've been working on my app's sound effects (I always do sound last). I generally work on my Mac but after upgrading Xcode and iOS, I tested the app on my iPhone and found that many of the sounds begin with a harsh crackle. Also, intermittently, a sound will restart playing. None of this occurs on the Mac, only on the phone.
The crackle occurs at the beginning of the sound. Some sounds are worse than others. If the sound is set to repeat, the crackle only occurs at the first iteration. I emailed one of the crackly sounds to myself, downloaded it to my phone, and played it from the Files app. It played without crackling so this looks like an Axmol issue. After various tests, I came to the conclusion that our sound engine starts playing a sound at about the 25 millisecond mark. If a sound's waveform is near zero at that point, then the sound plays somewhat normally but if the waveform is near a crest at the 25 ms mark, then the speaker membrane has to go from 0 to 60 mph in 0 seconds and smashes against the casing, causing a crackle. As a workaround, I've added 25 ms of silence to the beginning of my sound files after which they play perfectly.
The intermittent restarting of sound effects, I can't explain.
Steps to Reproduce:
- Create a new Axmol app.
- Add three sound effects to the resources, say "Bing", "Bong", and "Boing" (I use .mp3).
- Have the app play the sounds in repeating sequence, one sound every 0.75 seconds. Ex: "Bing... Bong... Boing... Bing... Bong... Boing... etc."
- Let the app run in the background as you do something productive. Before too long, you will hear a sound restart. Sometimes it restarts early. Ex: "B-Bing". Sometimes it restarts later. Ex: "Boin-Boing".
My theory is that the latest iOS breaks something in Axmol's sound engine. I hope someone can confirm and fix these issues. Thanks.