From bd04e1c76d7139287be2244d03f2b62c9d117c0a Mon Sep 17 00:00:00 2001 From: tobigun Date: Fri, 7 Dec 2007 03:52:07 +0000 Subject: getpcmdata creates fake pcm-data now git-svn-id: svn://svn.code.sf.net/p/ultrastardx/svn/trunk@696 b956fd51-792f-4845-bead-9b4dfca2ff2c --- Game/Code/Classes/UMedia_dummy.pas | 33 +++++++++++++++++++++++++++++++-- 1 file changed, 31 insertions(+), 2 deletions(-) (limited to 'Game/Code/Classes') 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 -- cgit v1.2.3