Articles   Members Online:
-Article/Tip Search
-News Group Search over 21 Million news group articles.
-Delphi/Pascal
-CBuilder/C++
-C#Builder/C#
-JBuilder/Java
-Kylix
Member Area
-Home
-Account Center
-Top 10 NEW!!
-Submit Article/Tip
-Forums Upgraded!!
-My Articles
-Edit Information
-Login/Logout
-Become a Member
-Why sign up!
-Newsletter
-Chat Online!
-Indexes NEW!!
Employment
-Build your resume
-Find a job
-Post a job
-Resume Search
Contacts
-Contacts
-Feedbacks
-Link to us
-Privacy/Disclaimer
Embarcadero
Visit Embarcadero
Embarcadero Community
JEDI
Links
How to extract an audio stream of an *.avi file Turn on/off line numbers in source code. Switch to Orginial background IDE or DSP color Comment or reply to this aritlce/tip for discussion. Bookmark this article to my favorite article(s). Print this article
18-Sep-02
Category
Multimedia
Language
Delphi 6.x
Views
153
User Rating
No Votes
# Votes
0
Replies
0
Publisher:
DSP, Administrator
Reference URL:
DKB
			Author: Senn Marco

How can I extract an audio stream of an *.avi file?

Answer:

Note, you must use VfW.pas. You may find this file somewhere in the internet or 
simply write me an email. In addition, I was not able to test this code under 
Delphi 5.x or lower. Only Delphi 6.x. Please send me a piece of information, if you 
can test this for me. Thanks


1   uses VfW;
2   
3   function CallBack(i: int): BOOL; pascal;
4   begin
5     Label1.Caption := IntToStr(i) + '%';
6     Application.ProcessMessages;
7     Result := False;
8   end;
9   
10  procedure TForm1.Button1Click(Sender: TObject);
11  var
12    PFile: IAviFile;
13    PAvi: IAviStream;
14    plpOptions: PAviCompressOptions;
15  begin
16    AviFileInit;
17    if AviFileOpen(PFile, 'C:\test.avi', 0, nil) <> 0 then
18    begin
19      ShowMessage('Couldn'' t open * .avi!');
20      Exit;
21    end;
22    if AviFileGetStream(PFile, PAvi, StreamTypeAudio, 0) <> 0 then
23    begin
24      ShowMessage('Couldn' t load audio stream!');
25        AviFileExit;
26        Exit;
27    end;
28    if AviSaveV('il, @CallBack, 1, PAvi, plpOptions) <> 0 then
29    begin
30      ShowMessage('Couldn'' t save * .wav - file!');
31      AviStreamRelease(PAvi);
32      AviFileExit;
33      Exit;
34    end;
35    AviStreamRelease(PAvi);
36    AviFileExit;
37  end;


			
Vote: How useful do you find this Article/Tip?
Bad Excellent
1 2 3 4 5 6 7 8 9 10

 

Advertisement
Share this page
Advertisement
Download from Google

Copyright © Mendozi Enterprises LLC