Skip to content

Commit

Permalink
feat: support bypass voice processing. (#595)
Browse files Browse the repository at this point in the history
* feat: support bypass voice processing.

* update.

* update pubspec.yaml.
  • Loading branch information
cloudwebrtc authored Oct 21, 2024
1 parent 4851525 commit 385ae8b
Show file tree
Hide file tree
Showing 5 changed files with 21 additions and 3 deletions.
4 changes: 4 additions & 0 deletions example/lib/pages/connect.dart
Original file line number Diff line number Diff line change
Expand Up @@ -47,6 +47,10 @@ class _ConnectPageState extends State<ConnectPage> {
if (lkPlatformIs(PlatformType.android)) {
_checkPermissions();
}

if (lkPlatformIsMobile()) {
LiveKitClient.initialize(bypassVoiceProcessing: true);
}
}

@override
Expand Down
2 changes: 1 addition & 1 deletion ios/livekit_client.podspec
Original file line number Diff line number Diff line change
Expand Up @@ -16,5 +16,5 @@ Pod::Spec.new do |s|
s.static_framework = true

s.dependency 'Flutter'
s.dependency 'WebRTC-SDK', '125.6422.04'
s.dependency 'WebRTC-SDK', '125.6422.05'
end
11 changes: 11 additions & 0 deletions lib/src/livekit.dart
Original file line number Diff line number Diff line change
Expand Up @@ -12,8 +12,19 @@
// See the License for the specific language governing permissions and
// limitations under the License.

import 'package:flutter_webrtc/flutter_webrtc.dart' as rtc;

/// Main entry point to connect to a room.
/// {@category Room}
class LiveKitClient {
static const version = '2.2.6';

/// Initialize the WebRTC plugin. If this is not manually called, will be
/// initialized with default settings.
/// This method must be called before calling any LiveKit SDK API.
static Future<void> initialize({bool bypassVoiceProcessing = false}) async {
await rtc.WebRTC.initialize(options: {
if (bypassVoiceProcessing) 'bypassVoiceProcessing': bypassVoiceProcessing,
});
}
}
2 changes: 1 addition & 1 deletion macos/livekit_client.podspec
Original file line number Diff line number Diff line change
Expand Up @@ -16,5 +16,5 @@ Pod::Spec.new do |s|
s.static_framework = true

s.dependency 'FlutterMacOS'
s.dependency 'WebRTC-SDK', '125.6422.04'
s.dependency 'WebRTC-SDK', '125.6422.05'
end
5 changes: 4 additions & 1 deletion pubspec.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -37,7 +37,10 @@ dependencies:
uuid: '>=3.0.6'
synchronized: ^3.0.0+3
protobuf: ^3.0.0
flutter_webrtc: ^0.11.7
flutter_webrtc:
git:
url: https://github.com/flutter-webrtc/flutter-webrtc.git
ref: feat/support-unprocessed-audio
device_info_plus: '>=8.0.0'
js: '>=0.6.4'
platform_detect: ^2.0.7
Expand Down

0 comments on commit 385ae8b

Please sign in to comment.