Skip to content

Instantly share code, notes, and snippets.

@bashkirtsevich
Created November 24, 2016 10:33
Show Gist options
  • Save bashkirtsevich/54c6494903ff4485fb31e942e820a426 to your computer and use it in GitHub Desktop.
Save bashkirtsevich/54c6494903ff4485fb31e942e820a426 to your computer and use it in GitHub Desktop.
Function to mix audio channels
procedure Mix(ADest: PByte; ASources: array of PByte; ASize, ALength: Integer);
var
i, j: Integer;
begin
for i := 0 to (ALength - 1) div ASize do
for j := 0 to Length(ASources) - 1 do
begin
Move(ASources[j]^, ADest^, ASize);
Inc(ADest, ASize);
Inc(ASources[j], ASize);
end;
end;
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment