Autor Beitrag
Stundenplan
ontopic starontopic starontopic starontopic starontopic starontopic starontopic starhalf ontopic star
Beiträge: 128
Erhaltene Danke: 32

Win 7
Delphi 7 Pers., C# (VS 2010 Express)
BeitragVerfasst: Do 05.03.09 16:50 
Manchmal hasse ich Google!!!!!! (Das musste mal gesagt werden :wink: )

Also: 1. Wie kann man Hall "zur Laufzeit" abspielen:
Ich klicke auf die CheckBox "Hall" und sofort höre ich das Abgespielte mit Hall.
2. Wie kann man Hall zu einer Sound-Datei hinzufügen und sie wieder abspeichern?
(Das ganze noch für Echo!)

Danke im Voraus!
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: Do 05.03.09 16:53 
Schau dir mal die bass.dll an, und in den Beispielprojekten "fxtest". Da wird zumindest das eine beschrieben, der Rest sollte dann aus der Dokumentation folgen. :)

Edit: Abspeichern ist etwas komplizierter, weil man dann auch wieder neu kodieren muss, z.B. mit lame.

_________________
We are, we were and will not be.
Stundenplan Threadstarter
ontopic starontopic starontopic starontopic starontopic starontopic starontopic starhalf ontopic star
Beiträge: 128
Erhaltene Danke: 32

Win 7
Delphi 7 Pers., C# (VS 2010 Express)
BeitragVerfasst: Do 05.03.09 19:09 
Öhm...Ich kenn mich mit der Bass.dll ÜBERHAUPT NICHT AUS!
Ich hab mal von der Delphi-Praxis eine Unit, die mir das vereinfacht:
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:
92:
93:
94:
95:
96:
97:
98:
99:
100:
101:
102:
103:
104:
105:
106:
107:
108:
109:
110:
111:
112:
113:
114:
115:
116:
117:
118:
119:
unit U_BassPlayer; 

interface 

uses bass, Windows, Messages; 


type 
TFFTData = array[0..256] of float; 

TBassPlayer = class 
private 
{ Private declarations } 
channel: HCHANNEL; 
status: byte; 
FFilename: string; 

public 
  constructor create(mainwindowhandle: HWND); 
  destructor destroy; override; 
  function play(filename: string): boolean; 
  procedure setvolume(volume: byte); {0 bis 100} 
  function getvolume: byte; 
  property volume: byte read getvolume write setvolume ; 
  procedure setposition(position: integer); 
  function getposition: integer; {in sekunden} 
  property position: integer read getposition write setposition; 
  function getlength: integer; 
  property length: integer read getlength; 
  function getRightPeak: dword; 
  property RightPeak: dword read getRightPeak; {von 0 bis 128} 
  function getLeftPeak: dword; 
  property LeftPeak: dword read getLeftPeak; {von 0 bis 128} 
  function getfftdata: TFFTData; 
  property filename: string read FFilename; 

{ Public declarations } 
end; 

implementation 

function TBassPlayer.getfftdata: TFFTData; 
begin 
  if (BASS_ChannelGetData(Channel, @Result, BASS_DATA_FFT512) = 2048) =   false then 
  begin 
    ZeroMemory(@Result, SizeOf(Result)); 
  end; 
end; 


function TBassPlayer.getRightPeak: dword; 
begin 
  result := HIWORD(BASS_ChannelGetLevel(channel)); 

end; 

function TBassPlayer.getLeftPeak: dword; 
begin 
  result := LOWORD(BASS_ChannelGetLevel(channel)); 
end; 


function TBassPlayer.getvolume: byte; 
begin 
  result := BASS_GetVolume; 
end; 

procedure TBassPlayer.setvolume(volume: byte); 
begin 
  BASS_SetGlobalVolumes(-1,-1,volume); 
end; 


function TBassPlayer.getposition: integer; 
begin 
  result := round(BASS_ChannelBytes2Seconds(channel,BASS_ChannelGetPosition(channel))); 
end; 

procedure TBassPlayer.setposition(position: integer); 
begin 
  BASS_ChannelSetPosition(Channel,BASS_ChannelSeconds2Bytes(Channel, position)); 
end; 

function TBassPlayer.getlength: integer; 
begin 
  result := round(BASS_ChannelBytes2Seconds(channel,BASS_StreamGetLength(channel))); 
end; 


function TBassPlayer.play(filename: string): boolean; 
begin 
  If BASS_ChannelIsActive(channel)=1 then 
  begin 
    BASS_StreamFree(channel); 
  end; 
  FFilename := filename; 

  channel:=BASS_StreamCreateFile(False,PChar(filename),0,0,BASS_STREAM_AUTOFREE or BASS_SAMPLE_FX); 
  result := BASS_StreamPlay(channel,false,0); 
end; 

constructor TBassPlayer.create(mainwindowhandle: HWND); 
begin 
  inherited create;; 
  if BASS_GetVersion() <> MAKELONG(1,8) then Halt; 
  BASS_Init(-1, 44100, BASS_DEVICE_LEAVEVOL, mainwindowhandle); 
  BASS_Start; 
