Level Extreme platform
Subscription
Corporate profile
Products & Services
Support
Legal
Français
Playing a sound file
Message
General information
Forum:
ASP.NET
Category:
Other
Miscellaneous
Thread ID:
00745120
Message ID:
00745813
Views:
20
Thanks Cathi, this is the very specific type of inclusion I wanted to see. I was hoping that there was a non DX method built into the CRL. However, Given the direction of DX as a HAL for human interaction devices from keyboard to VR controllers and network connections. It should be no surprise to me that this is the way to go. When I tech edited the Sink book "DirectX 8 and Visual Basic Development" we did DirectX some .NET examples in DX8 (Which MS said is not 100% .NET compatable), however, the methodology to use the impliments keyword and use it in its current level of incorporation into the IDE had not been released yet and the usage was still in API style. (Public Declare Function foo Lib "foo" Alias "GroovyFoo")

An interesting note is the nomenclature of Managed DirectX (MDX)

The example is missing a key element [AudioFile.Play :p] that kept it from working. Additionally, I have boiled the example down to the meat.
You will need a large (> 250Megs) Microsoft Direct X 9 SDK and Microsoft Direct X 9 Componentized VB from:
http://www.msdn.microsoft.com/library/default.asp?url=/downloads/list/directx.asp
'Add references to your project to the following; 
'  Microsoft.DirectX 
'  Microsoft.DirectX.AudioVidioPlayback

'Add reference to these two classes in your source; 
  Imports Microsoft.DirectX
  Imports Microsoft.DirectX.AudioVideoPlayback

'This code will make sound play;
  Private Sub PlayDX9Sound()
    Dim AudioFile As Audio 'Create a new audio object that can play audio files
    AudioFile = New Audio("c:\MySound.wav") 'Lodes the file into the AudioFile Object
    AudioFile.Play 
  End Sub
>Hi Joe,
>
>Here is a link that shows step-by-step instructions on how to play a sound file using the DirectX 9 SDK for .NET:
>
>http://www.pscode.com/vb/scripts/ShowCode.asp?txtCodeId=913&lngWId=10
>
>>Is there a CRL method to play a sound file? Preferably a sound in a resource file. All I have found are API methods and that doesn't seem to fit the trend. Why use COM???
>>
>>My humble thanks in advance,
~Joe Johnston USA

"If ye love wealth better than liberty, the tranquility of servitude better than the animated contest of freedom, go home from us in peace. We ask not your counsel or arms. Crouch down and lick the hands which feed you. May your chains set lightly upon you, and may posterity forget that ye were our countrymen."
~Samuel Adams

Previous
Next
Reply
Map
View

Click here to load this message in the networking platform