Autor Beitrag
Trunks
ontopic starontopic starontopic starontopic starontopic starontopic starontopic starhalf ontopic star
Beiträge: 62

winXP, win98, winME, debian, suse, maCoS, Symbian, WinCE
Delphi 7, Delhi 2006, c++, MySql, db2, php, js, java, c#, assembler,
BeitragVerfasst: So 17.07.05 14:26 
Salle an alle,

hab mal wieder ein prob. :D


Ich speicher eine .wav immer wieder neu mit dem gleichen dateinamen.

Aber der nachteil ist wenn die datei mal 70mb groß ist dann dauert das ne weile. Deswegen
will ich die datei immer wieder, in einem abstand von 3 sec, neu speichern.
Das problem ist allerding das er die datei immer komplett überschreibt.

1. Geht das, dass er nicht alles überschreibt sondern nur das was neu ist?
(also im Prinzip einfach die neuen sachen "dran hängt"?)


danke schonmal
retnyg
ontopic starontopic starontopic starontopic starontopic starontopic starontopic starofftopic star
Beiträge: 2754

SNES, GB, GBA, CPC, A500, 486/66, P4/3.0HT: NintendOS, AmigaOS, DoS
Delphi 5, Delphi 7
BeitragVerfasst: So 17.07.05 15:14 
jo, wenn du die datei nicht mit rewrite sondern mit append öffnest.

_________________
es gibt leute, die sind genetisch nicht zum programmieren geschaffen.
in der regel haben diese leute die regel...
Trunks Threadstarter
ontopic starontopic starontopic starontopic starontopic starontopic starontopic starhalf ontopic star
Beiträge: 62

winXP, win98, winME, debian, suse, maCoS, Symbian, WinCE
Delphi 7, Delhi 2006, c++, MySql, db2, php, js, java, c#, assembler,
BeitragVerfasst: So 17.07.05 15:27 
Ich öffne sie nicht.


Ich will zbs.: ein memo inhalt in einen txt speichern wenn jetzt zbs.: der inhalt = 100mb wäre. Dann würde es ne zeitlang dauern.

und da ich jede 3te sekunde speichere stottert das programm dann. Nun will ich das er nicht immer die datei neu speichert sonder das neue "stück" hintendran setzt, sozusagen die datei nur erweitert.
retnyg
ontopic starontopic starontopic starontopic starontopic starontopic starontopic starofftopic star
Beiträge: 2754

SNES, GB, GBA, CPC, A500, 486/66, P4/3.0HT: NintendOS, AmigaOS, DoS
Delphi 5, Delphi 7
BeitragVerfasst: So 17.07.05 15:35 
mit memo1.savetofile kommst du da nicht weiter
du musst dich also selber um das speichern kümmern
ausblenden Delphi-Quelltext
1:
2:
3:
4:
5:
6:
7:
8:
9:
10:
11:
12:
13:
14:
function SaveStringToFile(Str, Filename: String; doAppend: boolean): boolean;  
var
  f: textfile;
begin
  result := false;
  assignfile(f, Filename);
  try
    if (DoAppend) and (fileexists(Filename)) then append(f) else rewrite(f);
    write(f, Str);
    result := true;
  finally
    CloseFile(f);
  end;
end;


erster aufruf
ausblenden Delphi-Quelltext
1:
2:
3:
4:
5:
6:
7:
var s: string;
begin
  // kopiert die ersten 300 zeichen aus memo1 in die datei
  s:=memo1.text;
  if length(s) > 300 then s:=copy(s,1,300);  
  SaveStringToFile(s,'C:\test.txt',false); // hier wird die datei neu erstellt
end;


2. aufruf
ausblenden Delphi-Quelltext
1:
2:
3:
4:
5:
6:
7:
8:
9:
var s: string;
begin
  // kopiert die nächsten 300 zeichen aus memo1 in die datei
  s:=memo1.text;
  if length(s) > 600 then begin
    s:=copy(s,300,300);  
    SaveStringToFile(s,'C:\test.txt',true); // hier wird an die datei angehängt
  end;
end;

_________________
es gibt leute, die sind genetisch nicht zum programmieren geschaffen.
in der regel haben diese leute die regel...
Trunks Threadstarter
ontopic starontopic starontopic starontopic starontopic starontopic starontopic starhalf ontopic star
Beiträge: 62

winXP, win98, winME, debian, suse, maCoS, Symbian, WinCE
Delphi 7, Delhi 2006, c++, MySql, db2, php, js, java, c#, assembler,
BeitragVerfasst: Do 21.07.05 12:04 
nee, nicht das was ich suche.

Ich nehme mit meinem programm eine wav auf und will die speichern.
jetzt ist aber das problem das, dass wenn ich alle 3 sekunden speichere, dass dann die wave datei. zbs.: wenn Sie über 100mb groß ist, "stottert" beim speicher. Dass heißt das ab so ca. 30mb die wave im 3 sec. takt ruckelt.

Das will ich damit umgehen das er nicht immer die wave komplete neu speichert sonder einfach nur hinten dran hängt.

gruss
retnyg
ontopic starontopic starontopic starontopic starontopic starontopic starontopic starofftopic star
Beiträge: 2754

