20 Jun '13 - 02:40 *
Welcome, Guest. Please login or register.
Did you miss your activation email?

Login with username, password and session length
 
   Home   Help Search Login Register  
Pages: [1]
  Reply  |  Print  
Author Topic: How can i control the volume in my program?  (Read 338 times)
salem249
Posts: 11


« on: 13 Aug '12 - 20:03 »
Reply with quoteQuote

hi
in my program i used Bass.BASS_GetVolume to control the volume but instead of controlling the volume of my program is started to control the volume of windows.


    Public Sub play()
        If Bass.BASS_Init(-1, 44100, BASSInit.BASS_DEVICE_DEFAULT, IntPtr.Zero) Then
            ' create a stream channel from a file
            Dim stream As Integer = Bass.BASS_StreamCreateURL("http://127.0.0.1:8001/stream2", 0, BASSFlag.BASS_DEFAULT, Nothing, IntPtr.Zero)
            eror = Un4seen.Bass.Bass.BASS_ErrorGetCode

            If stream <> 0 Then
                ' play the stream channel
                Bass.BASS_ChannelPlay(stream, False)
            Else
                ' error creating the stream
                MsgBox("Stream error: " & Bass.BASS_ErrorGetCode())
            End If



          
        End If

    End Sub



    Private Sub Button3_Click(ByVal sender As System.Object, ByVal e As System.EventArgs) Handles Button3.Click
        Bass.BASS_SetVolume(Bass.BASS_GetVolume + 0.1)
    End Sub

  

« Last Edit: 13 Aug '12 - 20:36 by salem249 » Logged
Ionut Cristea
Posts: 1382


« Reply #1 on: 13 Aug '12 - 20:41 »
Reply with quoteQuote

 you can use BASS_ChannelSetAttribute(chan,BASS_ATTRIB_VOL,vol) to set channels volume. Using BASS_SetVolume is used to set the volume of the device that BASS was initialized.
Logged
Chris
Posts: 1507


« Reply #2 on: 13 Aug '12 - 20:43 »
Reply with quoteQuote

hi
in my program i used Bass.BASS_GetVolume to control the volume but instead of controlling the volume of my program is started to control the volume of windows.

   Private Sub Button3_Click(ByVal sender As System.Object, ByVal e As System.EventArgs) Handles Button3.Click
        Bass.BASS_SetVolume(Bass.BASS_GetVolume + 0.1)
    End Sub

Should be
Private Sub Button3_Click(ByVal sender As System.Object, ByVal e As System.EventArgs) Handles Button3.Click
     BASS_ChannelSetAttribute(Channel,BASS_ATTRIB_VOL,YourwantedVolume);
End Sub
Logged
Pages: [1]
  Reply  |  Print  
 
Jump to:  

Powered by SMF 1.1.18 | SMF © 2013, Simple Machines