【发布时间】:2018-08-17 19:35:13
【问题描述】:
SystemSoundID soundID;
NSString *path = [[NSBundle mainBundle] pathForResource:@"static" ofType:@"caf"];
AudioServicesCreateSystemSoundID((CFURLRef)[NSURL fileURLWithPath:path], &soundID);
AudioServicesPlaySystemSound(soundID);
我已经在我的应用程序中实现了上述代码。
效果很好,但问题是我不知道如何阻止它。
即声音为 10 秒。
10 秒前。如果用户点击按钮,声音应该停止?我该怎么做?
【问题讨论】: