Forums
New posts
Articles
Product Reviews
Policies
FAQ
Log in
Register
What's new
Search
Search
Search titles only
By:
New posts
Menu
Log in
Register
Install the app
Install
Forums
macOS & iOS Developer Playground
iOS Development
AVAudioPlayer lag issue?
JavaScript is disabled. For a better experience, please enable JavaScript in your browser before proceeding.
You are using an out of date browser. It may not display this or other websites correctly.
You should upgrade or use an
alternative browser
.
Reply to thread
Message
<blockquote data-quote="SoulRed12" data-source="post: 1615145" data-attributes="member: 146412"><p>I have a sound setup that uses AVAudioPlayer. Unfortunately there is always a slight (half second) pause/lag just before the first sound is played. Any sound can get the lag as long as it is the first sound played since the app was first opened. (And it happens again if you swipe the app closed from multitasking, and then open it again.) On the simulator the lag is much longer than it is when just run on my iPad 2.</p><p></p><p>Any idea what's causing this and how I can stop it from happening?</p><p></p><p>Extra info:</p><p></p><p>The code makes a singleton class called SoundsController that makes a dictionary of strings to correspond to sound file names, and has a method called playSound that creates an AVAudioPlayer object, adds it to an array object (which is a class property), and then implements the audioPlayerDidFinishPlaying method to remove the AVAudioPlayer from the array so it can be released.</p></blockquote><p></p>
[QUOTE="SoulRed12, post: 1615145, member: 146412"] I have a sound setup that uses AVAudioPlayer. Unfortunately there is always a slight (half second) pause/lag just before the first sound is played. Any sound can get the lag as long as it is the first sound played since the app was first opened. (And it happens again if you swipe the app closed from multitasking, and then open it again.) On the simulator the lag is much longer than it is when just run on my iPad 2. Any idea what's causing this and how I can stop it from happening? Extra info: The code makes a singleton class called SoundsController that makes a dictionary of strings to correspond to sound file names, and has a method called playSound that creates an AVAudioPlayer object, adds it to an array object (which is a class property), and then implements the audioPlayerDidFinishPlaying method to remove the AVAudioPlayer from the array so it can be released. [/QUOTE]
Verification
What is Apple's smallest desktop computer called?
Post reply
Forums
macOS & iOS Developer Playground
iOS Development
AVAudioPlayer lag issue?
Top