Solved

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

Posted on 2004-04-27
6
4,674 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

Master Your Team's Linux and Cloud Stack!

The average business loses $13.5M per year to ineffective training (per 1,000 employees). Keep ahead of the competition and combine in-person quality with online cost and flexibility by training with Linux Academy.

Question has a verified solution.

If you are experiencing a similar issue, please ask a related question

Since .Net 2.0, Visual Basic has made it easy to create a splash screen and set it via the "Splash Screen" drop down in the Project Properties.  A splash screen set in this manner is automatically created, displayed and closed by the framework itsel…
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 …
This tutorial gives a high-level tour of the interface of Marketo (a marketing automation tool to help businesses track and engage prospective customers and drive them to purchase). You will see the main areas including Marketing Activities, Design …
Established in 1997, Technology Architects has become one of the most reputable technology solutions companies in the country. TA have been providing businesses with cost effective state-of-the-art solutions and unparalleled service that is designed…

778 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