mirror of
https://github.com/scratchfoundation/scratchjr.git
synced 2024-11-29 02:25:39 -05:00
Do not throw exception when app moves to background during audio recording. Resolves GH-91
This commit is contained in:
parent
3d6e015a6b
commit
c2da808405
1 changed files with 2 additions and 3 deletions
|
@ -29,8 +29,9 @@ NSString *canRecord;
|
||||||
+ (double) getVolume{
|
+ (double) getVolume{
|
||||||
if (recordingKilled) {
|
if (recordingKilled) {
|
||||||
recordingKilled = FALSE;
|
recordingKilled = FALSE;
|
||||||
@throw [NSException exceptionWithName:@"RecordException" reason:@"app went to background" userInfo:nil];
|
return 0;
|
||||||
}
|
}
|
||||||
|
|
||||||
[recorder updateMeters];
|
[recorder updateMeters];
|
||||||
const double ALPHA = 0.05;
|
const double ALPHA = 0.05;
|
||||||
double peakPowerForChannel = pow(10, (0.05 * [recorder peakPowerForChannel:0]));
|
double peakPowerForChannel = pow(10, (0.05 * [recorder peakPowerForChannel:0]));
|
||||||
|
@ -44,9 +45,7 @@ NSString *canRecord;
|
||||||
recordingKilled = TRUE;
|
recordingKilled = TRUE;
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|
||||||
// Init audio with record capability
|
// Init audio with record capability
|
||||||
|
|
||||||
+ (NSString*)startRecord{
|
+ (NSString*)startRecord{
|
||||||
recordingKilled = FALSE;
|
recordingKilled = FALSE;
|
||||||
recorder = nil;
|
recorder = nil;
|
||||||
|
|
Loading…
Reference in a new issue