Solved

increase volume while playing wave files over modem

Posted on 2003-11-12
5
237 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

What Should I Do With This Threat Intelligence?

Are you wondering if you actually need threat intelligence? The answer is yes. We explain the basics for creating useful threat intelligence.

Join & Write a Comment

Introduction While answering a recent question (http://www.experts-exchange.com/Q_27402310.html) in the VB classic zone, I wrote some VB code in the (Office) VBA environment, rather than fire up my older PC.  I didn't post completely correct code o…
Have you ever wanted to restrict the users input in a textbox to numbers, and while doing that make sure that they can't 'cheat' by pasting in non-numeric text? Of course you can do that with code you write yourself but it's tedious and error-prone …
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…
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…

743 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

Need Help in Real-Time?

Connect with top rated Experts

16 Experts available now in Live!

Get 1:1 Help Now