Administrator
|
This post was updated on .
Hello and sorry for the long delay.
Could you try this:
uos_CreatePlayer(SoundPlayerIndex);
SampleRate := 44100;
SampleFormat := 0; // float 32
Channels := -1; // Use the default of sound-card and if mono will force to stereo
FramesCount := 65536;
// saving in a Memory-Buffer:
SetLength(SoundBuffer, 0);
uos_AddIntoMemoryBuffer(SoundPlayerIndex, @SoundBuffer, SampleRate, SampleFormat, Channels, FramesCount);
----------------
And when you get the array SoundBuffer, if you need you can split each channel with something like this:
procedure splitchannels;
var
arrayleft, arrayright : array of single;
x, y : integer;
begin
setlength(arrayleft, Length(SoundBuffer) div 2);
setlength(arrayright, Length(arrayleft));
x := 0;
y := 0;
while x < length(arrayleft) do
begin
arrayleft[x] := SoundBuffer[y];
arrayright[x] := SoundBuffer[y+1];
x := x + 1 ;
y := y + 2;
end;
end;
|