Skip to content

Commit c3198b1

Browse files
committed
Let developers manage audioLevel extraction
1 parent bdd8f09 commit c3198b1

File tree

6 files changed

+1346
-40
lines changed

6 files changed

+1346
-40
lines changed

.gitignore

+1-1
Original file line numberDiff line numberDiff line change
@@ -17,7 +17,7 @@ DerivedData/
1717
*.xcscmblueprint
1818

1919
# Ignore signing and capability settings
20-
*.xcodeproj/project.pbxproj
20+
#*.xcodeproj/project.pbxproj
2121
*.xcodeproj/xcuserdata/
2222
*.xcodeproj/xcshareddata/xcschemes/xcschememanagement.plist
2323

WebRTC-Sample-App/VideoViewController.swift

+11-1
Original file line numberDiff line numberDiff line change
@@ -127,7 +127,17 @@ class VideoViewController: UIViewController {
127127
AntMediaClient.printf("It's in publis mode and calling to mute/unmute the local audio to send");
128128

129129
//mute/unmute the microphone for the publisher
130-
self.client?.setAudioTrack(enableTrack: !sender.isSelected);
130+
let toggleAudio = !sender.isSelected
131+
self.client?.setAudioTrack(enableTrack: toggleAudio);
132+
133+
if (toggleAudio) {
134+
//it means audio is enabled
135+
self.client?.removeAudioLevelExtractor();
136+
}
137+
else {
138+
//it means audio is disabled
139+
self.client?.registerAudioLevelExtractor();
140+
}
131141
}
132142

133143

0 commit comments

Comments
 (0)