Autor Beitrag
Metschu
ontopic starontopic starontopic starontopic starontopic starontopic starontopic starhalf ontopic star
Beiträge: 135

Windows XP SP2 Home
Delphi 7; Delphi XE2-Starter
BeitragVerfasst: So 28.09.08 18:13 
Hallo zusammen!

Ich benutze die BASS.dll und würde gerne die Wiedergabelautstärke eines Aufnahmeeingangs ändern oder Ausschalten. Die Eigentliche Aufnahmelautstärke soll aber unverändert bleiben.

Die einzelnen Aufnahmeingänge können bereits ausgewählt, sowie deren Lautstärke verändert werden.

Auch die Master-Lautstärke kann ich wunderbar ändern.
Nur schaffe ich es nicht, die Wiedergabe von z.B. "Line in" leise zu stellen, die Aufnahmelautstärke dieses Eingangs aber unverändert zu lassen.

Welchen "Befehl" der Bass.dll muß ich dafür verwenden? :lupe:
Oder kann mir jemand sagen, wo ich die Hilfedatei für BASS auf Deutsch herbekommen kann? :les:
Das würde die Sache dann doch erheblich erleichtern. :think:

Vielen Dank schonmal!

Gruß

Torsten
j.klugmann
Ehemaliges Mitglied
Erhaltene Danke: 1



BeitragVerfasst: So 28.09.08 18:44 
Guck mal im Librarynach MEMP.Darin müsste das vorkommen...
Gausi
ontopic starontopic starontopic starontopic starontopic starontopic starofftopic starofftopic star
Beiträge: 8554
Erhaltene Danke: 481

Windows 7, Windows 10
D7 PE, Delphi XE3 Prof, Delphi 10.3 CE
BeitragVerfasst: So 28.09.08 18:57 
user profile iconj.klugmann hat folgendes geschrieben:
Guck mal im Librarynach MEMP.Darin müsste das vorkommen...

Ne, da bestimmt nicht. ;-)

_________________
We are, we were and will not be.
Wishmaster
ontopic starontopic starontopic starontopic starontopic starontopic starontopic starontopic star
Beiträge: 34



BeitragVerfasst: Mo 29.09.08 18:36 
Hi

das geht nur mit Bassmix.dll oder du schreibst dir deine eigene DSP Funktion!

Zitat:

BASS_ChannelSetAttribute(
DWORD handle,
BASS_ATTRIB_VOL,
float volume
);


This attribute applies to playback of the channel, and does not affect the channel's sample data, so has no real effect on decoding channels. It is still adjustable though, so that it can be used by the BASSmix add-on, and anything else that wants to use it.




//DSP hint



ausblenden volle Höhe Delphi-Quelltext
1:
2:
3:
4:
5:
6:
7:
8:
9:
10:
11:
12:
13:
14:
15:
16:
17:
18:
19:
20:
21:
22:
23:
24:
25:
26:
27:
28:
29:
30:
31:
32:
33:
34:
35:
36:
37:
38:
39:
40:
41:
42:
43:
44:
45:
46:
47:
48:
49:
50:
51:
52:
53:
// pan -100..100


type
  TPanRec16 = array[0..1] of SmallInt;
  PPanRec16 = ^TPanRec16;

procedure PanDSPProc16(handle: HDSP; channel: DWORD; buffer: Pointer; length: DWORD; user: DWORD);
  stdcall;
var
  P: PPanRec16;
begin
  P := buffer;
  while ((length div 4) > 0) do
  begin
    if (Pan < 0) then
    begin
      P[1] := round(P[1] * (100 + pan) / 100); // pan left = reduce right
    end
    else if (Pan > 0) then
    begin
      P[0] := round(P[0] * (100 - pan) / 100); // vice versa
    end;
    inc(P);
    length := length - 4;
  end;
end;

type
  TPanRec32 = array[0..1] of Single;
  PPanRec32 = ^TPanRec32;
procedure PanDSPProc32(handle: HDSP; channel: DWORD; buffer: Pointer; length: DWORD; user: DWORD);
  stdcall;
var
  P: PPanRec32;
  a:DWORD;
begin
  P := buffer;
  a := 0;
  while (a < (length div 4)) do
  begin
    if (Pan < 0) then
    begin
      P[1] := P[1] * (1.0 + (pan/100)) / 1.0; // pan left = reduce right
    end
    else if (Pan > 0) then
    begin
      P[0] := P[0] * (1.0 - (pan/100)) / 1.0; // vice versa
    end;
    Inc(P);
    a := a + 2;
  end;
end;
j.klugmann
Ehemaliges Mitglied
Erhaltene Danke: 1



BeitragVerfasst: Mo 29.09.08 19:10 
häh?!Aber irgendwie hab ich es doch hinbekommen...Woher weiß ich das?
Metschu Threadstarter
ontopic starontopic starontopic starontopic starontopic starontopic starontopic starhalf ontopic star
Beiträge: 135

Windows XP SP2 Home
Delphi 7; Delphi XE2-Starter
BeitragVerfasst: Sa 04.10.08 13:04 
Ich bin es nochmal.

Nach langen Versuchen muß ich gestehen, ich bekomme es leider nicht zum laufen.

