Autor Beitrag
Jagg
ontopic starontopic starontopic starontopic starontopic starontopic starontopic starhalf ontopic star
Beiträge: 635



BeitragVerfasst: Do 06.02.03 08:12 
Hallo,Leute !

Kann ich mit dem MediaPlayer WaveDateien aufnehmen ? d.h. muss ich die Datei vorher mit AssignFile erstellt haben oder wie geht das ?

d.h. ich will eine WaveDatei erstellen und dann mit der WaveDatei aufnehmen,d.h. nicht eine "vorhandene" WaveDatei aufnehmen ! Geht das überhaupt ?

Also überschreiben!

Jagg !

Moderiert von user profile iconTino: 2 Beiträge von Jagg hier eingefügt.
tommie-lie
ontopic starontopic starontopic starontopic starontopic starofftopic starofftopic starofftopic star
Beiträge: 4373

Ubuntu 7.10 "Gutsy Gibbon"

BeitragVerfasst: Do 06.02.03 14:29 
?
Also du willst eine neue Datei aufnehmen?
Ich weiß zwar nicht, wie man das mit dem TMediaPlayer macht, aber hier gibt's ein kleines Tutorial, wie man Töne über die API aufnimmt und abspielt. Ergänzungen zum Thema findest du im SDK.

_________________
Your computer is designed to become slower and more unreliable over time, so you have to upgrade. But if you'd like some false hope, I can tell you how to defragment your disk. - Dilbert
overmoon
ontopic starontopic starontopic starontopic starontopic starontopic starofftopic starofftopic star
Beiträge: 16



BeitragVerfasst: Do 06.02.03 17:13 
Mit dem folgendem Code nimmst du z.B. den Gesang (von dir ?) oder andere Geräusche oder Musik über ein an den Computer angeschlossenes Mikrofon auf.

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:
unit UnitMain;
//==============================================================================>>
interface
//==============================================================================>>
uses Windows, Messages, SysUtils, Classes, Graphics, Controls, Forms, Dialogs,
     ExtCtrls, StdCtrls, Buttons,
     mmSystem; // Wichtig ! mmSystem einbinden !
//==============================================================================>>
type TFormMain = class(TForm)
    BitBtnRecord:  TBitBtn;
    BitBtnStop:    TBitBtn;
    BitBtnSave:    TBitBtn;
    PanelCaption:  TPanel;
    BitBtnBeenden: TBitBtn;
    SaveDialog: TSaveDialog;
    BitBtnLoeschen: TBitBtn;
    procedure BitBtnBeendenClick(Sender: TObject);
    procedure BitBtnRecordClick(Sender: TObject);
    procedure BitBtnStopClick(Sender: TObject);
    procedure BitBtnSaveClick(Sender: TObject);
    procedure BitBtnLoeschenClick(Sender: TObject);
end;
//==============================================================================>>
var FormMain: TFormMain;
//==============================================================================>>
implementation
// weitere Befehle: PLAY mysound, WAIT mysound, LOAD mysound
//==============================================================================>>
{$R *.DFM}
//==============================================================================>>
procedure TFormMain.BitBtnBeendenClick(Sender: TObject);
begin
     // Audio-Gerät schließen
     mciSendString('CLOSE mysound', nil, 0, handle);
     // Programm beenden !
     Close;
end;
//==============================================================================>>
procedure TFormMain.BitBtnRecordClick(Sender: TObject);
begin
     // Bevor man mit der Aufnahme beginnen kann,
     // muss ein Audio-Gerät geöffnet werden.
     mciSendString('OPEN NEW TYPE WAVEAUDIO ALIAS mysound',nil,0,handle);

     // Nun werden die Optionen eingestellt.
     mciSendString('SET mysound TIME FORMAT MS ' +  // Zeitformat
                   'BITSPERSAMPLE 16 ' +           // 16 Bit
                   'CHANNELS 2 ' +                 // Stereo
                   'SAMPLESPERSEC 22050 ' +        // Frequenz (Hz)
                   'BYTESPERSEC 22050 ',           // 22050 Bytes/s
                   nil, 0, handle);

     // Jetzt beginnt die Aufnahme !
     mciSendString('RECORD mysound', nil, 0, handle);