end; 


destructor TBassPlayer.destroy; 
begin 
  Bass_streamFree(channel); 
  BASS_Stop; 
  BASS_Free; 
  inherited destroy; 
end; 

end.

Aber gibt es so was wie ein Tutorial oder ne Hilfe??
F34r0fTh3D4rk
ontopic starontopic starontopic starontopic starontopic starontopic starhalf ontopic starofftopic star
Beiträge: 5285
Erhaltene Danke: 29

Win Vista (32), Win 7 (64)
Eclipse, SciTE, Lazarus
BeitragVerfasst: Do 05.03.09 19:15 
Viel interessanter wäre doch zu wissen, wie man das Ganze manuell anstellt ;) Ist doch um längen lustiger (Würde ja vorerst mit unkomprimierten Waves reichen). Nur gibt es leider auf den ersten blick sehr wenig Quellen (bis auf einige unverständliche Dokumentationen) zur Wave Verarbeitung (obwohl das ja nichts seltenes ist). Wobei ich denke, dass Echo noch deutlich einfacher zu implementieren sein dürfte als Hall.

€: ist audacity net open source?

mfg
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: Do 05.03.09 19:17 
Bei der Bass.dll ist eine recht gute Hilfe dabei, und ebenso viele Beispiele, durch die man am Anfang auch durch Copy&Paste weiterkommt. Die BassPlayer-Klasse hilft da nicht weiter, weil die diese Funktionen nicht bereitstellt.

@Selbermachen: Joah, das geht bestimmt. Aber dann kann man auch Non-VCL programmieren. ;-)

_________________
We are, we were and will not be.
F34r0fTh3D4rk
ontopic starontopic starontopic starontopic starontopic starontopic starhalf ontopic starofftopic star
Beiträge: 5285
Erhaltene Danke: 29

Win Vista (32), Win 7 (64)
Eclipse, SciTE, Lazarus
BeitragVerfasst: Do 05.03.09 19:25 
Ich hab die VCL ohnehin seit Monaten nicht angefasst :)
Stundenplan Threadstarter
ontopic starontopic starontopic starontopic starontopic starontopic starontopic starhalf ontopic star
Beiträge: 128
Erhaltene Danke: 32

Win 7
Delphi 7 Pers., C# (VS 2010 Express)
BeitragVerfasst: Do 05.03.09 19:36 
Ich schnapp mir einfach mal dein Tutorial auf Delphi-Praxis:www.delphi-treff.de/...r-mp3-player/page/1/
Und: Stimmt! Copy&Paste müssten hier auch weiterhelfen!
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: Do 05.03.09 19:49 
Kannst du gerne machen, aber auf Hall und Echo bin ich da nicht eingegangen - deswegen habe ich das auch noch nicht erwähnt. Aber in Kombination mit dem Beispielprojekt, was ich weiter oben genannt habe, sollte man damit weiterkommen. ;-)

_________________
We are, we were and will not be.
Stundenplan Threadstarter
ontopic starontopic starontopic starontopic starontopic starontopic starontopic starhalf ontopic star
Beiträge: 128
Erhaltene Danke: 32

Win 7
Delphi 7 Pers., C# (VS 2010 Express)
BeitragVerfasst: Do 05.03.09 20:11 
1. Na gut! Dann nehm ich mal das Beispielprojekt :wink:
2. Aber das hättest du ruhig auch im Tutorial erwähnen können! :wink: :wink:
Gewuerzgurke
ontopic starontopic starontopic starontopic starontopic starontopic starontopic starofftopic star
Beiträge: 152

Win XP
Lazarus
BeitragVerfasst: Mi 11.03.09 15:32 
Ein wenig spät, aber ich finde dies gehört hier auch noch rein:

www.noeska.com/doal/lesson12.aspx
www.pcfreunde.de/dow...d/d925/mobile-rooms/

Jetzt könnte man sich zanken, ob EAX eine gute / saubere Technik ist... Aber ich find's vom Prinzip ganz annehmlich.
delfiphan
ontopic starontopic starontopic starontopic starontopic starontopic starontopic starhalf ontopic star
Beiträge: 2684
Erhaltene Danke: 32



BeitragVerfasst: Mi 11.03.09 15:37 
user profile iconF34r0fTh3D4rk hat folgendes geschrieben Zum zitierten Posting springen:
Viel interessanter wäre doch zu wissen, wie man das Ganze manuell anstellt ;)

Die Theorie ist ganz einfach: Du faltest die Sounddaten mit der Impulsantwort des Raumes. Fertig.

Die Impulsantwort des Raumes kannst du mit einem Mikrophon aufnehmen (einfach Echo eines kurzen Klickgeräusches aufnehmen). Damit kannst du den Hall/das Echo eines bestimmten Raumes auf deine eigene Sounddaten übertragen. Bei diskreten Daten wie aus einer Wave-Datei, siehe Filter mit endlicher Impulsantwort.

In MatLAB ein Einzeiler ;)