Registriert seit: 30. Mär 2006
37 Beiträge
Delphi XE Professional
|
Play MP3 from memory using IGraphBuilder
14. Feb 2008, 16:37
Hello
Sorry, can anybody tell me how play MP3 from memory (when is known pointer and size of block memory) through IGraphBuilder like example from this forum?
Delphi-Quellcode:
procedure TForm1.btnRenderFileClick(Sender: TObject);
var
pGraph: IGraphBuilder;
pControl: IMediaControl;
pEvent: IMediaEvent;
evCode: Integer;
strPath: string;
wstrFileName: PWideChar;
begin
CoInitialize(nil);
GetMem(wstrFileName, MAX_PATH);
try
CoCreateInstance(CLSID_FilterGraph, nil, CLSCTX_INPROC_SERVER,IID_IGraphBuilder,pGraph);
pGraph.QueryInterface(IID_IMediaControl,pControl);
pGraph.QueryInterface(IID_IMediaEvent,pEvent);
{-----}
strPath := FilenameEdit1.Text;
MultiByteToWideChar(CP_ACP, 0, PChar(strPath), -1, wstrFileName, MAX_PATH);
if Succeeded(pGraph.RenderFile(wstrFileName,nil)) then
{-----}
begin
if Succeeded(pControl.Run) then begin
pEvent.WaitForCompletion(INFINITE,evCode);
end;
end;
finally
CoUninitialize();
FreeMem(wstrFileName, MAX_PATH)
end;
end;
Can be use pGraph.Render(pPin) and how please?
Thank you.
ijcro
|
|
Zitat
|