Skip to content

Commit 385ae8b

Browse files
authored
feat: support bypass voice processing. (#595)
* feat: support bypass voice processing. * update. * update pubspec.yaml.
1 parent 4851525 commit 385ae8b

File tree

5 files changed

+21
-3
lines changed

5 files changed

+21
-3
lines changed

example/lib/pages/connect.dart

Lines changed: 4 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -47,6 +47,10 @@ class _ConnectPageState extends State<ConnectPage> {
4747
if (lkPlatformIs(PlatformType.android)) {
4848
_checkPermissions();
4949
}
50+
51+
if (lkPlatformIsMobile()) {
52+
LiveKitClient.initialize(bypassVoiceProcessing: true);
53+
}
5054
}
5155

5256
@override

ios/livekit_client.podspec

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -16,5 +16,5 @@ Pod::Spec.new do |s|
1616
s.static_framework = true
1717

1818
s.dependency 'Flutter'
19-
s.dependency 'WebRTC-SDK', '125.6422.04'
19+
s.dependency 'WebRTC-SDK', '125.6422.05'
2020
end

lib/src/livekit.dart

Lines changed: 11 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -12,8 +12,19 @@
1212
// See the License for the specific language governing permissions and
1313
// limitations under the License.
1414

15+
import 'package:flutter_webrtc/flutter_webrtc.dart' as rtc;
16+
1517
/// Main entry point to connect to a room.
1618
/// {@category Room}
1719
class LiveKitClient {
1820
static const version = '2.2.6';
21+
22+
/// Initialize the WebRTC plugin. If this is not manually called, will be
23+
/// initialized with default settings.
24+
/// This method must be called before calling any LiveKit SDK API.
25+
static Future<void> initialize({bool bypassVoiceProcessing = false}) async {
26+
await rtc.WebRTC.initialize(options: {
27+
if (bypassVoiceProcessing) 'bypassVoiceProcessing': bypassVoiceProcessing,
28+
});
29+
}
1930
}

macos/livekit_client.podspec

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -16,5 +16,5 @@ Pod::Spec.new do |s|
1616
s.static_framework = true
1717

1818
s.dependency 'FlutterMacOS'
19-
s.dependency 'WebRTC-SDK', '125.6422.04'
19+
s.dependency 'WebRTC-SDK', '125.6422.05'
2020
end

pubspec.yaml

Lines changed: 4 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -37,7 +37,10 @@ dependencies:
3737
uuid: '>=3.0.6'
3838
synchronized: ^3.0.0+3
3939
protobuf: ^3.0.0
40-
flutter_webrtc: ^0.11.7
40+
flutter_webrtc:
41+
git:
42+
url: https://github.com/flutter-webrtc/flutter-webrtc.git
43+
ref: feat/support-unprocessed-audio
4144
device_info_plus: '>=8.0.0'
4245
js: '>=0.6.4'
4346
platform_detect: ^2.0.7

0 commit comments

Comments
 (0)