iOS Simulator does not play sound

前端 未结 3 546
傲寒
傲寒 2021-01-20 20:53

On XCode 6, everything works well on device, but on simulator, sound is not played.

There is my swift code :

var url =  NSURL(string: \"http://my.ur         


        
3条回答
  •  死守一世寂寞
    2021-01-20 21:54

    The error occurs because you are trying to get device's sample rate from simulator, which is not possible.

    Because simulator is not a hardware. Its a software.

    So some hardware functionality will not able to simulated with it.

    It can not do the following:

    1. Open Camera
    2. Play sounds
    3. Gyrometer
    4. Accelerometer
    5. Shake effect
    6. Receive push notifications

    And many more which required device hardware acceleration.

    You need to test this in real device.

提交回复
热议问题