Solved

increase volume while playing wave files over modem

Posted on 2003-11-12
5
243 Views
Last Modified: 2010-08-05
i have integrated tapi and sapi to make an interactive voice response system.

my application is somewhat similar to answering machine where i present a menu which user can select several options.

i have used tapi to answer calls and then using sapi functions i play the voice over phone line.

i use

1) getAudioOutputs  -  to obtain all the wave outputs devices

2) AudioOuput - to set the wave output device as modem.

now the problem i face is that the voice which i hear is very low. Although the clearity is good.


is there any way u can guide me ???
0
Comment
Question by:jaakash
5 Comments
 
LVL 2

Expert Comment

by:MaxPol
ID: 9730643
Use the Microsoft Sound REcorder to increase the Wav sound and save it to use it.

No other idea for now.

Max
0
 
LVL 3

Accepted Solution

by:
Basker earned 500 total points
ID: 9749674
Check out this article in MSDN
How to Control the Volume of Sound Files from Visual Basic
ID: Q118377
 
 
I don't know whether this would help you, let us try it out

Sample Code

Sub Form_Load ()
   Dim x As Integer
   Dim BothVolumes As Long

 ' Note that the waveid is 0 indicating the first wave output device.
 ' If you were to play multiple wavefiles on multiple wave output devices
 ' you would use 1 for the second wave output device, 2 for the third and
 ' so on.
 ' This code will retrieve the current volume setting

   x = waveOutGetVolume(0, BothVolumes)

   ' This code isolates the low-order word.
   ' Note that the value &HFFFF& is a Long Integer, which is the same
   ' as 0000FFFF, but because Visual Basic would automatically
   ' truncate this to FFFF, you must force the logical operation to use
   ' a four-byte Long Integer (0000FFFF) rather than a two-byte Integer
   ' (FFFF). This is accomplished by using the type casting
   ' character (&).
   CurrentVolLeft = BothVolumes And &HFFFF&

   ' This code isolates the high-order word.
   ' Enter the following two lines as one, single line:
   CurrentVolRight = ((BothVolumes And &HFFFF0000) / &H10000)
     And &HFFFF&

   LeftVol.Caption = Hex$(CurrentVolLeft)   ' Update the label with the
   RightVol.Caption = Hex$(CurrentVolRight) ' current volume settings.
End Sub

Sub PlaySound_Click ()
   Dim x As Integer
   Dim wFlags As Integer
   Dim SoundName As String
   SoundName = "C:\WINDOWS\MSREMIND.WAV"    ' Pick any wave file.
   wFlags = SND_ASYNC Or SND_NODEFAULT
   x = sndPlaySound(SoundName$, wFlags%)    ' Play the wave file.
End Sub

Sub LeftUp_Click ()
   ' Increase the left sound channel setting:
   Dim x As Integer
   CurrentVolLeft = CurrentVolLeft + &H1000&
   ' Prevent the channel setting from exceeding the maximum limit:
   If CurrentVolLeft > &HFFFF& Then CurrentVolLeft = &HFFFF&
   LeftVol.Caption = Format$(Hex$(CurrentVolLeft))
   ' Enter the following two lines as one, single line:
   x = waveoutSetVolume(0, CInt("&H" + Hex$(CurrentVolRight)),
      CInt("&H" + Hex$(CurrentVolLeft)))
End Sub

Sub LeftDown_Click ()
   ' Decrease the left sound channel setting:
   Dim x As Integer
   CurrentVolLeft = CurrentVolLeft - &H1000&
   ' Prevent the channel setting from dropping below the minimum limit:
   If CurrentVolLeft < &H0& Then CurrentVolLeft = &H0&
   LeftVol.Caption = Hex$(CurrentVolLeft)
   ' Enter the following two lines as one, single line:
   x = waveoutSetVolume(0, CInt("&H" + Hex$(CurrentVolRight)),
      CInt("&H" + Hex$(CurrentVolLeft)))
End Sub

Sub RightUp_Click ()
   ' Increase the right sound channel setting:
   Dim x As Integer
   CurrentVolRight = CurrentVolRight + &H1000&
   ' Prevent the channel setting from exceeding the maximum limit.
   If CurrentVolRight > &HFFFF& Then CurrentVolRight = &HFFFF&
   RightVol.Caption = Hex$(CurrentVolRight)
   ' Enter the following two lines as one, single line:
   x = waveoutSetVolume(0, CInt("&H" + Hex$(CurrentVolRight)),
      CInt("&H" + Hex$(CurrentVolLeft)))
End Sub

Sub RightDown_Click ()
   ' Decrease the right sound channel setting:
   Dim x As Integer
   CurrentVolRight = CurrentVolRight - &H1000&
   ' Prevent the channel setting from dropping below the minimum limit:
   If CurrentVolRight < 0 Then CurrentVolRight = 0
   RightVol.Caption = Hex$(CurrentVolRight)
   ' Enter the following two lines as one, single line:
   x = waveoutSetVolume(0, CInt("&H" + Hex$(CurrentVolRight)),
      CInt("&H" + Hex$(CurrentVolLeft)))
End Sub
0
 
LVL 49

Expert Comment

by:DanRollins
ID: 10537300
Moderator, my recommended disposition is:

    Accept Basker's comment(s) as an answer.

Dan Rollins -- EE database cleanup volunteer
0

Featured Post

Live: Real-Time Solutions, Start Here

Receive instant 1:1 support from technology experts, using our real-time conversation and whiteboard interface. Your first 5 minutes are always free.

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…
If you need to start windows update installation remotely or as a scheduled task you will find this very helpful.
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…
Get people started with the utilization of class modules. Class modules can be a powerful tool in Microsoft Access. They allow you to create self-contained objects that encapsulate functionality. They can easily hide the complexity of a process from…

775 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