We have collected the most relevant information on Avaudioplayer Problem. Open the URLs, which are collected below, and you will find all the info you are interested in.
How to fix the common "no sound from AVPlayer ...
https://www.globalnerdy.com/2015/07/06/how-to-fix-the-common-no-sound-from-avplayer-avaudioplayer-problem-in-ios-swift-programming/#:~:text=Once%20again%3A%20the%20answer%20to%20the%20problem%20is,as%20long%20as%20the%20view%20controller%20instance%20does.
objective c - avaudioplayer problem - Stack Overflow
https://stackoverflow.com/questions/5570551/avaudioplayer-problem
i've got a problem with avaudioplayer. i've got a method that plays the music: -(void)playBgMusic { NSString *path = [[NSBundle mainBundle] pathForResource:@"bgmusic ...
How to fix the common "no sound from AVPlayer ...
https://www.globalnerdy.com/2015/07/06/how-to-fix-the-common-no-sound-from-avplayer-avaudioplayer-problem-in-ios-swift-programming/
Once again: the answer to the problem is that your AVPlayer or AVAudioPlayer instance needs to be scoped at the view controller level, and not at the level of a method. That way, the player exists as long as the view controller instance does.
AVAudioPlayer problems Swift 2.0 | Apple Developer …
https://developer.apple.com/forums/thread/19902
AVAudioPlayer problems Swift 2.0 . You’re now watching this thread and will receive emails when there’s activity. Click again to stop watching or visit your profile/homepage to manage your watched threads.
AVAudioPlayer doesn't load sound
https://www.py4u.net/discuss/1363799
The problem is that you are using ARC, and therefore that the AVAudioPlayer is deallocated when the variable goes out of scope. You have to declare the theAudio variable as an instance variable, and assign it in the viewDidLoad. So, in your .h file:
Now you know Avaudioplayer Problem
Now that you know Avaudioplayer Problem, we suggest that you familiarize yourself with information on similar questions.