+ if ( tim == 60 ) {
+ // introduce an envelope for our engine noise after 10 seconds
+
+ pitch_envelope.setStep ( 0, 0.0, 1.0 ) ;
+ pitch_envelope.setStep ( 1, 5.0, 2.0 ) ;
+ pitch_envelope.setStep ( 2, 10.0, 1.0 ) ;
+
+ p_envelope.setStep ( 0, 5.0, 2.0 ) ;
+
+ volume_envelope.setStep ( 0, 0.0, 1.0 ) ;
+ volume_envelope.setStep ( 1, 5.0, 2.0 ) ;
+ volume_envelope.setStep ( 2, 10.0, 1.0 ) ;
+
+ // scheduler -> playSample ( my_sample ) ;
+ sched.addSampleEnvelope( s, 0, 0, &p_envelope, SL_PITCH_ENVELOPE );
+ sched.addSampleEnvelope( s, 0, 1, &volume_envelope, SL_VOLUME_ENVELOPE);
+ }
+
+