1

我正在使用 TWTweetComposeViewController 来撰写推文。

然后我以这种方式手动发送推文:https ://stackoverflow.com/a/14067278/440168

如何播放标准的“已发送推文”声音通知?

4

1 回答 1

2

这个声音很相似:http ://soundjax.com/reddo/51828%5EWHISTLE.mp3

你可以这样玩:

NSError *error;
NSString *path        = [NSString stringWithFormat:@"%@/%@", NSBundle.mainBundle.resourcePath, @"whistle.mp3"];
NSUrl *url            = [NSURL fileURLWithPath:path isDirectory:NO];
AVAudioPlayer *player = [[AVAudioPlayer alloc] initWithContentsOfURL:self.whistleUrl error:&error];

player.numberOfLoops = 0;
player.volume        = 0.4;

if (player == nil) {
    NSLog(@"%@", error.description);
    return;
}

[player play];
于 2013-03-08T20:42:08.330 回答