String + PChar + PChar = String
Delphi-Quellcode:
mciSendString(PChar('
SET mysound ' +
'
TIME FORMAT MS ' +
'
BITSPERSAMPLE '+IntToStr(BitsPerSample)+'
' +
'
CHANNELS ' +IntToStr(Channels)+'
' +
'
SAMPLESPERSEC '+IntToStr(SamplesPerSec)+'
' +
'
BYTESPERSEC ' +IntToStr(SamplesPerSec*Channels*round(BitsPerSample/8))+'
' +
'
ALIGNMENT ' +IntToStr(Channels*round(BitsPerSample/8)),
nil,0,
handle);
PS: mit
Format ginge es womöglich Schöner, Übersichtlicher und/oder zumindestens Effizienter
Delphi-Quellcode:
mciSendString(PChar(Format('
SET mysound TIME FORMAT MS ' +
'
BITSPERSAMPLE %d CHANNELS %d SAMPLESPERSEC %d BYTESPERSEC %d ALIGNMENT %d',
[BitsPerSample, Channels, SamplesPerSec, SamplesPerSec * Channels
* (BitsPerSample
div 8), Channels * (BitsPerSample
div 8)])),
nil, 0,
Handle);