Sound Plays on iPhone but not in simulator - ios

I have an app that works completely fine on several different iPhones(5s,6,6s) with different iOS versions but doesn't play sound on simulator(simulator plays sound on safari but not in app).I don't think i have any coding issue such an initialize or such things because it works fine in physical device.
please help me out.
I've used AVAudioPlayer.
I've checked out all of the answers in the following link but it didn't work
for me. Sound not working in iPhone Simulator?
I use Xcode Version 9.4.1 and iOS 11.4 on simulator

Related

iOS Simulator "Now Playing" screen missing

I had developed my app for iOS 9+ devices few months back and at that time MPNowPlayingInfoCenter was working as expected. But recently I updated my XCode also to latest 9.3 and due to some Pods library being updated I had to change the Deployment Target to 10.0. Since then the MPNowPlayingInfoCenter stops working and never shows up on lock screen on any Simulator devices.
MPNowPlayingInfoCenter.default().nowPlayingInfo = [
MPMediaItemPropertyTitle: self.playerItem.title.br2Sp.stripTags,
MPMediaItemPropertyArtist: self.playerItem.artist.br2Sp.stripTags,
MPNowPlayingInfoPropertyPlaybackRate: player.rate
]
Any idea what has changed since then?
P.S. By stops working I mean that my above code no longer displays the Now Playing info on lock screen.
After searching a lot, I finally came to know that iOS Simulator v11.3 does not have support yet for Control Panel and it shows a frosted screen without any controls. I have downloaded iOS Simulator v10.3.1 and its now showing up.

HTML5 video doesn't play on iOS 10.2 on iPad 4th generation

I met a weird situation. Our iOS app embedded a video in a simple HTML 5 page, and we load it using javascript and UIWebView. It has been working fine until the upgrade of iOS 10.2, and it works fine on all other models of iPads but iPad 4th generation on 10.2. The video just cannot play. The 'play' event never fires. I did some preliminary research. I know iPad 4 is a 32-bit machine. I'm not sure if this has something to do with the weird behavior.
I don't know if this might be a relevant answer, but I had a similar situation when trying to play a video using AVPlayer.
It worked perfectly fine previously on iOS 8 and iOS 9, upgrade to iOS 10.2 and it worked on the simulator but not on devices.
Then I came across this link
h.264 MP4 Playable on iOS 9 No Longer Playable on iOS 10
From reading further, I see the following statements:
There has been a changed in how iOS validates video files.
In our case, we were encoding h.264 video with mp3 audio codec.
iOS 9 had no problem with the video files. iOS 10 does not like them and gave this error when trying to save to the camera roll "Sorry, this type of video cannot be saved to this device"
To fix my error, I just opened the video in Quicktime Player. I then went to File -> Export -> 1080p and then when I used this version of the video, it played in my app using iOS 10.2
Maybe your situation is different, but this helped in my experience.

No sound on some devices

I have a soundboard app that uses an AVAudioSession. I attach AVAudioPlayerNodes to an AVAudioEngine to play the audio files.
Everything works great on iOS 9.2, however a lot of my reviews say the sound doesn't work. And I just tried on an iPhone 5s running iOS 8 and the sounds do not work.
I cannot figure out why this is, given the app worked fine before I updated it. And I did not make any major changes to how the sound is produced. Is there any compatibility issues with AVFoundation and iOS8 or older devices I am not aware of?
Update: When I decreased the number of nodes attached to my engine, the sound works again. It seems some devices can't handle the amount of nodes I am attaching? Wondering if a workaround for this would be to make multiple engine objects instead of just one?

Cant't recognize touch on iOS, but on Android and Mac it's ok

I'm trying to deploy my Unity app on the iPhone, but there is a problem. I have one scene, where you are clicking on objects and the objects playing sounds after click. Everything is going just fine on the Android device and the Mac, but on iPhone it seems like it's not listening to the touches on the screen. I have tested this on the iPhone 4G, iPhone 5S and iPad air 3, all with the same results.
This problem occurred yesterday, before that it was fine on all tested platforms.
What might the problem be?

AudioServicesCreateSystemSoundID causing volume does not change using physical volume control buttons on iPad

I am in urgent need of the the geeks present on this forum regarding the iOS SDK questions.I have an app in which i hav to play multiple sounds simultaneously.I started with AVAudioplayer class but i realise that it was getting hung on iPhone 3gs and older iOS versions so i moved to AudioServicesCreateSystemSoundID((CFURLRef)afUrl,&soundID) from the tips of one of my friend.Now the app plays sound seamlessly on both iPhone and iPad .I have an iPhone 4S with iOS 5.1.1 and i have updated the Ipad 2 from iOS 5.1.1 to latest iOS 6.0 stable.Now the problem is that the app runs fine on iPhone but on iPad a strange issue comeing up.On iPad sound is played but the volume does not change with Physical volume change button effect.I have build the app using Xcode 4.5 GM with iOS 6.0 and have set the deployment target to iOS 5.0 .
Please help me out as i am getting crazy on this strange behavior on Ipad only ..I hope i would definitely get the perfect solution here from you guys !!
Thanks in Advance !!!!

Resources