Solved

how to play sound (wav) on .net compact framework?

Posted on 2004-04-27
6
4,660 Views
Last Modified: 2012-05-04
Hi, again me...

I want to learn how to play sound (wav, mp3 or wma) on .Net Compact Framework.
(Pocket PC 2003)

Thanks i bag you please answer me...
0
Comment
Question by:Obsolate
  • 3
6 Comments
 
LVL 48

Expert Comment

by:Mikal613
ID: 10928672
Option Explicit
Public Declare Function CreateProcess Lib "coredll" Alias "CreateProcessW" ( _
    ByVal pszImageName As String, _
    ByVal pszCmdLine As String, _
    ByVal psaProcess As Long, _
    ByVal psaThread As Long, _
    ByVal fInheritHandles As Long, _
    ByVal fdwCreate As Long, _
    ByVal pvEnvironment As Long, _
    ByVal pszCurDir As Long, _
    ByVal psiStartInfo As Long, _
    ByVal pProcInfo As Long) As Long
'pword.exe should be peplaced by t he the Mediaplayer exe
'strFileName is the file name
Private Sub Command1_Click()
    Dim lnCreateProcess As Long
    Dim strFileName As String
    strFileName = "\My Documents\DocName.psw"
    On Error Resume Next
    lnCreateProcess = CreateProcess("\Windows\pword.exe", strFileName, 0, 0, 0, 0, 0, 0, 0, 0)
    If lnCreateProcess = 0 Then
        MsgBox Err.Description
    End If
End Sub
0
 
LVL 37

Expert Comment

by:gregoryyoung
ID: 10935303
0
 
LVL 37

Expert Comment

by:gregoryyoung
ID: 11002233
How did this work out ? Did you spawn a seperate process to do it or did you use the API ?
0
 

Author Comment

by:Obsolate
ID: 11002606
thanx for your help.. but
I'm don't work this codes.. i'm don't use API , i new user to visual basic. very hard (visual hard) :)
how to more basic code? (  play("\test.mp3") )

Comment from Mikal613
Date: 04/27/2004 04:49PM EEST
answers not running
ERROR : NotSupportedException

i'm 0.003 % speak english. ok!!

0
 
LVL 37

Accepted Solution

by:
gregoryyoung earned 125 total points
ID: 11003154
The link I gave has at the top a link marked "download" if you look there it has VB.NET source code to play a sound ...

it looks like this ...

WaveOut wo = new WaveOut();
wo.Play(fileName, 512*1024, 0xffff, 0xffff);
0

Featured Post

Threat Intelligence Starter Resources

Integrating threat intelligence can be challenging, and not all companies are ready. These resources can help you build awareness and prepare for defense.

Join & Write a Comment

Suggested Solutions

It’s quite interesting for me as I worked with Excel using vb.net for some time. Here are some topics which I know want to share with others whom this might help. First of all if you are working with Excel then you need to Download the Following …
It was really hard time for me to get the understanding of Delegates in C#. I went through many websites and articles but I found them very clumsy. After going through those sites, I noted down the points in a easy way so here I am sharing that unde…
Internet Business Fax to Email Made Easy - With eFax Corporate (http://www.enterprise.efax.com), you'll receive a dedicated online fax number, which is used the same way as a typical analog fax number. You'll receive secure faxes in your email, fr…
Get a first impression of how PRTG looks and learn how it works.   This video is a short introduction to PRTG, as an initial overview or as a quick start for new PRTG users.

744 members asked questions and received personalized solutions in the past 7 days.

Join the community of 500,000 technology professionals and ask your questions.

Join & Ask a Question

Need Help in Real-Time?

Connect with top rated Experts

10 Experts available now in Live!

Get 1:1 Help Now