Microsoft KB Archive/221578

= How To Play Unix Audio Files (.AU) From Visual Basic =

Article ID: 221578

Article Last Modified on 7/1/2004

-

APPLIES TO


 * Microsoft Visual Basic 6.0 Learning Edition
 * Microsoft Visual Basic 6.0 Professional Edition
 * Microsoft Visual Basic 6.0 Enterprise Edition

-



This article was previously published under Q221578



SUMMARY
This article demonstrates how to create a Visual Basic project that plays audio files with the AU file extension. The project uses the DirectShow run-time file, Quartz.dll, version 5.1.18.1024 or later. This DirectShow run-time file is shipped with Internet Explorer 4.01 and Visual Studio 6.0.



MORE INFORMATION
This section assumes you are familiar with using objects and references in your Visual Basic project and that you have a .AU file to use with the project. If you are not familiar with using objects and references in your Visual Basic project, see the REFERENCES section of this article.

Steps to Create the Project
 Start a new Standard EXE project in Visual Basic. Form1 is created by default. From the Project menu, select References, and add a reference to the DirectShow runtime file, quartz.dll. You may need to Browse for this file in your System directory. After you make a reference to this file, the ActiveMovie Control type library appears in the Available References list box of the References dialog box. Add a CommandButton to Form1.  Paste the following code to the Code window of Form1. Change the String variable MyFile to the path and filename of your AU file: Option Explicit

Private Sub Command1_Click Static PMC As Object Dim MyFile As String

MyFile = "" Set PMC = New FilgraphManager PMC.RenderFile MyFile PMC.Run End Sub  On the Run menu, select Start, or press the F5 key to start the program. Click on Command1 and the AU file will start playing.

<div class="references_section">