objective c - Sound Effect Not Playing -
objective c - Sound Effect Not Playing -
i implementing audiotoolbox framework seek play sound effect. here code: declared systemsoundid called explode
nsurl *explodeurl = [nsurl fileurlwithpath:[[nsbundle mainbundle] pathforresource:@"explosion" oftype:@"wav"]]; audioservicescreatesystemsoundid((__bridge cfurlref) explodeurl, explode); [self performselector:@selector(playsfx) withobject:nil afterdelay:2.0]; -(void)playsfx { audioservicesplaysystemsoundid(explode) } but reason sound never plays.
you're calling audioservicescreatesystemsoundid, doesn't play sound, creates id it. utilize audioservicesplaysystemsound(explode);.
objective-c ios xcode audio audiotoolbox
Comments
Post a Comment