Solved

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

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

Free Tool: SSL Checker

Scans your site and returns information about your SSL implementation and certificate. Helpful for debugging and validating your SSL configuration.

One of a set of tools we are providing to everyone as a way of saying thank you for being a part of the community.

Question has a verified solution.

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

If you're writing a .NET application to connect to an Access .mdb database and use pre-existing queries that require parameters, you've come to the right place! Let's say the pre-existing query(qryCust) in Access takes a Date as a parameter and l…
Introduction When many people think of the WebBrowser (http://msdn.microsoft.com/en-us/library/2te2y1x6%28v=VS.85%29.aspx) control, they immediately think of a control which allows the viewing and navigation of web pages. While this is true, it's a…
Nobody understands Phishing better than an anti-spam company. That’s why we are providing Phishing Awareness Training to our customers. According to a report by Verizon, only 3% of targeted users report malicious emails to management. With compan…
In a recent question (https://www.experts-exchange.com/questions/29004105/Run-AutoHotkey-script-directly-from-Notepad.html) here at Experts Exchange, a member asked how to run an AutoHotkey script (.AHK) directly from Notepad++ (aka NPP). This video…

685 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