Ignore:
Timestamp:
10/21/13 07:25:15 (6 years ago)
Author:
Steve Castellotti <sc@…>
Branches:
master, Servo
Children:
ac05196
Parents:
0d2b1fc
Message:

iOS:

  • Signal generation update by Hao Zhang
File:
1 edited

Legend:

Unmodified
Added
Removed
  • iOS/Orbit/Orbit/SignalConverter.m

    r3434fbc rc9b9edd  
    5151        AudioSessionInitialize(NULL, NULL, NULL, NULL); 
    5252        AudioSessionSetActive(YES); 
     53         
     54#if USE_AUDIO_GENERATOR 
     55        audioPlayer = [[AudioGenerator alloc] init]; 
     56#endif 
    5357    } 
    5458    return self; 
     
    230234    if (!running && !testing) { 
    231235        testing = YES; 
     236#if USE_AUDIO_GENERATOR 
    232237        // Generate Sound 
    233         //        [audioPlayer playWithThrottle:throttle yaw:yaw pitch:pitch]; 
    234          
     238        [audioPlayer playWithThrottle:throttle yaw:yaw pitch:pitch]; 
     239#else 
    235240        // Play WAV 
    236241        [self prepareAudio]; 
    237242        [audioPlayer play]; 
     243#endif 
    238244    } 
    239245} 
     
    277283    throttle = t; 
    278284    pitch = p; 
     285     
     286    [audioPlayer playWithThrottle:throttle yaw:yaw pitch:pitch]; 
    279287} 
    280288 
     
    286294    if ([self currentPowerLevel] > 0) { 
    287295         
     296#if USE_AUDIO_GENERATOR 
     297        // Generate Signal 
     298        [audioPlayer playWithThrottle:throttle yaw:yaw pitch:pitch]; 
     299#else 
    288300        audioPlayer.volume = 1.0; 
    289          
    290         // Generate Signal 
    291 //        [audioPlayer playWithThrottle:throttle yaw:yaw pitch:pitch]; 
    292          
     301 
    293302        // Play WAV 
    294303        [self prepareAudio]; 
    295304        [audioPlayer play]; 
     305#endif 
    296306         
    297307    } else { 
     
    333343- (void) prepareAudio 
    334344{ 
     345#if USE_AUDIO_GENERATOR 
     346#else 
    335347    NSURL *audioFilePath = [[NSBundle mainBundle] URLForResource:AUDIO_FILE_NAME withExtension:nil]; 
    336348     
     
    343355        [audioPlayer prepareToPlay]; 
    344356    } 
     357#endif 
    345358} 
    346359 
Note: See TracChangeset for help on using the changeset viewer.