SNES, GB, GBA, CPC, A500, 486/66, P4/3.0HT: NintendOS, AmigaOS, DoS
Delphi 5, Delphi 7
BeitragVerfasst: Do 21.07.05 12:31 
ich weiss zwar nicht wie du die wave aufnimmst, aber am einfachsten speicherst du immer jedes wave-datenpaket, das hereinkommt, sofort auf platte, auch wenns nur 16 byte sind

_________________
es gibt leute, die sind genetisch nicht zum programmieren geschaffen.
in der regel haben diese leute die regel...
Trunks Threadstarter
ontopic starontopic starontopic starontopic starontopic starontopic starontopic starhalf ontopic star
Beiträge: 62

winXP, win98, winME, debian, suse, maCoS, Symbian, WinCE
Delphi 7, Delhi 2006, c++, MySql, db2, php, js, java, c#, assembler,
BeitragVerfasst: Sa 23.07.05 11:19 
ja sowas in der Art will ich machen.

Kannst du mir die Befehle dazu geben?
retnyg
ontopic starontopic starontopic starontopic starontopic starontopic starontopic starofftopic star
Beiträge: 2754

SNES, GB, GBA, CPC, A500, 486/66, P4/3.0HT: NintendOS, AmigaOS, DoS
Delphi 5, Delphi 7
BeitragVerfasst: Sa 23.07.05 13:01 
jo, aber dazu benötige ich mal den code mit dem du das wav "hereinholst"
ohne diesen code tappe ich im dunkeln user defined image

_________________
es gibt leute, die sind genetisch nicht zum programmieren geschaffen.
in der regel haben diese leute die regel...
Trunks Threadstarter
ontopic starontopic starontopic starontopic starontopic starontopic starontopic starhalf ontopic star
Beiträge: 62

winXP, win98, winME, debian, suse, maCoS, Symbian, WinCE
Delphi 7, Delhi 2006, c++, MySql, db2, php, js, java, c#, assembler,
BeitragVerfasst: Mo 01.08.05 11:07 
jo, ich nehm die wave auf.

ausblenden Delphi-Quelltext
1:
2:
3:
4:
mciSendString('Record sound', nil, 0, Handle);
mciSendString('Stop sound', nil, 0, Handle);
mciSendString(PChar('SAVE sound '+ verz + '[' +floattostr(zahl)  + '].wav'), nil, 0, Handle); // *
mciSendString('CLOSE sound', nil, 0, Handle);


*Hier wird gespeichert aber wenn ich das wiederholen tue, dann überspeichert er mir das Alte und das will ich nicht. Am besten wäre es wenn er immer speichern würde bis ich Stopp sage und dann weiter wenn ich record sage oder irgendwie sol...
Oder er überschreibt mir die datei nicht sonder hängt sie einfach dran.

Gruss, Marc
retnyg
ontopic starontopic starontopic starontopic starontopic starontopic starontopic starofftopic star
Beiträge: 2754

SNES, GB, GBA, CPC, A500, 486/66, P4/3.0HT: NintendOS, AmigaOS, DoS
Delphi 5, Delphi 7
BeitragVerfasst: Mo 01.08.05 12:31 
probiers mal so
ausblenden Delphi-Quelltext
1:
mciSendString('"Record sound",,insert', nil, 0, Handle);					

ansonsten guck dir mal den entsprechenden absatz im psdk an ms-help://MS.PSDKSVR2003SP1.1033/multimed/htm/_win32_record.htm
Zitat:
insert Specifies that new data is added to the file at the current position.

_________________
es gibt leute, die sind genetisch nicht zum programmieren geschaffen.
in der regel haben diese leute die regel...
Trunks Threadstarter
ontopic starontopic starontopic starontopic starontopic starontopic starontopic starhalf ontopic star
Beiträge: 62

winXP, win98, winME, debian, suse, maCoS, Symbian, WinCE
Delphi 7, Delhi 2006, c++, MySql, db2, php, js, java, c#, assembler,
BeitragVerfasst: Do 04.08.05 14:14 
hi,


wo kann ich das finden?(psdk)

In meiner Delphi hilfe gibt es "ms-help://MS.PSDKSVR2003SP1.1033/multimed/htm/_win32_record.htm" nicht. Wo kann ich noch nachschauen?
Trunks Threadstarter
ontopic starontopic starontopic starontopic starontopic starontopic starontopic starhalf ontopic star
Beiträge: 62

winXP, win98, winME, debian, suse, maCoS, Symbian, WinCE
Delphi 7, Delhi 2006, c++, MySql, db2, php, js, java, c#, assembler,
BeitragVerfasst: Do 04.08.05 15:09 
OK, hat sich erledigt. Funktioniert jetzt. Auch wenn es ohne euche hilfe war :P
retnyg
ontopic starontopic starontopic starontopic starontopic starontopic starontopic starofftopic star
Beiträge: 2754

SNES, GB, GBA, CPC, A500, 486/66, P4/3.0HT: NintendOS, AmigaOS, DoS
Delphi 5, Delphi 7
BeitragVerfasst: Do 04.08.05 18:17 
wäre nett wenn du uns noch sagst, wie du es gelöst hast :!:

_________________
es gibt leute, die sind genetisch nicht zum programmieren geschaffen.
in der regel haben diese leute die regel...