Skip to content

Commit baa582d

Browse files
author
zhaoyongqiang
committed
恢复调整音量插件
1 parent 999bece commit baa582d

9 files changed

Lines changed: 36 additions & 75 deletions

File tree

iOS/APIExample/Examples/Advanced/AudioMixing/AudioMixing.swift

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -195,7 +195,7 @@ class AudioMixingMain: BaseViewController {
195195

196196
@IBAction func onStartAudioMixing(_ sender:UIButton){
197197
if let filepath = Bundle.main.path(forResource: "audiomixing", ofType: "mp3") {
198-
let result = agoraKit.startAudioMixing(filepath, loopback: false, replace: false, cycle: -1)
198+
let result = agoraKit.startAudioMixing(filepath, loopback: false, cycle: -1)
199199
if result != 0 {
200200
self.showAlert(title: "Error", message: "startAudioMixing call failed: \(result), please check your params")
201201
}

iOS/APIExample/Examples/Advanced/FusionCDN/FusionCDN.swift

Lines changed: 1 addition & 25 deletions
Original file line numberDiff line numberDiff line change
@@ -606,19 +606,7 @@ extension FusionCDNHost: AgoraRtcEngineDelegate {
606606
func rtcEngine(_ engine: AgoraRtcEngineKit, reportRtcStats stats: AgoraChannelStats) {
607607
videoViews[0]?.statsInfo?.updateChannelStats(stats)
608608
}
609-
610-
/// Reports the statistics of the uploading local video streams once every two seconds.
611-
/// @param stats stats struct
612-
func rtcEngine(_ engine: AgoraRtcEngineKit, localVideoStats stats: AgoraRtcLocalVideoStats) {
613-
videoViews[0]?.statsInfo?.updateLocalVideoStats(stats)
614-
}
615-
616-
/// Reports the statistics of the uploading local audio streams once every two seconds.
617-
/// @param stats stats struct
618-
func rtcEngine(_ engine: AgoraRtcEngineKit, localAudioStats stats: AgoraRtcLocalAudioStats) {
619-
videoViews[0]?.statsInfo?.updateLocalAudioStats(stats)
620-
}
621-
609+
622610
/// Reports the statistics of the video stream from each remote user/host.
623611
/// @param stats stats struct
624612
func rtcEngine(_ engine: AgoraRtcEngineKit, remoteVideoStats stats: AgoraRtcRemoteVideoStats) {
@@ -691,18 +679,6 @@ extension FusionCDNAudience: AgoraRtcEngineDelegate {
691679
videoViews[0]?.statsInfo?.updateChannelStats(stats)
692680
}
693681

694-
/// Reports the statistics of the uploading local video streams once every two seconds.
695-
/// @param stats stats struct
696-
func rtcEngine(_ engine: AgoraRtcEngineKit, localVideoStats stats: AgoraRtcLocalVideoStats) {
697-
videoViews[0]?.statsInfo?.updateLocalVideoStats(stats)
698-
}
699-
700-
/// Reports the statistics of the uploading local audio streams once every two seconds.
701-
/// @param stats stats struct
702-
func rtcEngine(_ engine: AgoraRtcEngineKit, localAudioStats stats: AgoraRtcLocalAudioStats) {
703-
videoViews[0]?.statsInfo?.updateLocalAudioStats(stats)
704-
}
705-
706682
/// Reports the statistics of the video stream from each remote user/host.
707683
/// @param stats stats struct
708684
func rtcEngine(_ engine: AgoraRtcEngineKit, remoteVideoStats stats: AgoraRtcRemoteVideoStats) {

iOS/APIExample/Examples/Advanced/SimpleFilter/Base.lproj/SimpleFilter.storyboard

Lines changed: 21 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -91,6 +91,21 @@
9191
<rect key="frame" x="0.0" y="43.999999999999972" width="375" height="484.33333333333326"/>
9292
<color key="backgroundColor" systemColor="systemBackgroundColor"/>
9393
</view>
94+
<label opaque="NO" userInteractionEnabled="NO" contentMode="left" horizontalHuggingPriority="251" verticalHuggingPriority="251" text="Volume" textAlignment="natural" lineBreakMode="tailTruncation" baselineAdjustment="alignBaselines" adjustsFontSizeToFit="NO" translatesAutoresizingMaskIntoConstraints="NO" id="OWd-ri-4Z3">
95+
<rect key="frame" x="16" y="673" width="57" height="21"/>
96+
<fontDescription key="fontDescription" type="system" pointSize="17"/>
97+
<nil key="textColor"/>
98+
<nil key="highlightedColor"/>
99+
</label>
100+
<slider opaque="NO" contentMode="scaleToFill" contentHorizontalAlignment="center" contentVerticalAlignment="center" value="90" minValue="0.0" maxValue="100" translatesAutoresizingMaskIntoConstraints="NO" id="cg0-nU-4U9">
101+
<rect key="frame" x="182" y="667" width="177" height="31"/>
102+
<constraints>
103+
<constraint firstAttribute="width" constant="173" id="S7C-OP-DlN"/>
104+
</constraints>
105+
<connections>
106+
<action selector="onChangeRecordingVolume:" destination="jxp-ZN-2yG" eventType="valueChanged" id="gMw-5Z-4EP"/>
107+
</connections>
108+
</slider>
94109
<switch opaque="NO" contentMode="scaleToFill" horizontalHuggingPriority="750" verticalHuggingPriority="750" contentHorizontalAlignment="center" contentVerticalAlignment="center" on="YES" translatesAutoresizingMaskIntoConstraints="NO" id="Asr-5u-EvP">
95110
<rect key="frame" x="306" y="705" width="51" height="31"/>
96111
<connections>
@@ -107,13 +122,16 @@
107122
<viewLayoutGuide key="safeArea" id="CeS-QQ-Djo"/>
108123
<color key="backgroundColor" systemColor="systemBackgroundColor"/>
109124
<constraints>
110-
<constraint firstItem="Asr-5u-EvP" firstAttribute="leading" relation="greaterThanOrEqual" secondItem="Rng-Da-M39" secondAttribute="trailing" constant="8" symbolic="YES" id="00u-kI-Ei0"/>
125+
<constraint firstItem="Asr-5u-EvP" firstAttribute="top" secondItem="cg0-nU-4U9" secondAttribute="bottom" constant="8" symbolic="YES" id="4vZ-Dj-opn"/>
126+
<constraint firstItem="CeS-QQ-Djo" firstAttribute="bottom" secondItem="cg0-nU-4U9" secondAttribute="bottom" constant="81" id="IAN-fh-91X"/>
127+
<constraint firstItem="CeS-QQ-Djo" firstAttribute="trailing" secondItem="cg0-nU-4U9" secondAttribute="trailing" constant="18" id="WND-oe-oNd"/>
128+
<constraint firstItem="OWd-ri-4Z3" firstAttribute="leading" secondItem="CeS-QQ-Djo" secondAttribute="leading" constant="16" id="XEo-pC-w1d"/>
111129
<constraint firstItem="sSr-Z8-XSr" firstAttribute="height" secondItem="CeS-QQ-Djo" secondAttribute="height" multiplier="0.66" id="frg-bw-or0"/>
112-
<constraint firstItem="CeS-QQ-Djo" firstAttribute="bottom" secondItem="Asr-5u-EvP" secondAttribute="bottom" constant="42" id="gJa-xU-5h0"/>
113130
<constraint firstItem="sSr-Z8-XSr" firstAttribute="top" secondItem="CeS-QQ-Djo" secondAttribute="top" id="hi8-V0-oGS"/>
114131
<constraint firstItem="sSr-Z8-XSr" firstAttribute="leading" secondItem="CeS-QQ-Djo" secondAttribute="leading" id="jkd-Uq-0Cy"/>
115-
<constraint firstItem="CeS-QQ-Djo" firstAttribute="bottom" secondItem="Rng-Da-M39" secondAttribute="bottom" constant="47" id="nqG-xG-vJQ"/>
116132
<constraint firstItem="Rng-Da-M39" firstAttribute="leading" secondItem="CeS-QQ-Djo" secondAttribute="leading" constant="16" id="oZn-g0-6Cs"/>
133+
<constraint firstItem="Rng-Da-M39" firstAttribute="top" secondItem="OWd-ri-4Z3" secondAttribute="bottom" constant="16" id="s4D-vE-dDO"/>
134+
<constraint firstItem="CeS-QQ-Djo" firstAttribute="bottom" secondItem="OWd-ri-4Z3" secondAttribute="bottom" constant="84" id="s5t-j9-Mz1"/>
117135
<constraint firstItem="CeS-QQ-Djo" firstAttribute="trailing" secondItem="Asr-5u-EvP" secondAttribute="trailing" constant="20" id="w3h-v3-TWh"/>
118136
<constraint firstItem="CeS-QQ-Djo" firstAttribute="trailing" secondItem="sSr-Z8-XSr" secondAttribute="trailing" id="xcd-jp-EOu"/>
119137
</constraints>

iOS/APIExample/Examples/Advanced/SimpleFilter/SimpleFilter.swift

Lines changed: 7 additions & 12 deletions
Original file line numberDiff line numberDiff line change
@@ -42,6 +42,7 @@ class SimpleFilterMain: BaseViewController {
4242
@IBOutlet weak var container: AGEVideoContainer!
4343
var localVideo = Bundle.loadVideoView(type: .local, audioOnly: false)
4444
var remoteVideo = Bundle.loadVideoView(type: .remote, audioOnly: false)
45+
let AUDIO_FILTER_NAME = "VolumeChange"
4546
let VIDEO_FILTER_NAME = "Grey"
4647

4748
// indicate if current instance has joined channel
@@ -77,9 +78,9 @@ class SimpleFilterMain: BaseViewController {
7778

7879
// enable video module
7980
agoraKit.enableVideo()
80-
agoraKit.enableAudio()
8181

8282
agoraKit.enableExtension(withVendor: SimpleFilterManager.vendorName(), extension: VIDEO_FILTER_NAME, enabled: true)
83+
agoraKit.enableExtension(withVendor: SimpleFilterManager.vendorName(), extension: AUDIO_FILTER_NAME, enabled: true)
8384
agoraKit.setExtensionPropertyWithVendor(SimpleFilterManager.vendorName(), extension: VIDEO_FILTER_NAME, key: "grey", value: "1")
8485

8586
// set up local video to render your local camera preview
@@ -129,12 +130,12 @@ class SimpleFilterMain: BaseViewController {
129130
}
130131
}
131132

132-
override func viewDidDisappear(_ animated: Bool) {
133-
super.viewDidDisappear(animated)
134-
// 关闭
135-
agoraKit.setExtensionPropertyWithVendor(SimpleFilterManager.vendorName(), extension: VIDEO_FILTER_NAME, key: "grey", value: "0")
133+
@IBAction func onChangeRecordingVolume(_ sender:UISlider){
134+
let value:Int = Int(sender.value)
135+
print("adjustRecordingSignalVolume \(value)")
136+
agoraKit.setExtensionPropertyWithVendor(SimpleFilterManager.vendorName(), extension: AUDIO_FILTER_NAME, key: "volume", value: String(value))
136137
}
137-
138+
138139
@IBAction func onSwitch(sender: UISwitch) {
139140
agoraKit.setExtensionPropertyWithVendor(SimpleFilterManager.vendorName(), extension: VIDEO_FILTER_NAME, key: "grey", value: sender.isOn ? "1" : "0")
140141
}
@@ -220,12 +221,6 @@ extension SimpleFilterMain: AgoraRtcEngineDelegate {
220221
localVideo.statsInfo?.updateChannelStats(stats)
221222
}
222223

223-
/// Reports the statistics of the uploading local video streams once every two seconds.
224-
/// @param stats stats struct
225-
func rtcEngine(_ engine: AgoraRtcEngineKit, localVideoStats stats: AgoraRtcLocalVideoStats) {
226-
localVideo.statsInfo?.updateLocalVideoStats(stats)
227-
}
228-
229224
/// Reports the statistics of the uploading local audio streams once every two seconds.
230225
/// @param stats stats struct
231226
func rtcEngine(_ engine: AgoraRtcEngineKit, localAudioStats stats: AgoraRtcLocalAudioStats) {

iOS/APIExample/Examples/Advanced/VideoChat/VideoChat.swift

Lines changed: 0 additions & 12 deletions
Original file line numberDiff line numberDiff line change
@@ -276,18 +276,6 @@ extension VideoChatMain: AgoraRtcEngineDelegate {
276276
videoViews[0]?.statsInfo?.updateChannelStats(stats)
277277
}
278278

279-
/// Reports the statistics of the uploading local video streams once every two seconds.
280-
/// @param stats stats struct
281-
func rtcEngine(_ engine: AgoraRtcEngineKit, localVideoStats stats: AgoraRtcLocalVideoStats) {
282-
videoViews[0]?.statsInfo?.updateLocalVideoStats(stats)
283-
}
284-
285-
/// Reports the statistics of the uploading local audio streams once every two seconds.
286-
/// @param stats stats struct
287-
func rtcEngine(_ engine: AgoraRtcEngineKit, localAudioStats stats: AgoraRtcLocalAudioStats) {
288-
videoViews[0]?.statsInfo?.updateLocalAudioStats(stats)
289-
}
290-
291279
/// Reports the statistics of the video stream from each remote user/host.
292280
/// @param stats stats struct
293281
func rtcEngine(_ engine: AgoraRtcEngineKit, remoteVideoStats stats: AgoraRtcRemoteVideoStats) {

iOS/APIExample/Examples/Advanced/VideoProcess/VideoProcess.swift

Lines changed: 0 additions & 12 deletions
Original file line numberDiff line numberDiff line change
@@ -334,18 +334,6 @@ extension VideoProcessMain: AgoraRtcEngineDelegate {
334334
localVideo.statsInfo?.updateChannelStats(stats)
335335
}
336336

337-
/// Reports the statistics of the uploading local video streams once every two seconds.
338-
/// @param stats stats struct
339-
func rtcEngine(_ engine: AgoraRtcEngineKit, localVideoStats stats: AgoraRtcLocalVideoStats) {
340-
localVideo.statsInfo?.updateLocalVideoStats(stats)
341-
}
342-
343-
/// Reports the statistics of the uploading local audio streams once every two seconds.
344-
/// @param stats stats struct
345-
func rtcEngine(_ engine: AgoraRtcEngineKit, localAudioStats stats: AgoraRtcLocalAudioStats) {
346-
localVideo.statsInfo?.updateLocalAudioStats(stats)
347-
}
348-
349337
/// Reports the statistics of the video stream from each remote user/host.
350338
/// @param stats stats struct
351339
func rtcEngine(_ engine: AgoraRtcEngineKit, remoteVideoStats stats: AgoraRtcRemoteVideoStats) {

iOS/APIExample/Examples/Basic/JoinChannelVideo/JoinChannelVideo.swift

Lines changed: 0 additions & 6 deletions
Original file line numberDiff line numberDiff line change
@@ -261,12 +261,6 @@ extension JoinChannelVideoMain: AgoraRtcEngineDelegate {
261261
localVideo.statsInfo?.updateChannelStats(stats)
262262
}
263263

264-
/// Reports the statistics of the uploading local video streams once every two seconds.
265-
/// @param stats stats struct
266-
func rtcEngine(_ engine: AgoraRtcEngineKit, localVideoStats stats: AgoraRtcLocalVideoStats) {
267-
localVideo.statsInfo?.updateLocalVideoStats(stats)
268-
}
269-
270264
/// Reports the statistics of the uploading local audio streams once every two seconds.
271265
/// @param stats stats struct
272266
func rtcEngine(_ engine: AgoraRtcEngineKit, localAudioStats stats: AgoraRtcLocalAudioStats) {

macOS/APIExample.xcodeproj/project.pbxproj

Lines changed: 5 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -805,7 +805,7 @@
805805
isa = PBXProject;
806806
attributes = {
807807
LastSwiftUpdateCheck = 1160;
808-
LastUpgradeCheck = 1160;
808+
LastUpgradeCheck = 1320;
809809
ORGANIZATIONNAME = "Agora Corp";
810810
TargetAttributes = {
811811
03896D2B24F8A00F008593CD = {
@@ -1222,6 +1222,7 @@
12221222
CLANG_WARN_OBJC_IMPLICIT_RETAIN_SELF = YES;
12231223
CLANG_WARN_OBJC_LITERAL_CONVERSION = YES;
12241224
CLANG_WARN_OBJC_ROOT_CLASS = YES_ERROR;
1225+
CLANG_WARN_QUOTED_INCLUDE_IN_FRAMEWORK_HEADER = YES;
12251226
CLANG_WARN_RANGE_LOOP_ANALYSIS = YES;
12261227
CLANG_WARN_STRICT_PROTOTYPES = YES;
12271228
CLANG_WARN_SUSPICIOUS_MOVE = YES;
@@ -1283,6 +1284,7 @@
12831284
CLANG_WARN_OBJC_IMPLICIT_RETAIN_SELF = YES;
12841285
CLANG_WARN_OBJC_LITERAL_CONVERSION = YES;
12851286
CLANG_WARN_OBJC_ROOT_CLASS = YES_ERROR;
1287+
CLANG_WARN_QUOTED_INCLUDE_IN_FRAMEWORK_HEADER = YES;
12861288
CLANG_WARN_RANGE_LOOP_ANALYSIS = YES;
12871289
CLANG_WARN_STRICT_PROTOTYPES = YES;
12881290
CLANG_WARN_SUSPICIOUS_MOVE = YES;
@@ -1376,7 +1378,7 @@
13761378
buildSettings = {
13771379
CLANG_CXX_LANGUAGE_STANDARD = "gnu++17";
13781380
CLANG_WARN_QUOTED_INCLUDE_IN_FRAMEWORK_HEADER = YES;
1379-
CODE_SIGN_IDENTITY = "Apple Development";
1381+
CODE_SIGN_IDENTITY = "";
13801382
CODE_SIGN_STYLE = Automatic;
13811383
COMBINE_HIDPI_IMAGES = YES;
13821384
CURRENT_PROJECT_VERSION = 1;
@@ -1416,7 +1418,7 @@
14161418
buildSettings = {
14171419
CLANG_CXX_LANGUAGE_STANDARD = "gnu++17";
14181420
CLANG_WARN_QUOTED_INCLUDE_IN_FRAMEWORK_HEADER = YES;
1419-
CODE_SIGN_IDENTITY = "Apple Development";
1421+
CODE_SIGN_IDENTITY = "";
14201422
CODE_SIGN_STYLE = Automatic;
14211423
COMBINE_HIDPI_IMAGES = YES;
14221424
CURRENT_PROJECT_VERSION = 1;

macOS/APIExample/Examples/Advanced/AudioMixing/AudioMixing.swift

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -469,7 +469,7 @@ class AudioMixing: BaseViewController {
469469

470470
@IBAction func onStartAudioMixing(_ sender: NSButton) {
471471
if let filepath = Bundle.main.path(forResource: "audiomixing", ofType: "mp3") {
472-
let result = agoraKit.startAudioMixing(filepath, loopback: false, replace: false, cycle: -1)
472+
let result = agoraKit.startAudioMixing(filepath, loopback: false, cycle: -1)
473473
if result != 0 {
474474
self.showAlert(title: "Error", message: "startAudioMixing call failed: \(result), please check your params")
475475
}

0 commit comments

Comments
 (0)