From 8a6086a5fcb6460ec18aafa4d995ae32ccc3391e Mon Sep 17 00:00:00 2001 From: Deepak Mittal <29124172+DeepakM02@users.noreply.github.com> Date: Mon, 14 Mar 2022 00:56:38 +0530 Subject: [PATCH 1/2] fix(iOS): Using default framelength (#361) * fix: using default framelength * try catch brackets * Remove logs * Update Voice.m clear logs and comments --- ios/Voice/Voice.m | 8 ++++++-- 1 file changed, 6 insertions(+), 2 deletions(-) diff --git a/ios/Voice/Voice.m b/ios/Voice/Voice.m index 0fc2af69..fd9dad85 100644 --- a/ios/Voice/Voice.m +++ b/ios/Voice/Voice.m @@ -163,6 +163,7 @@ - (void) setupAndStartRecognizing:(NSString*)localeStr { self.audioEngine = [[AVAudioEngine alloc] init]; } + @try { AVAudioInputNode* inputNode = self.audioEngine.inputNode; if (inputNode == nil) { [self sendResult:@{@"code": @"input"} :nil :nil :nil]; @@ -223,8 +224,6 @@ - (void) setupAndStartRecognizing:(NSString*)localeStr { @try { [mixer installTapOnBus:0 bufferSize:1024 format:recordingFormat block:^(AVAudioPCMBuffer * _Nonnull buffer, AVAudioTime * _Nonnull when) { //Volume Level Metering - //Buffer frame can be reduced, if you need more output values - [buffer setFrameLength: buffer.frameCapacity]; UInt32 inNumberFrames = buffer.frameLength; float LEVEL_LOWPASS_TRIG = 0.5; if(buffer.format.channelCount>0) @@ -272,6 +271,11 @@ - (void) setupAndStartRecognizing:(NSString*)localeStr { [self teardown]; return; } + } + @catch (NSException *exception) { + [self sendResult:@{@"code": @"start_recording", @"message": [exception reason]} :nil :nil :nil]; + return; + } } - (CGFloat)_normalizedPowerLevelFromDecibels:(CGFloat)decibels { From 8aee283f603bf834e148c2c7c7051bdec95ee9db Mon Sep 17 00:00:00 2001 From: semantic-release-bot Date: Sun, 13 Mar 2022 19:27:58 +0000 Subject: [PATCH 2/2] chore(release): 3.2.3 [skip ci] ## [3.2.3](https://github.com/react-native-voice/voice/compare/v3.2.2...v3.2.3) (2022-03-13) ### Bug Fixes * **iOS:** Using default framelength ([#361](https://github.com/react-native-voice/voice/issues/361)) ([8a6086a](https://github.com/react-native-voice/voice/commit/8a6086a5fcb6460ec18aafa4d995ae32ccc3391e)) --- package.json | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/package.json b/package.json index b592de2d..d13f246b 100644 --- a/package.json +++ b/package.json @@ -1,7 +1,7 @@ { "name": "@react-native-voice/voice", "description": "React Native Native Voice library for iOS and Android", - "version": "3.2.2", + "version": "3.2.3", "author": "Sam Wenke ", "private": false, "homepage": "https://github.com/react-native-voice/voice",