???
把先前的SetAudioDecoderMode代码替换一下看看
procedure TDSPlayer.SetAudioDecoderMode(Mode: TDSAudioModel);
var
ifg: IFilterGraph;
ibf: IBaseFilter;
dsFetched : ULONG;
enumFilters : IEnumFilters;
fi: TFilterInfo;
begin
if not Assigned(FdsGraphBuilder) then
Exit;
if Succeeded(FdsGraphBuilder.QueryInterface(IID_IFilterGraph, ifg)) then
begin
FdsMpegAudioDecoder := nil;
enumFilters := nil;
If Succeeded(FdsGraphBuilder.EnumFilters(enumFilters)) then
begin
While Succeeded(enumFilters.Next(1, ibf, Addr(dsFetched)))do
begin
ibf.QueryFilterInfo(fi);
ShowMessage(fi.achName);
// 显示一下Filter的名字
if Succeeded(ibf.QueryInterface(IID_IMpegAudioDecoder, FdsMpegAudioDecoder)) then
begin
// AM_MPEG_AUDIO_DUAL_MERGE = 0;
// AM_MPEG_AUDIO_DUAL_LEFT = 1;
// AM_MPEG_AUDIO_DUAL_RIGHT = 2;
// TDSAudioModel = (amMerge, amLeft, amRight);
FdsMpegAudioDecoder.put_DualMode(Integer(Mode));
end;
end;
// Destory prior Interface
enumFilters := nil;
end;
(* if Succeeded(ifg.FindFilterByName('MPEG Audio Decoder', ibf)) then
begin
if Succeeded(ibf.QueryInterface(IID_IMpegAudioDecoder, FdsMpegAudioDecoder)) then
begin
// AM_MPEG_AUDIO_DUAL_MERGE = 0;
// AM_MPEG_AUDIO_DUAL_LEFT = 1;
// AM_MPEG_AUDIO_DUAL_RIGHT = 2;
FdsMpegAudioDecoder.put_DualMode(Integer(Mode));
{case Mode of
amLeft: FdsMpegAudioDecoder.put_DualMode(AM_MPEG_AUDIO_DUAL_LEFT);
amRight: FdsMpegAudioDecoder.put_DualMode(AM_MPEG_AUDIO_DUAL_RIGHT);
amMerge: FdsMpegAudioDecoder.put_DualMode(AM_MPEG_AUDIO_DUAL_MERGE);
end;
}
end;
end;
*)
end;
end;