Monday, 16 August 2010

Introducing Delay


hi all,

working audio player application, here having upto 15 songs collected names array , playing 1 one following,

- (void)audioplayerdidfinishplaying:(avaudioplayer *)player successfully:(bool)flag
{

if(prayerarray != nil)
{

int totalprayersinqueue = [prayerarray count];
if(currentplayingsongindex < totalprayersinqueue-1 )
{

currentplayingsongindex++;
nsstring *sound = [prayerarray objectatindex:currentplayingsongindex];
avaudioplayer *player = [[avaudioplayer alloc] initwithcontentsofurl:[nsurl fileurlwithpath:[[nsbundle mainbundle]
pathforresource:sound oftype:mad:"mp3"]] error:nil];
player.delegate = self;
self.audioplayer = player;
[player release];

// set timer keep getting current music time , update uislider in 1 sec interval
progresstimer = [nstimer scheduledtimerwithtimeinterval:1.0 target:self selector:mad:selector(updateslider) userinfo:nil repeats:yes];


// set maximum value of uislider
progressslider.maximumvalue = audioplayer.duration;

//nslog(@"current song duration %i",intvalue(audioplayer.duration));

// set valuechanged target
[progressslider addtarget:self action:mad:selector(sliderchanged:) forcontrolevents:uicontroleventvaluechanged];

// play audio
[audioplayer preparetoplay];
[audioplayer play];

}
else {

[playbutton setimage:[uiimage imagenamed:mad:"play_icon.png"] forstate:uicontrolstatenormal];
}

}


}


here want introduce delay of 15 seconds between each songs, there way , how inside delegate method.

in advance.

regards
sakthi
 



Forums iPhone, iPad, and iPod Touch iPhone iPhone


  • iPhone
  • Mac OS & System Software
  • iPad
  • Apple Watch
  • Notebooks
  • iTunes
  • Apple ID
  • iCloud
  • Desktop Computers
  • Apple Music
  • Professional Applications
  • iPod
  • iWork
  • Apple TV
  • iLife
  • Wireless

No comments:

Post a Comment