Skip to content
Browse files

Revert "Merge pull request #1880 from cerupcat/master"

This reverts commit 2d62d2e, reversing
changes made to eb45d59.
  • Loading branch information...
1 parent 2d62d2e commit 3d7d8d6d597b235eef8e6b681f90025bd4ce1b2b @ofTheo ofTheo committed
View
5 addons/ofxiPhone/src/sound/ofxiPhoneSoundStream.h
@@ -4,7 +4,6 @@
#include "ofBaseSoundStream.h"
#include "ofTypes.h"
-#import <AudioToolbox/AudioToolbox.h>
class ofxiPhoneSoundStream : public ofBaseSoundStream{
@@ -33,9 +32,7 @@ class ofxiPhoneSoundStream : public ofBaseSoundStream{
int getNumInputChannels();
int getNumOutputChannels();
-
- static AudioUnit audioUnit;
-
+
private:
long unsigned long tickCount;
int nInputChannels;
View
20 addons/ofxiPhone/src/sound/ofxiPhoneSoundStream.mm
@@ -24,7 +24,7 @@
static bool isSetup = false;
static bool isRunning = false;
AudioStreamBasicDescription format, audioFormat;
-AudioUnit ofxiPhoneSoundStream::audioUnit = NULL;
+AudioUnit audioUnit = NULL;
AudioBufferList inputBufferList; // input buffer
static ofBaseSoundInput * soundInputPtr = NULL;
static ofBaseSoundOutput * soundOutputPtr = NULL;
@@ -68,22 +68,10 @@ bool checkStatus(OSStatus error) {
// called when the audio system is interrupted (backgrounded, etc)
static void rioInterruptionListener(void *inClientData, UInt32 inInterruption) {
- ofxiPhoneSoundStream * rio = (ofxiPhoneSoundStream *)inClientData;
-
- if(inInterruption == kAudioSessionBeginInterruption){
+ if(inInterruption == kAudioSessionBeginInterruption)
ofLog(OF_LOG_VERBOSE, "ofxiPhoneSoundStream: Audio session interrupted");
-
- AudioOutputUnitStop( rio->audioUnit );
- }
- else if(inInterruption == kAudioSessionEndInterruption){
+ else if(inInterruption == kAudioSessionEndInterruption)
ofLog(OF_LOG_VERBOSE, "ofxiPhoneSoundStream: Audio session resumed");
-
- if(isRunning){
- // make sure we are again the active session
- AudioSessionSetActive( true );
- AudioOutputUnitStart( rio->audioUnit );
- }
- }
}
static OSStatus playbackCallback(void *inRefCon,
@@ -135,7 +123,7 @@ static OSStatus recordingCallback(void *inRefCon,
ioData = &inputBufferList;
// obtain recorded samples
- OSStatus status = AudioUnitRender(ofxiPhoneSoundStream::audioUnit, ioActionFlags, inTimeStamp, 1, inNumberFrames, ioData);
+ OSStatus status = AudioUnitRender(audioUnit, ioActionFlags, inTimeStamp, 1, inNumberFrames, ioData);
if(checkStatus(status)) {
ofLog(OF_LOG_ERROR, "ofxiPhoneSoundStream: Couldn't render input audio samples");
return status;

0 comments on commit 3d7d8d6

Please sign in to comment.
Something went wrong with that request. Please try again.