aboutsummaryrefslogtreecommitdiffstats
path: root/Game
diff options
context:
space:
mode:
Diffstat (limited to '')
-rw-r--r--Game/Code/Classes/UMedia_dummy.pas33
1 files changed, 31 insertions, 2 deletions
diff --git a/Game/Code/Classes/UMedia_dummy.pas b/Game/Code/Classes/UMedia_dummy.pas
index 12268a55..a5cc4b5a 100644
--- a/Game/Code/Classes/UMedia_dummy.pas
+++ b/Game/Code/Classes/UMedia_dummy.pas
@@ -22,6 +22,7 @@ implementation
uses
SysUtils,
+ math,
UMusic;
@@ -170,9 +171,37 @@ begin
result := data;
end;
+var count: integer = 0;
+
function Tmedia_dummy.GetPCMData(var data: TPCMData): Cardinal;
-begin
- result := 0;
+var i: integer;
+begin
+ // Produce some fake PCM data
+ if ( count mod 500 = 0 ) then
+ begin
+ for i := 0 to 511 do begin
+ data[0][i] := 0;
+ data[1][i] := 0;
+ end;
+ end
+ else begin
+ for i := 0 to 511 do begin
+ if ( i mod 2 = 0 ) then begin
+ data[0][i] := floor(Random * power(2.,14));
+ data[1][i] := floor(Random * power(2.,14));
+ end
+ else begin;
+ data[0][i] := floor(Random * power(2.,14));
+ data[1][i] := floor(Random * power(2.,14));
+ end;
+ if ( i mod 2 = 1 ) then begin
+ data[0][i] := -data[0][i];
+ data[1][i] := -data[1][i];
+ end;
+ end;
+ end;
+ Inc(count);
+ result := 512;
end;
// IAudioPlayback