AudioServicesPlaySystemSound not playing sounds

后端 未结 6 1759
隐瞒了意图╮
隐瞒了意图╮ 2021-02-20 14:44

I am playing a small .wav file using the AudioToolBox.

AudioServicesPlaySystemSound (soundFileObject);

But sometimes it is not playing.

6条回答
  •  心在旅途
    2021-02-20 15:11

    System Preferences → Sound → [x] Play user interface sound — this checkbox helped for me too, it solved the AudioServicesPlaySystemSound(_) issue. But worth noting was that the sample Apple Xcode project "SysSound" worked just fine without checking this box. I'm using the Xcode 4.4.1 for creating own app from scratch. Could there be differencies between projects created with older and newer Xcode tools?

提交回复
热议问题