Groups | Blog | Home
all groups > dotnet sdk > november 2005 >

dotnet sdk : .Net Windows Forms Audio Playback


v-phuang NO[at]SPAM online.microsoft.com (
11/15/2005 12:00:00 AM
Hi

Here is link for your reference.

DirectXSound
AudioVideoPlayback.Audio mp3 = new AudioVideoPlayback.Audio(mySong.mp3);
mp3.Play();

http://www.c-sharpcorner.com/Code/2003/Sept/BreakOut3D.asp

Best regards,

Peter Huang
Microsoft Online Partner Support

Get Secure! - www.microsoft.com/security
This posting is provided "AS IS" with no warranties, and confers no rights.
Alex Maghen
11/15/2005 9:54:32 AM
I'm looking for the simplest, highest-level method for playing back .WAVs
(and maybe .MP3s) from within a .NET Windows Forms app. I'm looking at the
Managed DirectX SDK but I can't find any nice samples. This should be really
simple: I don't need to select audio devices (use the default). I just need
to select an audio file, start it playing, maybe stop it playing. Nothing
more. A simple-sample would be much appreciated.

v-phuang NO[at]SPAM online.microsoft.com (
11/16/2005 12:00:00 AM
Hi

You need to ship the Managed Wrap(i.e. the .NET class for directX)
and the directX runtime.(it should be installed by enduser, just as most 3D
game do which has an option to install DX)
DirectX 9.0c End-User Runtime
http://www.microsoft.com/downloads/details.aspx?FamilyID=0a9b6820-bfbb-4799-
9908-d418cdeac197&DisplayLang=en

Best regards,

Peter Huang
Microsoft Online Partner Support

Get Secure! - www.microsoft.com/security
This posting is provided "AS IS" with no warranties, and confers no rights.
v-phuang NO[at]SPAM online.microsoft.com (
11/16/2005 12:00:00 AM
Hi

In addition, DX 9.0c is included in Windows XP Service Pack 2.
DirectX 9.0c Redistributable for Software Developers - Multilingual
http://www.microsoft.com/downloads/details.aspx?FamilyId=9226A611-62FE-4F61-
ABA1-914185249413&displaylang=en

If you can not make sure the enduser's OS version, it is better to ship it.

Best regards,

Peter Huang
Microsoft Online Partner Support

Get Secure! - www.microsoft.com/security
This posting is provided "AS IS" with no warranties, and confers no rights.
Alex Maghen
11/16/2005 2:49:16 PM
Thanks for this. Just one more question: I'm a little confused about what
SPECIFIC SDK(s) I need to have installed to use this and also whether they
will be automatically included when I build a Distribution Package. In other
words, will users have to install the DirectX SDK to use this? By the way,
this will only be WindowsXP SP2.

Thanks.

[quoted text, click to view]
v-phuang NO[at]SPAM online.microsoft.com (
11/17/2005 12:00:00 AM
Hi

Because you are using DX in managed code, the DX runtime and DirectX
Managed Wrapper is necessary.
Or you may try to use the Windows Mediaplayer Active Control in your code
which is an alternative.

Best regards,

Peter Huang
Microsoft Online Partner Support

Get Secure! - www.microsoft.com/security
This posting is provided "AS IS" with no warranties, and confers no rights.
Alex Maghen
11/17/2005 8:36:10 AM
Sorry to be a pain about this but are you saying that the very simplest way
of playing a sound file from a .NET Windows Forms application necessitates
shipping the DirectX Managed Wrapper and DirectX itself? I mean geez, in
Visual Studio 6.0 a silly little multimedia control was, I believe,
automatically packaged in with the runtime, wasn't it? It just seems like
this is an awful lot of overhead for something as simple and bnasic as
playing a sound. Just confirm that there's no "lighter" way to do this and
I'll continue as you suggest. Thanks.

Alex


[quoted text, click to view]
v-phuang NO[at]SPAM online.microsoft.com (
11/21/2005 11:47:09 AM
Hi

Did my suggestion help you?
If you still have any concern, please feel free to post here.

Best regards,

Peter Huang
Microsoft Online Partner Support

Get Secure! - www.microsoft.com/security
This posting is provided "AS IS" with no warranties, and confers no rights.
rjoubert
6/1/2006 7:08:01 AM
I know this response is a bit late, but hopefully it will help you...

If you don't want to have to distribute the DirectX stuff with your code,
and you can deal with ONLY being able to play WAV files, you can use the
following 3 lines of code...

Dim sp as New System.Media.SoundPlayer
sp.SoundLocation = [full path or URL to the WAV file]
sp.Play( )


[quoted text, click to view]
AddThis Social Bookmark Button