Skip to content

Commit

Permalink
Let developers manage audioLevel extraction
Browse files Browse the repository at this point in the history
  • Loading branch information
mekya committed Jun 1, 2024
1 parent bdd8f09 commit c3198b1
Show file tree
Hide file tree
Showing 6 changed files with 1,346 additions and 40 deletions.
2 changes: 1 addition & 1 deletion .gitignore
Original file line number Diff line number Diff line change
Expand Up @@ -17,7 +17,7 @@ DerivedData/
*.xcscmblueprint

# Ignore signing and capability settings
*.xcodeproj/project.pbxproj
#*.xcodeproj/project.pbxproj
*.xcodeproj/xcuserdata/
*.xcodeproj/xcshareddata/xcschemes/xcschememanagement.plist

Expand Down
12 changes: 11 additions & 1 deletion WebRTC-Sample-App/VideoViewController.swift
Original file line number Diff line number Diff line change
Expand Up @@ -127,7 +127,17 @@ class VideoViewController: UIViewController {
AntMediaClient.printf("It's in publis mode and calling to mute/unmute the local audio to send");

//mute/unmute the microphone for the publisher
self.client?.setAudioTrack(enableTrack: !sender.isSelected);
let toggleAudio = !sender.isSelected
self.client?.setAudioTrack(enableTrack: toggleAudio);

if (toggleAudio) {
//it means audio is enabled
self.client?.removeAudioLevelExtractor();
}
else {
//it means audio is disabled
self.client?.registerAudioLevelExtractor();
}
}


Expand Down
Loading

0 comments on commit c3198b1

Please sign in to comment.