Skip to content

Commit f5b7a24

Browse files
author
xia ning
authored
Merge pull request #246 from AgoraIO/staging
Staging
2 parents 72e9ebc + 18cecb6 commit f5b7a24

File tree

4 files changed

+5
-44
lines changed

4 files changed

+5
-44
lines changed

Android/APIExample/app/src/main/java/io/agora/api/example/examples/advanced/customaudio/CustomAudioSource.java

Lines changed: 0 additions & 39 deletions
Original file line numberDiff line numberDiff line change
@@ -60,7 +60,6 @@ public class CustomAudioSource extends BaseFragment implements View.OnClickListe
6060
public RtcEngine engine;
6161
private static final Integer SAMPLE_RATE = 44100;
6262
private static final Integer SAMPLE_NUM_OF_CHANNEL = 2;
63-
private AudioPlayer mAudioPlayer;
6463
private final int bufferSize = 88200;
6564
private final byte[] data = new byte[bufferSize];
6665

@@ -159,13 +158,6 @@ public void onActivityCreated(@Nullable Bundle savedInstanceState) {
159158
engine = RtcEngine.create(getContext().getApplicationContext(), getString(R.string.agora_app_id),
160159
iRtcEngineEventHandler);
161160

162-
// Notify the SDK that you want to use the external audio sink.
163-
// engine.setExternalAudioSink(
164-
// true, // Enable the external audio sink.
165-
// SAMPLE_RATE, // Set the audio sample rate as 8k, 16k, 32k, 44.1k or 48kHz.
166-
// SAMPLE_NUM_OF_CHANNEL // Number of channels. The maximum number is 2.
167-
// );
168-
// mAudioPlayer = new AudioPlayer(AudioManager.STREAM_VOICE_CALL, SAMPLE_RATE, SAMPLE_NUM_OF_CHANNEL, AudioFormat.ENCODING_PCM_16BIT);
169161
} catch (Exception e) {
170162
e.printStackTrace();
171163
requireActivity().onBackPressed();
@@ -182,8 +174,6 @@ public void onDestroy() {
182174
}
183175
handler.postAtFrontOfQueue(RtcEngine::destroy);
184176
engine = null;
185-
// mAudioPlayer.stopPlayer();
186-
// playerTask.cancel(true);
187177
}
188178

189179
@Override
@@ -308,29 +298,6 @@ private void stopAudioRecord() {
308298
}
309299
}
310300

311-
// private final AsyncTask playerTask = new AsyncTask() {
312-
// @Override
313-
// protected Object doInBackground(Object[] objects) {
314-
// while (true) {
315-
// if (engine != null) {
316-
// /**
317-
// * Pulls the remote audio frame.
318-
// * Before calling this method, call the setExternalAudioSink(enabled: true) method to enable and set the external audio sink.
319-
// * After a successful method call, the app pulls the decoded and mixed audio data for playback.
320-
// * @Param data: The audio data that you want to pull. The data format is in byte[].
321-
// * @Param lengthInByte: The data length (byte) of the external audio data. The value of this parameter is related to the audio duration,
322-
// * and the values of the sampleRate and channels parameters that you set in setExternalAudioSink. Agora recommends setting the audio duration no shorter than 10 ms.
323-
// * The formula for lengthInByte is:
324-
// * lengthInByte = sampleRate/1000 × 2 × channels × audio duration (ms).
325-
// */
326-
// if (engine.pullPlaybackAudioFrame(data, bufferSize) == 0) {
327-
// mAudioPlayer.play(data, 0, data.length);
328-
// }
329-
// }
330-
// }
331-
// }
332-
// };
333-
334301
/**
335302
* IRtcEngineEventHandler is an abstract class providing default implementation.
336303
* The SDK uses this class to report to the app on SDK runtime events.
@@ -412,12 +379,6 @@ public void onRemoteAudioStateChanged(int uid, int state, int reason, int elapse
412379
super.onRemoteAudioStateChanged(uid, state, reason, elapsed);
413380
Log.i(TAG, "onRemoteAudioStateChanged->" + uid + ", state->" + state + ", reason->" + reason);
414381
}
415-
416-
@Override
417-
public void onUserJoined(int uid, int elapsed) {
418-
mAudioPlayer.startPlayer();
419-
// playerTask.execute();
420-
}
421382
};
422383

423384
@Override

Android/APIExample/lib-component/build.gradle

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -30,7 +30,7 @@ dependencies {
3030
androidTestImplementation 'androidx.test.ext:junit:1.1.1'
3131
androidTestImplementation 'androidx.test.espresso:espresso-core:3.2.0'
3232

33-
api 'io.agora.rtc:full-sdk:3.5.2'
33+
api 'io.agora.rtc:full-sdk:3.6.0.1'
3434
api 'io.agora:player:1.3.0'
3535

3636
}

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

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -170,9 +170,9 @@ class AudioMixingMain: BaseViewController {
170170
@IBAction func onChangeTrack(_ sender:UISegmentedControl){
171171
switch sender.selectedSegmentIndex {
172172
case 0:
173-
self.trackIndex = 1
173+
self.trackIndex = 0
174174
case 1:
175-
self.trackIndex = 2
175+
self.trackIndex = 1
176176
default:
177177
break
178178
}

iOS/Podfile

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -6,12 +6,12 @@ target 'APIExample' do
66
use_frameworks!
77
pod 'Floaty', '~> 4.2.0'
88
pod 'AGEVideoLayout', '~> 1.0.2'
9-
pod 'AgoraRtcEngine_iOS', '3.5.2'
9+
pod 'AgoraRtcEngine_iOS', '3.6.0.1'
1010
pod 'AgoraMediaPlayer_iOS', '1.2.2'
1111
end
1212

1313
target 'Agora-ScreenShare-Extension' do
1414

1515
use_frameworks!
16-
pod 'AgoraRtcEngine_iOS', '3.5.2'
16+
pod 'AgoraRtcEngine_iOS', '3.6.0.1'
1717
end

0 commit comments

Comments
 (0)