ios - Objective-C - Trying to play sound -


i trying play sound in app following code:

nsstring *soundfilepath = [[nsbundle mainbundle] pathforresource:@"errorbeep.wav" oftype:@"m4a"];         nsurl *soundfileurl = [nsurl fileurlwithpath:soundfilepath];          avaudioplayer *player = [[avaudioplayer alloc] initwithcontentsofurl:soundfileurl                                                                        error:nil];         player.numberofloops = -1; //infinite          [player play]; 

but sound not play :(

after debugging, can see soundfilepath nil here screenshot of resources file:

enter image description here

you should import file project 1 extension. thats what's going on. re-import file 1 extension (i.e, errorbeep.m4a)


Comments

Popular posts from this blog

xml - Extract substrings with XSLT -

math - "ELO Rating" and how does "TSR Rating" work? -

How can do a tuple comparison in coffeescript similar to that in python? -