@Fred vS
PM send
Huh, not perfectly.
No worries,. i try again.
Sometimes you have some mix (e.g. multiple channels mixed into one wav file that is created on the fly into memory) that you created yourself.
It is really an very inefficient method to first store that memory data to disk in a file and, then directly load it again (remember the perfect valid wav data is still in memory, because i just saved it to disk), then clear the memory that my wav data just used in order to make room, then load it from the file that i just saved to disk..... which delivers me the same wav data in memory again (the memory that i just cleared).
And, who knows (i am not that familiar with uos)... Perhaps it is possible to implement support for never ending streams this way, e.g. using buffered memory streams with a backend that create music on the fly (as said i have no idea if the libraries used in uos can handle such implementation)
edit:
Hmz, since there seem to be a language barrier, the above wouldn't help much either i guess. Maybe it helps with showing some code ?
program silly;
{$MODE OBJFPC}{$H+}
uses
Classes;
var
A : String = 'This is some data i would like to use';
Procedure OldAndPointless;
var
S : TMemoryStream;
T : String;
begin
S := TMemoryStream.Create;
S.WriteAnsiString(A);
S.SaveToFile('pointless.txt');
S.Free;
S := TMemoryStream.Create;
S.LoadFromFile('pointless.txt');
S.Position := 0;
T := S.ReadAnsiString;
S.Free;
WriteLn(T);
end;
procedure NewAndEfficient;
var
S : TMemoryStream;
T : String;
begin
S := TMemoryStream.Create;
S.WriteAnsiString(A);
S.Position := 0;
T := S.ReadAnsiString;
S.Free;
WriteLn(T);
end;
begin
WriteLn('old:');
OldAndPointless;
WriteLn('new:');
NewAndEfficient;
end.
I'm probably quilty of the code above being bit biased but, i do hope yo get the gist of it.