Posted By

oppey on 05/23/11


Tagged


Versions (?)

AVAudioPlayerボリュームをフェードアウト


 / Published in: Objective C
 

  1. -(void)doVolumeFade
  2. {
  3. if (audio.volume > 0.1) {
  4. audio.volume = audio.volume - 0.1;
  5. [self performSelector:@selector(doVolumeFade) withObject:nil afterDelay:0.5];
  6. } else {
  7. // Stop and get the sound ready for playing again
  8. [audio stop];
  9. audio.currentTime = 0;
  10. [audio prepareToPlay];
  11. audio.volume = 1.0;
  12. }
  13. }
  14.  
  15.  
  16. //あるいは---------------------------------
  17. while (theAudio_gLead1.volume > 0.0) {
  18. [self performSelector:@selector(reduceGLead1_Volume) withObject:nil afterDelay:0.1];
  19. NSLog(@"%f", theAudio_gLead1.volume);
  20. }

Report this snippet  

You need to login to post a comment.