Skip to content

Commit

Permalink
Merge pull request #232 from AgoraIO/dev/fixbug
Browse files Browse the repository at this point in the history
fix regression issues
  • Loading branch information
xia ning authored Nov 3, 2021
2 parents fd90a05 + dc90bd0 commit e1213bf
Show file tree
Hide file tree
Showing 2 changed files with 12 additions and 9 deletions.
Original file line number Diff line number Diff line change
Expand Up @@ -323,14 +323,19 @@ else if (v.getId() == R.id.btn_effect)
}

private void stopProgressTimer() {
mixingProgressBar.setProgress(0);
handler.removeCallbacksAndMessages(null);
}

private void startProgressTimer() {
final int result = (int) ((float) engine.getAudioMixingCurrentPosition() / (float) engine.getAudioFileInfo(Constant.URL_PLAY_AUDIO_FILES) * 100);
mixingProgressBar.setProgress(Long.valueOf(result).intValue());
handler.postDelayed(this::startProgressTimer, 500);
if(engine != null) {
int currentPosition = engine.getAudioMixingCurrentPosition();
if (mixingProgressBar.getMax() != 0 && !mixingProgressBar.isPressed())
mixingProgressBar.setProgress(currentPosition);
handler.postDelayed(this::startProgressTimer, 1000);
}
}

/**
* @param channelId Specify the channel name that you want to join.
* Users that input the same channel name join the same channel.*/
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -157,8 +157,8 @@ class CustomAudioRender: BaseViewController {
agoraKit.disableVideo()

// set proxy configuration
let proxySetting = GlobalSettings.shared.proxySetting.selectedOption().value
agoraKit.setCloudProxy(AgoraCloudProxyType.init(rawValue: UInt(proxySetting)) ?? .noneProxy)
// let proxySetting = GlobalSettings.shared.proxySetting.selectedOption().value
// agoraKit.setCloudProxy(AgoraCloudProxyType.init(rawValue: UInt(proxySetting)) ?? .noneProxy)

// set live broadcaster mode
agoraKit.setChannelProfile(.liveBroadcasting)
Expand All @@ -167,10 +167,8 @@ class CustomAudioRender: BaseViewController {

// setup external audio source
exAudio.setupExternalAudio(withAgoraKit: agoraKit, sampleRate: UInt32(sampleRate), channels: UInt32(audioChannel), audioCRMode: .sdkCaptureExterRender, ioType: .remoteIO)
// important!! this example is using onPlaybackAudioFrame to do custom rendering
// by default the audio output will still be processed by SDK hence below api call is mandatory to disable that behavior
agoraKit.setParameters("{\"che.audio.external_render\": true}")
agoraKit.setParameters("{\"che.audio.keep.audiosession\": true}")

agoraKit.enableExternalAudioSink(sampleRate, channels: audioChannel)

// start joining channel
// 1. Users can only see each other after they join the
Expand Down

0 comments on commit e1213bf

Please sign in to comment.