private void distAmount_Scroll(object sender, EventArgs e) { if (fxStream != 0) { // Изменение драйва и вета дисторшена BASS_BFX_DISTORTION dist = new BASS_BFX_DISTORTION(); Bass.BASS_FXGetParameters(distortion, dist); dist.fDrive = distAmount.Value; dist.fWetMix = distAmount.Value / 3.0f; Bass.BASS_FXSetParameters(distortion, dist); } }
private void openfile_FileOk(object sender, CancelEventArgs e) { if (openfile.FileName != String.Empty) { audioPath = openfile.FileName; fileName.Text = audioPath; playButton.Enabled = true; saveButton.Enabled = true; Bass.BASS_StreamFree(audioStream); Bass.BASS_StreamFree(fxStream); audioStream = Bass.BASS_StreamCreateFile(audioPath, 0, 0, BASSFlag.BASS_STREAM_DECODE | BASSFlag.BASS_STREAM_PRESCAN); if (audioStream != 0) { fxStream = BassFx.BASS_FX_TempoCreate(audioStream, BASSFlag.BASS_FX_FREESOURCE); if (fxStream != 0) { // Вешаем эффекты до воиспроизведения, чтобы не было задержки distortion = Bass.BASS_ChannelSetFX(fxStream, BASSFXType.BASS_FX_BFX_DISTORTION, -4); BASS_BFX_DISTORTION dist = new BASS_BFX_DISTORTION(); dist.fDrive = distAmount.Value; dist.fDryMix = 5.0f; dist.fWetMix = distAmount.Value / 3.0f; dist.fFeedback = -0.5f; dist.fVolume = 0.1f; Bass.BASS_FXSetParameters(distortion, dist); // -- bassboost = Bass.BASS_ChannelSetFX(fxStream, BASSFXType.BASS_FX_DX8_PARAMEQ, -4); BASS_DX8_PARAMEQ eq = new BASS_DX8_PARAMEQ(); eq.fBandwidth = 24; eq.fCenter = 80; eq.fGain = bassAmount.Value; Bass.BASS_FXSetParameters(bassboost, eq); bassboost2 = Bass.BASS_ChannelSetFX(fxStream, BASSFXType.BASS_FX_DX8_PARAMEQ, -4); Bass.BASS_FXSetParameters(bassboost2, eq); return; } } MessageBox.Show(this, "Чот нихуя"); } }
public Distortion() { distortion = new BASS_BFX_DISTORTION(); }