Quantcast
Channel: VBForums - Visual Basic .NET
Viewing all articles
Browse latest Browse all 27329

VS 2010 Playin Audio From Resources

$
0
0
Attachment 94187


PHP Code:

Imports System.Runtime.InteropServices
Public Class Form1
    
<DllImport("winmm.dll")> Shared Function PlaySound(ByVal szSound As StringByVal hModule As UIntPtrByVal fdwSound As Integer) As Integer
    End 
Function
    <
DllImport("winmm.dll"SetLastError:=True)> Shared Function waveOutGetNumDevs() As Integer
    End 
Function
    <
Flags()>
    Public 
Enum SoundFlags As Integer
        SND_SYNC 
= &H0
        SND_ASYNC 
= &H1
        SND_NODEFAULT 
= &H2
        SND_MEMORY 
= &H4
        SND_LOOP 
= &H8
        SND_NOSTOP 
= &H10
        SND_PURGE 
= &H40
        SND_NOWAIT 
= &H2000
        SND_ALIAS 
= &H10000
        SND_FILENAME 
= &H20000
        SND_RESOURCE 
= &H40004
    End Enum

    
Private Sub Play(ByVal path As String)
        
PlaySound(pathUIntPtr.ZeroSoundFlags.SND_FILENAME Or SoundFlags.SND_NOSTOP)
    
End Sub
    
Public Function rtrnsnd(ByVal filename As String) As Object
        
Return My.Resources.ResourceManager.GetObject(filename.ToString)
    
End Function

    Private 
Sub Button1_Click(sender As System.ObjectAs System.EventArgsHandles Button1.Click
        Play
(rtrnsnd("bin"))
    
End Sub
End 
Class 

What did i do wrong ?
Attached Images
 

Viewing all articles
Browse latest Browse all 27329

Trending Articles



<script src="https://jsc.adskeeper.com/r/s/rssing.com.1596347.js" async> </script>