Folgendes Skript, welches in v7 taddellos läuft, gibt in v8 einen type mismatch aus. Es soll ein Audio unter Umgehung einer Playlist direkt ausspielen:
const
FILENAME = 'C:\path\to\sound.wav';
DEVICE = 'Cartwall_OnAir';
procedure OnExecuteCommand(Command: string);
var
devices: TPlaybackDeviceSet;
fpi: IFilePlaylistItem;
dev: IPlaybackDevice;
begin
if Command = 'GERAEUSCH' then begin
fpi := Instance.GetFactory.CreateFilePlaylistItem(FILENAME, []);
devices := Instance.GetPlaybackRouting.GetPlaybackDevices(DEVICE); // <-- hier tritt der Fehler auf
PlaybackControl(0).PlayItemDetached(fpi, devices);
end;
end;
Bitte prüft das mal. Danke!