[2 days left] What’s wrong with your cloud strategy? Learn why multicloud solutions matter with Nimble Storage.Register Now

x
?
Solved

VB.NET 2005 - how to play a wav in an app for a windows mobile 5 application

Posted on 2006-10-20
4
Medium Priority
?
859 Views
Last Modified: 2011-10-03
VB.NET 2005 - how to play a wav in an app for a windows mobile 5 application

Really struggling with this - I'm guessing the playsound wrapper isn't available..... anyone any ideas on the most efficient way of playing a wav on an ipaq?

Thanks,

Jc
0
Comment
Question by:misdevelopment
[X]
Welcome to Experts Exchange

Add your voice to the tech community where 5M+ people just like you are talking about what matters.

  • Help others & share knowledge
  • Earn cash & points
  • Learn & ask questions
  • 2
4 Comments
 
LVL 2

Expert Comment

by:sivic82
ID: 17776137
By playsound wrapper I'm assuming your refering to my.Computer.Audio.Play("c:\my.wav")??
0
 

Author Comment

by:misdevelopment
ID: 17776610
Yes, we don't seem to have this available to us, even though we've looked to reference and import anything that looked like it might do the job.... I guessed that with it being for a mobile device that the classes weren't valid...
0
 
LVL 13

Accepted Solution

by:
newyuppie earned 2000 total points
ID: 17778338
i've made a class that plays wav files asynchronously from your resources. you just need to insert the wav file in the sound resources, select Embedded in ResX for both the resource, and the file in the Solution Explorer too, in the resources folder.

Imports System
Imports System.Media
Imports System.Resources
Imports System.Reflection
Imports System.IO

Public Class Sound
    Public Shared Sub PlayWavResource(ByVal wav As String)

        ' get the namespace
        Dim strNameSpace As String = Assembly.GetExecutingAssembly().GetName().Name.ToString()
        Dim tempSpace As String = "CSCM"

        ' get the resource into a stream
        Dim resourceStream As Stream = Assembly.GetExecutingAssembly().GetManifestResourceStream(tempSpace + "." + wav)
        If resourceStream Is Nothing Then Exit Sub

        With New SoundPlayer(resourceStream)
            .Play()
        End With
    End Sub

End Class
0
 
LVL 13

Expert Comment

by:newyuppie
ID: 17778342
just replace
Dim tempSpace As String = "CSCM"

with
Dim tempSpace As String = [your root namespace]
0

Featured Post

On Demand Webinar: Networking for the Cloud Era

Did you know SD-WANs can improve network connectivity? Check out this webinar to learn how an SD-WAN simplified, one-click tool can help you migrate and manage data in the cloud.

Question has a verified solution.

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

Well, all of us have seen the multiple EXCEL.EXE's in task manager that won't die even if you call the .close, .dispose methods. Try this method to kill any excels in memory. You can copy the kill function to create a check function and replace the …
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 …
Visualize your data even better in Access queries. Given a date and a value, this lesson shows how to compare that value with the previous value, calculate the difference, and display a circle if the value is the same, an up triangle if it increased…
Are you ready to place your question in front of subject-matter experts for more timely responses? With the release of Priority Question, Premium Members, Team Accounts and Qualified Experts can now identify the emergent level of their issue, signal…

656 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