(09-30-2019, 02:48 PM)Madammar Wrote: which came to my mind i have to split out the Audio1 to a string variable and do the checking
Indy has BytesToString() and BytesToStringRaw() functions, which take an optional index and length as input, eg:
Code:
if BytesToString(bytes, 0, 6) = 'Audio1' then
begin
// use bytes[6]..bytes[High(bytes)] as needed...
end;
Or, you could simply use the RTL's CompareMem() function, eg:
Code:
if (Length(bytes) >= 6) and CompareMem(PByte(bytes), PAnsiChar('Audio1'), 6) = 0 then
begin
// use bytes[6]..bytes[High(bytes)] as needed...
end;