停止声音我使用下面的代码来播放声音如何在按下一个按钮
NSString *laughSoundPath = [[NSBundle mainBundle]pathForResource:@"laugh" ofType:@"wav"];
NSURL *laughURL = [[NSURL alloc]initFileURLWithPath:laughSoundPath];
laughTone = [[AVAudioPlayer alloc]initWithContentsOfURL:laughURL error:nil];
[laughTone prepareToPlay];
[laughTone setDelegate:self];
[laughURL release];
-(IBAction)play
{
[laughTone play];
}
我使用下面的行停止声音
-(IBAction)stop
{
[laughTone stop];
}
问题是..当我再次播放声音,它从停止的地方开始..我的意思是说它的工作暂停..帮我出去
都能跟得上它不工作 – Shreedhar 2012-02-22 06:14:34
@Shreedhar:好的编辑试试吧。 – Dair 2012-02-22 06:20:45