public void onStart(int id, int errCode) { if (this.IsHandleCreated) { this.BeginInvoke(new Action(() => { AudioEffectManager.setMusicPlayoutVolume(mBGMParam.id, this.LocalVolumTrackBar.Value); AudioEffectManager.setMusicPublishVolume(mBGMParam.id, this.RemoteVolumTrackBar.Value); float fSpeed = (float)this.BGMSpeedTrackBar.Value / AUDIO_BGM_SPEED_CONVERSION_RATE; AudioEffectManager.setMusicSpeedRate(mBGMParam.id, fSpeed); float fPitch = ((float)this.BGMPitchTrackBar.Value / AUDIO_BGM_PITCH_CONVERSION_RATE); AudioEffectManager.setMusicPitch(mBGMParam.id, fPitch); })); } }
private void Init() { this.BGMprogressBar.Maximum = 100; this.BGMprogressBar.Value = 0; this.BGMVolumTrackBar.Maximum = 100; this.BGMVolumTrackBar.Minimum = 0; this.BGMVolumTrackBar.Value = 50; this.RemoteVolumTrackBar.Maximum = 100; this.RemoteVolumTrackBar.Minimum = 0; this.RemoteVolumTrackBar.Value = 50; this.LocalVolumTrackBar.Maximum = 100; this.LocalVolumTrackBar.Minimum = 0; this.LocalVolumTrackBar.Value = 50; this.BGMSpeedTrackBar.Maximum = 20; this.BGMSpeedTrackBar.Minimum = 5; this.BGMSpeedTrackBar.Value = 10; this.BGMPitchTrackBar.Maximum = 10; this.BGMPitchTrackBar.Minimum = -10; this.BGMPitchTrackBar.Value = 0; mEffectParam1.isShortFile = true; mEffectParam2.isShortFile = true; mEffectParam3.isShortFile = true; mBGMParam.id = 4; mBGMParam.publish = true; AudioEffectManager = mTRTCCloud.getAudioEffectManager(); AudioEffectManager.setMusicPlayoutVolume(mBGMParam.id, this.BGMVolumTrackBar.Value); AudioEffectManager.setMusicPublishVolume(mBGMParam.id, this.BGMVolumTrackBar.Value); }