fulldecent / FDSoundActivatedRecorder

Start recording when the user speaks
MIT License
290 stars 64 forks source link

iPhone 5S woes #3

Closed DreamTimerZ closed 8 years ago

DreamTimerZ commented 10 years ago

Sync'd repo. Built and loaded on to iPhone 5S using iOS 7.1.1. Hit "Start" screen briefly flashes green and then immediately stops.

Verified app has microphone permissions.

Works fine in the simulator.

fulldecent commented 10 years ago

Is this still an issue on later versions?

DreamTimerZ commented 10 years ago

Yes. Just tried the latest.

Added a few NSLog statements that may help you out. Notice, it immediately stops recording in "interval".

2014-08-31 09:29:36.977 FDSoundActivatedRecorder[519:60b] Opened recording file for writing: file:///private/var/mobile/Applications/0E32DBDA-11DE-46EC-A9F6-52FA710AC57F/tmp/recording75ebd4b8.caf 2014-08-31 09:29:41.873 FDSoundActivatedRecorder[519:60b] Calling startListening 2014-08-31 09:29:41.999 FDSoundActivatedRecorder[519:60b] stopping because not recording (in interval) 2014-08-31 09:29:41.999 FDSoundActivatedRecorder[519:60b] stopListening: NO

fulldecent commented 10 years ago

I am still unable to reproduce this!

May I ask you to try this on iOS8 GM or when it is released. Thank you.

DreamTimerZ commented 10 years ago

Good morning,

Just tried it (again) on iOS8 GM. Same result (green flash and then nothing).

This is an iPhone 5S.

Added some NSLog statements to try to get you more info.

I also tried commenting out the check at the beginning of “interval” to see if it was just a timing problem but no joy (see second log trace). It didn’t “stop” but it wouldn’t respond to any external sound.

Here’s my log output.

Sequence of operation:

  1. Launch app in Xcode
  2. Press Start listening
  3. Get green flash
  4. Press Stop listening
  5. Press Play back

2014-09-16 06:41:00.183 FDSoundActivatedRecorder[381:64117] Opened recording file for writing: file:///private/var/mobile/Containers/Data/Application/15DDA200-E376-4AC2-9C91-55444DEB2FBC/tmp/recording16f870e2.caf 2014-09-16 06:41:04.078 FDSoundActivatedRecorder[381:64117] startListening 2014-09-16 06:41:04.186 FDSoundActivatedRecorder[381:64117] interval, self.audioRecorder.recording: NO 2014-09-16 06:41:04.187 FDSoundActivatedRecorder[381:64117] stopListeningAndKeepRecordingIfInProgress: NO 2014-09-16 06:41:08.012 FDSoundActivatedRecorder[381:64117] stopListeningAndKeepRecordingIfInProgress: NO

After commenting out check at the beginning of “interval”

2014-09-16 06:43:11.092 FDSoundActivatedRecorder[386:64870] Opened recording file for writing: file:///private/var/mobile/Containers/Data/Application/395DC5CA-DA1A-4A23-B57C-AA914317857B/tmp/recording92fb206d.caf 2014-09-16 06:43:14.840 FDSoundActivatedRecorder[386:64870] startListening 2014-09-16 06:43:14.961 FDSoundActivatedRecorder[386:64870] interval, self.audioRecorder.recording: NO 2014-09-16 06:43:14.961 FDSoundActivatedRecorder[386:64870] -120.00 0 0 0 0 2014-09-16 06:43:15.006 FDSoundActivatedRecorder[386:64870] interval, self.audioRecorder.recording: NO 2014-09-16 06:43:15.007 FDSoundActivatedRecorder[386:64870] -120.00 1 0 0 0 2014-09-16 06:43:15.056 FDSoundActivatedRecorder[386:64870] interval, self.audioRecorder.recording: NO 2014-09-16 06:43:15.057 FDSoundActivatedRecorder[386:64870] -120.00 2 0 0 0 2014-09-16 06:43:15.106 FDSoundActivatedRecorder[386:64870] interval, self.audioRecorder.recording: NO

And, it’s even a little weirder… note that this NSLog did NOT appear even though your “main” app does set the delegate...

if ([self.delegate respondsToSelector:@selector(soundActivatedRecorderDidStartRecording:)])
{
    NSLog(@"check for delegate respondsToSelector succeeded");
    [self.delegate soundActivatedRecorderDidStartRecording:self];
}

On Sep 15, 2014, at 3:08 PM, William Entriken notifications@github.com wrote:

I am still unable to reproduce this!

May I ask you to try this on iOS8 GM or when it is released. Thank you.

— Reply to this email directly or view it on GitHub.

qiaoyan commented 9 years ago

same result on iphone4s running ios8.1 , after click start it stopped immediately, with savefileURL = nil. Any idea?

2014-11-12 15:18:28.113 FDSoundActivatedRecorder[1856:178362] Opened recording file for writing: file:///private/var/mobile/Containers/Data/Application/C04C0F50-70BC-415F-9A28-0D5D7E9A36FE/tmp/recording283a15a2.caf 2014-11-12 15:18:39.894 FDSoundActivatedRecorder[1856:178362] Saving to /private/var/mobile/Containers/Data/Application/C04C0F50-70BC-415F-9A28-0D5D7E9A36FE/tmp/recordingConverted8a72c7ed.caf 2014-11-12 15:18:40.020 FDSoundActivatedRecorder[1856:178362] AVAssetExportSessionStatusFailed The operation could not be completed 2014-11-12 15:18:40.023 FDSoundActivatedRecorder[1856:178362] * Terminating app due to uncaught exception 'NSInvalidArgumentException', reason: '* -[NSURL initFileURLWithPath:]: nil string parameter' *\ First throw call stack: (0x2706dd67 0x348ccc77 0x2706dcad 0x27d05b5f 0x27d05adb 0xf0ff3 0x2a543427 0x2a5433c9 0x2a52dfcd 0x2a542df9 0x2a542ad3 0x2a53c3e1 0x2a512b5d 0x2a7864e3 0x2a51159f 0x270345e7 0x270339fb 0x27032079 0x26f7f981 0x26f7f793 0x2e358051 0x2a571981 0xf1609 0x34e68aaf) libc++abi.dylib: terminating with uncaught exception of type NSException

fulldecent commented 9 years ago

Sorry for the slow response. I have seen lots of things breaking on iOS8. Actually it seems a lot of this is related to XCode 6.1.

Do you have access to XCode 6.1.1, and if so could I bother you to try again with the new compiler?

Also, are you using any Swift in your project?

Thank you

dxcode commented 9 years ago

Hi!

I'm using XCode Version 5.1.1 (5B1008) and I'm having the same problem on iPhone 5S - no sound.

Any luck finding the fix?

Much appreciated

fulldecent commented 9 years ago

Thanks for the details on this. Wife just got a 5S, will check on hers. However this is iOS 8.

sri-omg commented 9 years ago

I think I ran into this same problem. The audioRecorder never starts recording so the interval timer immediately times out. Adding this to init before creating the audioRecorder fixed it:

AVAudioSession *audioSession = [AVAudioSession sharedInstance];
[audioSession setCategory:AVAudioSessionCategoryPlayAndRecord error:nil];
[audioSession setActive:YES error:nil];

See this answer: http://stackoverflow.com/questions/18922053/avaudiorecorder-avaudioplayer-with-ios-7-not-working-properly

fulldecent commented 9 years ago

Excellent, thanks for the advice. Would you like to take credit for this with a PR?