Lower level sound playing.
I was wondering if it would be possible in Visual Basic to play sounds at lower levels, rather than just using API's and controls to play sound files. I really have no idea how sound on windows actually works, but is there a place I could learn? I'd like to just be able to get some solid notes out of my speaker for starters. Thanks.
Re: Lower level sound playing.
Best way that I use to lower and increase volume.
form
VB Code:
Private Sub cmdLow_Click()
modMusicStuff.subSetVolume ("Decrease")
End Sub
Private Sub cmdHigh_Click()
modMusicStuff.subSetVolume ("Increase")
End Sub
modMusiStuff
VB Code:
'Increase or Decrease the volume, update volume indicator controls.
Public Sub subSetVolume(sVolumeSet As String)
Select Case sVolumeSet$
Case "Increase"
If modMusicVariables.iVolumeSetting < 995 Then
modMusicVariables.iVolumeSetting = modMusicVariables.iVolumeSetting + 166
'Set the playing volume.--------------------------------------------------------
mciSendString "setaudio mp3 volume to " & modMusicVariables.iVolumeSetting, 0, 0, 0
'-------------------------------------------------------------------------------
End If
Case "Decrease"
If modMusicVariables.iVolumeSetting > 331 Then
modMusicVariables.iVolumeSetting = modMusicVariables.iVolumeSetting - 166
'Set the playing volume.--------------------------------------------------------
mciSendString "setaudio mp3 volume to " & modMusicVariables.iVolumeSetting, 0, 0, 0
'-------------------------------------------------------------------------------
End If
End Select
Call subVolumeInd(modMusicVariables.iVolumeSetting)
modMusicVariables
VB Code:
Private m_iVolumeSetting As Integer
'Holds the current value of the volume.
'm_iVolumeSetting.
Property Get iVolumeSetting() As Integer
iVolumeSetting = m_iVolumeSetting
End Property
Property Let iVolumeSetting(newValue As Integer)
m_iVolumeSetting = newValue
End Property
Re: Lower level sound playing.
Quote:
Originally Posted by Nove
I was wondering if it would be possible in Visual Basic to play sounds at lower levels, rather than just using API's and controls to play sound files. I really have no idea how sound on windows actually works, but is there a place I could learn? I'd like to just be able to get some solid notes out of my speaker for starters. Thanks.
Take a look at this, it might help.
http://www.vbforums.com/showthread.php?t=388562
Don't forget that it is work under construction, and it's not finished yet.
Re: Lower level sound playing.
Thanks, looks like I'll be waiting for how to dynamically create tones/beeps with custom frequencies.
Re: Lower level sound playing.
Quote:
Originally Posted by Nove
Thanks, looks like I'll be waiting...
Well, I did stuff like this in the past:
http://www.vbforums.com/showthread.php?t=358329
http://www.vbforums.com/showthread.php?t=333806
Re: Lower level sound playing.
Uh sry for spamming, but did the code I provide work?
Re: Lower level sound playing.
I'm sure your code works fine, I don't really have a use for it yet though, I'll have to get the whole wav thing working first. Thanks both.