Registriert seit: 20. Okt 2009
Ort: Wildau
19 Beiträge
Delphi 6 Professional
|
Equalizer rauschen und verzerren
1. Jun 2010, 20:00
hallo,
brauche mal hilfe, denn der eigene mp3-player funktioniert sehr gut, jedoch wenn ich den equalizer aktiviere, erlogt ein völliges verzerren und rauschen.
hier den code zum programm, irgend etwas muss hier schieflaufen. arbeite mit bass und bass_fx.dll
Delphi-Quellcode:
//*********Equalizer********
//**********Beginn**********
procedure TFmenue.SetDSP_EQ(fGain, fBandwidth, fQ, fCenter_Bass, fCenter_Mid, fCenter_Treble: FLOAT);
begin
fxEQ := BASS_ChannelSetFX(chan, BASS_FX_BFX_PEAKEQ, 1); // fCenter_Mid, fCenter_Treble nicht gesetzt, bzw. nicht benutzt!
eq.fGain := fGain;
eq.fQ := fQ;
eq.fBandwidth := fBandwidth;
eq.lChannel := BASS_BFX_CHANALL;
// create 1st band for bass
eq.lBand := 0;
eq.fCenter := fCenter_Bass;
BASS_FXSetParameters(fxEQ, @eq);
eq.lBand := 1;
eq.fCenter := fCenter_Bass;
BASS_FXSetParameters(fxEQ, @eq);
eq.lBand := 2;
eq.fCenter := fCenter_Bass;
BASS_FXSetParameters(fxEQ, @eq);
eq.lBand := 3;
eq.fCenter := fCenter_Bass;
BASS_FXSetParameters(fxEQ, @eq);
eq.lBand := 4;
eq.fCenter := fCenter_Bass;
BASS_FXSetParameters(fxEQ, @eq);
eq.lBand := 5;
eq.fCenter := fCenter_Bass;
BASS_FXSetParameters(fxEQ, @eq);
eq.lBand := 6;
eq.fCenter := fCenter_Bass;
BASS_FXSetParameters(fxEQ, @eq);
eq.lBand := 7;
eq.fCenter := fCenter_Bass;
BASS_FXSetParameters(fxEQ, @eq);
eq.lBand := 8;
eq.fCenter := fCenter_Bass;
BASS_FXSetParameters(fxEQ, @eq);
eq.lBand := 9;
eq.fCenter := fCenter_Bass;
BASS_FXSetParameters(fxEQ, @eq);
eq.lBand := 10;
eq.fCenter := fCenter_Bass;
BASS_FXSetParameters(fxEQ, @eq);
// update dsp eq
UpdateFX(0, vsEQBASS80.position);
UpdateFX(1, vsEQBASS125.position);
UpdateFX(2, vsEQBASS200.position);
UpdateFX(3, vsEQBASS320.position);
UpdateFX(4, vsEQBASS600.position);
UpdateFX(5, vsEQBASS1000.position);
UpdateFX(6, vsEQBASS3000.position);
UpdateFX(7, vsEQBASS6000.position);
UpdateFX(8, vsEQBASS10000.position);
UpdateFX(9, vsEQBASS12000.position);
UpdateFX(10, vsEQBASS14000.position);
end;
procedure TFmenue.UpdateFX(band, pos: integer);
begin
eq.lBand := band;
BASS_FXGetParameters(fxEQ, @eq);
eq.fGain := 10 - pos;
BASS_FXSetParameters(fxEQ, @eq);
End;
procedure TFmenue.chkEqualizerClick(Sender: TObject);
begin
If chkEqualizer.checked then begin
fxEQ := BASS_ChannelSetFX(Chan, BASS_FX_BFX_PEAKEQ, 1);
with eq do begin
fBandwidth := 2.5;
FQ := 0;
fGain := 0;
lChannel := BASS_BFX_CHANALL;
// create 1st band for bass
eq.lBand := 0;
eq.fCenter := 80;
BASS_FXSetParameters(fxEQ, @eq);
eq.lBand := 1;
eq.fCenter := 125;
BASS_FXSetParameters(fxEQ, @eq);
eq.lBand := 2;
eq.fCenter := 200;
BASS_FXSetParameters(fxEQ, @eq);
eq.lBand := 3;
eq.fCenter := 320;
BASS_FXSetParameters(fxEQ, @eq);
eq.lBand := 4;
eq.fCenter := 600;
BASS_FXSetParameters(fxEQ, @eq);
eq.lBand := 5;
eq.fCenter := 1000;
BASS_FXSetParameters(fxEQ, @eq);
eq.lBand := 6;
eq.fCenter := 3000;
BASS_FXSetParameters(fxEQ, @eq);
eq.lBand := 7;
eq.fCenter := 6000;
BASS_FXSetParameters(fxEQ, @eq);
eq.lBand := 8;
eq.fCenter := 10000;
BASS_FXSetParameters(fxEQ, @eq);
eq.lBand := 9;
eq.fCenter := 12000;
BASS_FXSetParameters(fxEQ, @eq);
eq.lBand := 10;
eq.fCenter := 14000;
BASS_FXSetParameters(fxEQ, @eq);
end;
// update dsp eq
vsEQBASS80.OnChange(Self);
vsEQBASS125.OnChange(Self);
vsEQBASS200.OnChange(Self);
vsEQBASS320.OnChange(Self);
vsEQBASS600.OnChange(Self);
vsEQBASS1000.OnChange(Self);
vsEQBASS3000.OnChange(Self);
vsEQBASS6000.OnChange(Self);
vsEQBASS10000.OnChange(Self);
vsEQBASS12000.OnChange(Self);
vsEQBASS14000.OnChange(Self);
end
else
BASS_ChannelRemoveFX(Chan, fxEQ);
end;
procedure TFmenue.UpdateEQ(b, pos: integer);
var i: integer;
begin
eq.lBand := b; // get b band values
i := 10;
BASS_FXGetParameters(fxEQ, @eq);
eq.fGain := i - pos;
BASS_FXSetParameters(fxEQ, @eq);
end;
procedure TFmenue.vsEQBASS80Change(Sender: TObject);
begin
UpdateEQ(0, vsEQBASS80.Position);
end;
procedure TFmenue.vsEQBASS125Change(Sender: TObject);
begin
UpdateEQ(1, vsEQBASS125.Position);
end;
procedure TFmenue.vsEQBASS200Change(Sender: TObject);
begin
UpdateEQ(2, vsEQBASS200.Position);
end;
procedure TFmenue.vsEQBASS320Change(Sender: TObject);
begin
UpdateEQ(3, vsEQBASS320.Position);
end;
procedure TFmenue.vsEQBASS600Change(Sender: TObject);
begin
UpdateEQ(4, vsEQBASS600.Position);
end;
procedure TFmenue.vsEQBASS1000Change(Sender: TObject);
begin
UpdateEQ(5, vsEQBASS1000.Position);
end;
procedure TFmenue.vsEQBASS3000Change(Sender: TObject);
begin
UpdateEQ(6, vsEQBASS3000.Position);
end;
procedure TFmenue.vsEQBASS6000Change(Sender: TObject);
begin
UpdateEQ(7, vsEQBASS6000.Position);
end;
procedure TFmenue.vsEQBASS10000Change(Sender: TObject);
begin
UpdateEQ(8, vsEQBASS10000.Position);
end;
procedure TFmenue.vsEQBASS12000Change(Sender: TObject);
begin
UpdateEQ(9, vsEQBASS12000.Position);
end;
procedure TFmenue.vsEQBASS14000Change(Sender: TObject);
begin
UpdateEQ(10, vsEQBASS14000.Position);
end;
//*********************Ende*******************************
wer kann helfen
|