
Register and join over 40,000 other developers!
Recent Topics
-
Print specific values from dictionary with a specific key name
Siten0308 - Jun 20 2019 01:43 PM
-
Learn algorithms and programming concepts
johnnylo - Apr 23 2019 07:49 AM
-
Job Gig PHP Form Needed
PJohnson - Apr 18 2019 03:55 AM
-
How to make code run differently depending on the platform it is running on?
xarzu - Apr 05 2019 09:17 AM
-
How do I set a breakpoint in an attached process in visual studio
xarzu - Apr 04 2019 11:47 AM
Recent Blog Entries
Recent Status Updates
Popular Tags
- networking
- Managed C++
- stream
- console
- database
- authentication
- Visual Basic 4 / 5 / 6
- session
- Connection
- asp.net
- import
- syntax
- hardware
- html5
- array
- mysql
- java
- php
- c++
- string
- C#
- html
- loop
- timer
- jquery
- ajax
- javascript
- programming
- android
- css
- assembly
- c
- form
- vb.net
- xml
- linked list
- login
- encryption
- pseudocode
- calculator
- sql
- python
- setup
- help
- game
- combobox
- binary
- hello world
- grid
- innerHTML

20 replies to this topic
#13
Posted 17 September 2010 - 08:02 PM
Great tutorial man

#14
Posted 29 July 2011 - 07:41 AM
Hi I am new to VB and I was looking at this to play mutiple sound but for some reason this it never worked. What I am doing wrong here..
Public Class Form1
Public Declare Function mciSendString Lib "winmm.dll" Alias "mciSendStringA" (ByVal lpstrCommand As String, ByVal lpstrReturnString As String, ByVal uReturnLength As Integer, ByVal hwndCallback As Integer) As Integer
Dim musicAlias As String
Dim musicPath As String
Private Sub Form1_Load(ByVal sender As System.Object, ByVal e As System.EventArgs) Handles MyBase.Load
musicAlias = "myAudio"
musicPath = IO.Path.GetDirectoryName(Application.ExecutablePath) & "\sounds\super mario bros remix dj alexander.wav"
mciSendString("Open " & Chr(34) & musicPath & Chr(34) & " alias " & musicAlias, CStr(0), 0, 0)
mciSendString("Play " & musicAlias, CStr(0), 0, 0)
End Sub
End Class
Public Class Form1
Public Declare Function mciSendString Lib "winmm.dll" Alias "mciSendStringA" (ByVal lpstrCommand As String, ByVal lpstrReturnString As String, ByVal uReturnLength As Integer, ByVal hwndCallback As Integer) As Integer
Dim musicAlias As String
Dim musicPath As String
Private Sub Form1_Load(ByVal sender As System.Object, ByVal e As System.EventArgs) Handles MyBase.Load
musicAlias = "myAudio"
musicPath = IO.Path.GetDirectoryName(Application.ExecutablePath) & "\sounds\super mario bros remix dj alexander.wav"
mciSendString("Open " & Chr(34) & musicPath & Chr(34) & " alias " & musicAlias, CStr(0), 0, 0)
mciSendString("Play " & musicAlias, CStr(0), 0, 0)
End Sub
End Class
#15
Posted 13 September 2011 - 09:32 AM
Hi!
Your thread was very helpful!
I am able to play multiple sound at once,
but I wonder how to make a max/min volume to control the volume while playing the sound ?
can anyone help me ?
Thanks!
Your thread was very helpful!
I am able to play multiple sound at once,
but I wonder how to make a max/min volume to control the volume while playing the sound ?
can anyone help me ?
Thanks!
#16
Posted 04 November 2011 - 10:16 PM
Is there an ability to loop music files this way?
sorry I am a total noob at coding and this was a huge help since all I wanted was to play background music and the occasional sound effect. Definite + rep, you saved me from killin someone for sure!!
edit:
and while Im pulling off my little thread necro here, Is it possible to use this to play a small 'playlist' of music? from the look of it I think I can sorta see how you could, but again I suck at this still
sorry I am a total noob at coding and this was a huge help since all I wanted was to play background music and the occasional sound effect. Definite + rep, you saved me from killin someone for sure!!
edit:
and while Im pulling off my little thread necro here, Is it possible to use this to play a small 'playlist' of music? from the look of it I think I can sorta see how you could, but again I suck at this still
Edited by Tyrranus, 04 November 2011 - 10:52 PM.
#17
Posted 06 November 2011 - 04:05 PM
noone?
#18
Posted 10 November 2011 - 09:10 PM


#19
Posted 30 November 2012 - 04:34 PM
Hello!
Thank you for the code that's working number 1!
2 question tho
!
I've search arround the internet to find a way to put a button Volume + and Volume -, is there any command line that you know that can do this?
And is there a way to loop the music once it's done?
Thanks for any help!
Thank you for the code that's working number 1!
2 question tho

I've search arround the internet to find a way to put a button Volume + and Volume -, is there any command line that you know that can do this?
And is there a way to loop the music once it's done?
Thanks for any help!
#20
Posted 15 January 2013 - 06:51 AM
Hi for this code here. i got a question. If i would to copy my program code and use it into another computer, it will not work right?? compare to the 1st one
Dim musicAlias As String = "myAudio"
Dim musicPath As String = "C:\Users\Public\Music\Sample Music\Symphony_No_3.wma"
this is the 1st one!
My.Computer.Audio.Play(musicPath, AudioPlayMode.BackgroundLoop)
My.Computer.Audio.Play(musicPath, AudioPlayMode.WaitToComplete)
Dim musicAlias As String = "myAudio"
Dim musicPath As String = "C:\Users\Public\Music\Sample Music\Symphony_No_3.wma"
this is the 1st one!
My.Computer.Audio.Play(musicPath, AudioPlayMode.BackgroundLoop)
My.Computer.Audio.Play(musicPath, AudioPlayMode.WaitToComplete)
#21
Posted 10 February 2013 - 12:31 PM
nice, thanks
Also tagged with one or more of these keywords: VB.NET, form
Tutorial Forums →
Visual Basic Tutorials →
Visual Basic .NET Tutorial - How to add google maps in a VB programme Part 2/2 - codecall.netStarted by Cobus, 09 Feb 2016 ![]() |
|
![]() |
||
General Forums →
General Programming →
Specifying PHP file path while creating an HTML formStarted by gvvishwanath, 30 Dec 2015 ![]() |
|
![]() |
||
Language Forums →
Visual Basic →
Find & Replace in MenuStripStarted by Gooer, 21 Dec 2015 ![]() |
|
![]() |
||
Language Forums →
Visual Basic →
Program to give sum of all odd and even digitsStarted by Gooer, 09 Dec 2015 ![]() |
|
![]() |
||
Language Forums →
Visual Basic →
DSP (Digital Signal Processing) with VB.NetStarted by LoneRanger, 19 Aug 2015 ![]() |
|
![]() |
Recommended from our users: Dynamic Network Monitoring from WhatsUp Gold from IPSwitch. Free Download