[Okta Webinar] Learn how to a build a cloud-first strategyRegister Now

x
?
Solved

Changing the volume of a .wav file in VB6

Posted on 2006-04-10
1
Medium Priority
?
914 Views
Last Modified: 2008-03-17
I am using this code to play a .wav file in VB6:
This worked for me...notice I'm using PlaySound()...not sndPlaySound()...

Option Explicit

Private Declare Function PlaySound Lib "winmm.dll" Alias "PlaySoundA" (ByVal lpszName As String, ByVal hModule As Long, ByVal dwFlags As Long) As Long

Private Const SND_ASYNC = &H1
Private Const SND_NODEFAULT = &H2
Private Const SND_PURGE = &H40

Private Sub Command1_Click()
    PlayWav "C:\Documents and Settings\Michael\My Documents\007.wav"
End Sub

Private Sub Command2_Click()
    StopWav
End Sub

Private Sub PlayWav(ByVal fileName As String)
    PlaySound fileName, ByVal 0&, SND_ASYNC Or SND_NODEFAULT
End Sub

Private Sub StopWav()
    PlaySound vbNullString, ByVal 0&, SND_PURGE
End Sub

How do I go about being able to change the volume of the wav file as it's being played?
0
Comment
Question by:dtucker
1 Comment
 
LVL 9

Accepted Solution

by:
Naveen Swamy earned 2000 total points
ID: 16423585
you cannot change the volume for a single file but instead you could chnage it for the os or change the tempo or pitch of the wav file

you can further get some help from this link
http://www.experts-exchange.com/Programming/Programming_Languages/Visual_Basic/Q_21270045.html
0

Featured Post

How to Use the Help Bell

Need to boost the visibility of your question for solutions? Use the Experts Exchange Help Bell to confirm priority levels and contact subject-matter experts for question attention.  Check out this how-to article for more information.

Question has a verified solution.

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

The debugging module of the VB 6 IDE can be accessed by way of the Debug menu item. That menu item can normally be found in the IDE's main menu line as shown in this picture.   There is also a companion Debug Toolbar that looks like the followin…
Article by: Martin
Here are a few simple, working, games that you can use as-is or as the basis for your own games. Tic-Tac-Toe This is one of the simplest of all games.   The game allows for a choice of who goes first and keeps track of the number of wins for…
Get people started with the process of using Access VBA to control Excel using automation, Microsoft Access can control other applications. An example is the ability to programmatically talk to Excel. Using automation, an Access application can laun…
Show developers how to use a criteria form to limit the data that appears on an Access report. It is a common requirement that users can specify the criteria for a report at runtime. The easiest way to accomplish this is using a criteria form that a…
Suggested Courses
Course of the Month20 days, 7 hours left to enroll

867 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