iphone - SystemSoundID Sometimes Changing With Device Volume -
i playing sound effects in game using systemsoundid
class, odd results. few of sounds, including landed1
below, change volume according volume buttons, others, deathsound
play @ full volume. below code related 2 sounds.
systemsoundid deathsound; systemsoundid landed1;
...
nsurl *soundurl;
soundurl = [[nsbundle mainbundle] urlforresource:@"smpklanded1" withextension:@"mp3"]; audioservicescreatesystemsoundid ((__bridge cfurlref) soundurl, &landed1); soundurl = [[nsbundle mainbundle] urlforresource:@"smpkdeathsound" withextension:@"mp3"]; audioservicescreatesystemsoundid ((__bridge cfurlref) soundurl, &deathsound);
...
audioservicesplaysystemsound(landed1);
...
audioservicesplaysystemsound(deathsound);
why 2 act differently, if code , filetype same? makes no sense!
well, figured out, after inordinate amounts of time driving myself crazy. of them being played @ same time avaudioplayer
, reason made them conform volume buttons, , weren't. obvious next step make silent avaudioplayer
, have done, , program works expect.
as follow question, have clue why having avaudioplayer
affects systemsoundids
?
Comments
Post a Comment