end;
//==============================================================================>>
procedure TFormMain.BitBtnStopClick(Sender: TObject);
begin
     // Aufnahme stoppen !
     mciSendString('STOP mysound', nil, 0, handle);
end;
//==============================================================================>>
procedure TFormMain.BitBtnSaveClick(Sender: TObject);
begin
     // Wav abspeichern.
     if SaveDialog.Execute then
     begin
          mciSendString(pChar('SAVE mysound ' + SaveDialog.FileName),
                        nil, 0, handle);
     end;
end;
//==============================================================================>>
procedure TFormMain.BitBtnLoeschenClick(Sender: TObject);
begin
     // Audio-Gerät schließen / Aufnahme löschen
     mciSendString('CLOSE mysound', nil, 0, handle);
end;
//==============================================================================>>
end.


Moderiert von user profile iconAXMD: Code- durch Delphi-Tags ersetzt
tommie-lie
ontopic starontopic starontopic starontopic starontopic starofftopic starofftopic starofftopic star
Beiträge: 4373

Ubuntu 7.10 "Gutsy Gibbon"

BeitragVerfasst: Do 06.02.03 18:07 
stimmt, da wäre die MCI-Lösung. Die hatte ich schon ganz vergessen. Das, was in meinem Link stand, ist zwar ein wenig flexibler als die MCI, aber wenn du nur aufnehmen möchtest, wird die MCI allemal reichen!

_________________
Your computer is designed to become slower and more unreliable over time, so you have to upgrade. But if you'd like some false hope, I can tell you how to defragment your disk. - Dilbert
Quarksalat
Hält's aus hier
Beiträge: 2



BeitragVerfasst: Sa 18.03.06 16:08 
Guten Abend
wo bekomme ich hier dieses mmSystem her. Könntet ihr mir bitte einen Link geben? (Ich find nichts) Danke xD.

EDIT: ist geklärt ;-)

Quarksalat


Zuletzt bearbeitet von Quarksalat am Sa 18.03.06 16:31, insgesamt 1-mal bearbeitet
Fabian W.
ontopic starontopic starontopic starontopic starontopic starontopic starofftopic starofftopic star
Beiträge: 1766

Win 7
D7 PE
BeitragVerfasst: Sa 18.03.06 16:12 
das hast du schon :D
Danniolo
ontopic starontopic starontopic starontopic starontopic starontopic starontopic starofftopic star
Beiträge: 693



BeitragVerfasst: Sa 18.03.06 16:13 
bei uses einfach "MMSystem" reinschreiben. (uses steht gaaaaaaaaaaaaanz oben :mrgreen:)
Quarksalat
Hält's aus hier
Beiträge: 2



BeitragVerfasst: Di 04.07.06 13:20 
Ich habe trotzdem nochmal eine Frage ... kann ich diese Wavedatei gleich so weiterverarbeiten wie sie ist als "mysound" ... das heißt, kann ich z.B. schreiben Read_Wave(mysound) oder wie kann ich das während des Aufnehmens einbinden (also wenn ich drücke Aufnehmen un dann macht der gleichzeitig noch was mit dem gerade aufgenommenen)? ... Hmm is alles nen bissl verwirrt jetzt gesagt, ich hoffe ihr könnt mir trotzdem helfen *fg* =))

MFG
Fabian W.
ontopic starontopic starontopic starontopic starontopic starontopic starofftopic starofftopic star
Beiträge: 1766

Win 7
D7 PE
BeitragVerfasst: Di 04.07.06 16:29 
Wenn ich dich richtig verstehe möchtest du an eine schon bestehende wave-Datei eine Aufnahme dranhängen? Ich würds einfach ausprobieren, aber ich denke sie wird einfach überschrieben werden... :roll:

mfg