Mit folgendem Code würde ich einfach nur mal nach Click auf Button5 die Stellung eines Reglers rausbekommen.
In der ComboBox "Eingänge" habe ich alle Eingänge der Soundkarte eingelesen.
ausblenden volle Höhe Delphi-Quelltext
1:
2:
3:
4:
5:
6:
7:
8:
9:
10:
11:
12:
13:
14:
15:
16:
17:
18:
19:
20:
21:
22:
23:
24:
25:
26:
27:
28:
29:
30:
31:
32:
33:
34:
35:
36:
37:
38:
39:
40:
41:
42:
43:
44:
45:
46:
47:
48:
49:
50:
51:
52:
53:
54:
55:
56:
57:
58:
59:
60:
61:
62:
63:
64:
65:
66:
67:
68:
69:
70:
71:
72:
73:
74:
75:
76:
77:
78:
79:
80:
81:
82:
83:
84:
85:
86:
87:
88:
89:
90:
91:
  
uses [..] ,bass,bassmix,[..];

type
  TForm1 = class(TForm)
    Soundkarte: TComboBox;
    Eingang: TComboBox;
    TrackBar1: TTrackBar;
    Label1: TLabel;
    Button5: TButton;
    procedure FormActivate(Sender: TObject);
    procedure Button5Click(Sender: TObject);
  private
    { Private-Deklarationen }
  public
    { Public-Deklarationen }
  end;

var
  Form1: TForm1;

implementation

{$R *.dfm}


procedure TForm1.Button5Click(Sender: TObject);
var level:single;

begin;
 if BASS_ChannelGetAttribute(eingang.ItemIndex, BASS_ATTRIB_VOL,level)=true

  then begin
   TrackBar1.Position := Round(level * 100);
   Label1.Caption := IntToStr(TrackBar1.Position);
  end

  else begin;
   label1.Caption:='Fehler: '+inttostr(bass_errorgetcode) ;
  end;

end;

procedure TForm1.FormActivate(Sender: TObject);
var
  i: Integer;
  dName: PChar;
  ADeviceInfo: BASS_DEVICEINFO;
  v:single;
begin
// Auf richtige Version Prüfen
  if (HIWORD(BASS_GetVersion) <> BASSVERSION) then
  begin
    MessageBox(0,'Falsche BASS.DLL Version Geladen', nil,MB_ICONERROR);
    Halt;
  end;

// Soundkarten suchen und in ComboBox schreiben
  i := 1;
  while BASS_GetDeviceInfo(I, ADeviceInfo) do
  begin
    soundkarte.Items.Add(ADeviceInfo.name);
    i := i + 1;
  end;

// Eingänge suchen und in ComboBox schreiben
 if soundkarte.Items.Count>0
  then begin;
   soundkarte.ItemIndex:=0;
   if (not BASS_RecordInit(-1)) or (not BASS_Init(0, 44100, 0, Handle, nil)) then
     begin
      BASS_RecordFree;
      BASS_Free();
       MessageDlg('Fehler beim initialisieren der Soundkarte', mtError, [mbOk], 0);
     end;
    i := 0;
    dName := BASS_RecordGetInputName(i);
     while dName <> nil do
      begin
      Eingang.Items.Add(StrPas(dName));
      // is this one currently "on"?
      if (BASS_RecordGetInput(i,v) and BASS_INPUT_OFF) = 0 then
          Eingang.ItemIndex := i;
      Inc(i);
      dName := BASS_RecordGetInputName(i);
    end;

 end;
end;

end.


Ich bekomme aber immer den Fehler 5 "handle is not a valid channel" raus.

Zu meiner Schande muß ich gestehen, das ich bis jetzt trotz blättern in der Hilfe nicht verstanden habe, was mit "handle" gemeint ist.
Liegt hier der Fehler oder bin ich total daneben?

Gruß

Torsten
Gausi
ontopic starontopic starontopic starontopic starontopic starontopic starofftopic starofftopic star
Beiträge: 8554
Erhaltene Danke: 481

Windows 7, Windows 10
D7 PE, Delphi XE3 Prof, Delphi 10.3 CE
BeitragVerfasst: Sa 04.10.08 13:11 
BassChannelGetAttribute erwartet als ersten Parameter ein Handle auf einen Channel. Das ist immer das Ding, was beim Bass_StreamCreateSowieso als Ergebnis rauskommt. Du hast da irgendeinen ItemIndex, der garantiert nicht einem solchen Handle entspricht.

Edit: Schau dir mal BASS_SetDevice und BASS_SetVolume an. Könnte sein, dass das das Richtige für dich ist.

_________________
We are, we were and will not be.
Metschu Threadstarter
ontopic starontopic starontopic starontopic starontopic starontopic starontopic starhalf ontopic star
Beiträge: 135

Windows XP SP2 Home
Delphi 7; Delphi XE2-Starter
BeitragVerfasst: Fr 31.10.08 21:05 
Hallo zusammen!

Nachdem ich mich mal durch das (Englisch-Sprachige) Bass Forum geschlagen habe, wurde mir leider mitgeteilt, das "BASS.dll" dies nicht kann und es derzeit keine Pläne dafür gibt :"(Ian @ un4seen Administrator): Never say never, but I'm afraid there are currently no plans for BASS to include control over the output side of a soundcard's mixer.

Allerdings hat man mir die "Mixer-Componente" (siehe Anhang) Empfohlen, mit der es super Funktioniert.

Danke für Eure Hilfe.

Gruß

Torsten
Einloggen, um Attachments anzusehen!