mirror of
https://gitlab.com/freepascal.org/fpc/source.git
synced 2025-09-30 10:39:15 +02:00
-madopenal sample fixed for win32
git-svn-id: trunk@4660 -
This commit is contained in:
parent
2000c7d3e3
commit
43054b826c
@ -46,7 +46,7 @@ var
|
|||||||
Remaining : Integer;
|
Remaining : Integer;
|
||||||
ReadStart : Pointer;
|
ReadStart : Pointer;
|
||||||
ReadSize : Integer;
|
ReadSize : Integer;
|
||||||
Output : PWord;
|
Output : PSmallint;
|
||||||
begin
|
begin
|
||||||
if Count mod BLOCK_SIZE <> 0 then
|
if Count mod BLOCK_SIZE <> 0 then
|
||||||
Exit(0);
|
Exit(0);
|
||||||
@ -98,14 +98,14 @@ begin
|
|||||||
if pcm.samples[0][X] < -MAD_F_ONE then
|
if pcm.samples[0][X] < -MAD_F_ONE then
|
||||||
pcm.samples[0][X] := -MAD_F_ONE;
|
pcm.samples[0][X] := -MAD_F_ONE;
|
||||||
pcm.samples[0][X] := pcm.samples[0][X] shr (MAD_F_FRACBITS + 1 - 16);
|
pcm.samples[0][X] := pcm.samples[0][X] shr (MAD_F_FRACBITS + 1 - 16);
|
||||||
Output[X shl 1] := pcm.samples[0][X];
|
Output[X shl 1] := pcm.samples[0][X] div 2;
|
||||||
|
|
||||||
if pcm.samples[1][X] >= MAD_F_ONE then
|
if pcm.samples[1][X] >= MAD_F_ONE then
|
||||||
pcm.samples[1][X] := MAD_F_ONE - 1;
|
pcm.samples[1][X] := MAD_F_ONE - 1;
|
||||||
if pcm.samples[1][X] < -MAD_F_ONE then
|
if pcm.samples[1][X] < -MAD_F_ONE then
|
||||||
pcm.samples[1][X] := -MAD_F_ONE;
|
pcm.samples[1][X] := -MAD_F_ONE;
|
||||||
pcm.samples[1][X] := pcm.samples[1][X] shr (MAD_F_FRACBITS + 1 - 16);
|
pcm.samples[1][X] := pcm.samples[1][X] shr (MAD_F_FRACBITS + 1 - 16);
|
||||||
Output[(X shl 1)+1] := pcm.samples[1][X];
|
Output[(X shl 1)+1] := pcm.samples[1][X] div 2;
|
||||||
end;
|
end;
|
||||||
end else begin
|
end else begin
|
||||||
for X := 0 to pcm.length -1 do
|
for X := 0 to pcm.length -1 do
|
||||||
@ -116,8 +116,8 @@ begin
|
|||||||
pcm.samples[0][X] := -MAD_F_ONE;
|
pcm.samples[0][X] := -MAD_F_ONE;
|
||||||
pcm.samples[0][X] := pcm.samples[0][X] shr (MAD_F_FRACBITS + 1 - 16);
|
pcm.samples[0][X] := pcm.samples[0][X] shr (MAD_F_FRACBITS + 1 - 16);
|
||||||
|
|
||||||
Output[X shl 1] := pcm.samples[0][X];
|
Output[X shl 1] := pcm.samples[0][X] div 2;
|
||||||
Output[(X shl 1)+1] := pcm.samples[0][X];
|
Output[(X shl 1)+1] := pcm.samples[0][X] div 2;
|
||||||
end;
|
end;
|
||||||
end;
|
end;
|
||||||
|
|
||||||
@ -148,7 +148,8 @@ begin
|
|||||||
alSourceQueueBuffers(source, 1, @buffers[i]);
|
alSourceQueueBuffers(source, 1, @buffers[i]);
|
||||||
end;
|
end;
|
||||||
|
|
||||||
alSourcei(source, AL_LOOPING, AL_TRUE);
|
// Under windows, AL_LOOPING = AL_TRUE breaks queueing, no idea why
|
||||||
|
alSourcei(source, AL_LOOPING, AL_FALSE);
|
||||||
alSourcePlay(source);
|
alSourcePlay(source);
|
||||||
end;
|
end;
|
||||||
|
|
||||||
|
Loading…
Reference in New Issue
Block a user