mirror of
https://github.com/scratchfoundation/scratchjr.git
synced 2025-02-17 17:01:12 -05:00
Merge pull request #94 from thisandagain/bugfix/91
Do not throw exception when backgrounding app during audio recording
This commit is contained in:
commit
6de70fd6ba
1 changed files with 2 additions and 3 deletions
|
@ -29,8 +29,9 @@ NSString *canRecord;
|
|||
+ (double) getVolume{
|
||||
if (recordingKilled) {
|
||||
recordingKilled = FALSE;
|
||||
@throw [NSException exceptionWithName:@"RecordException" reason:@"app went to background" userInfo:nil];
|
||||
return 0;
|
||||
}
|
||||
|
||||
[recorder updateMeters];
|
||||
const double ALPHA = 0.05;
|
||||
double peakPowerForChannel = pow(10, (0.05 * [recorder peakPowerForChannel:0]));
|
||||
|
@ -44,9 +45,7 @@ NSString *canRecord;
|
|||
recordingKilled = TRUE;
|
||||
}
|
||||
|
||||
|
||||
// Init audio with record capability
|
||||
|
||||
+ (NSString*)startRecord{
|
||||
recordingKilled = FALSE;
|
||||
recorder = nil;
|
||||
|
|
Loading…
Reference in a new issue