Solved Windows Media Player Attributes

murray83

Games Collector
Local time
Today, 23:28
Joined
Mar 31, 2017
Messages
770
Not sure if shuld go here in gen or in modules as its an ActiveX addin

But the issue i have is i want the volume to be set higher then default i have treid moving it up in design view and then saving and opening and it just defuaulst down. Secondly the option to restart a bit of music when it gets to the end as well is this possible

have added an example of stripped down endavour, the looping of song is for the title as it does end and loudnesss is for the stairs creek and as have to have vollume way up high to hear if not
 

Attachments

Take a look at the attached, here's a few controls I found:
Code:
Option Compare Database
Option Explicit

Private wmp As WindowsMediaPlayer
Private Const maxVol As Long = 100
Private Const stepVol As Long = 10

Private Sub btnDecreaseVolume_Click()
    If wmp.settings.volume > 0 Then
        wmp.settings.volume = wmp.settings.volume - stepVol
    End If
End Sub

Private Sub btnIncreaseVolume_Click()
    If wmp.settings.volume < 100 Then
        wmp.settings.volume = wmp.settings.volume + stepVol
    End If
End Sub

Private Sub btnLoop_Click()
    wmp.settings.setMode "loop", Not wmp.settings.getMode("loop")
    setLoopCaption
End Sub

Private Sub btnPlay_Click()
    play
End Sub

Private Sub Form_Load()
    
    ' initialize player
    Set wmp = Me.WindowsMediaPlayer0.Object
    play
    
    ' set initial settings
    wmp.settings.setMode "loop", True
    wmp.settings.volume = 50
    
    ' handle loop toggle caption
    setLoopCaption
End Sub

Private Sub setLoopCaption()
    If wmp.settings.getMode("loop") Then
        Me.btnLoop.Caption = "Disable Loop"
    Else
        Me.btnLoop.Caption = "Enable Loop"
    End If
End Sub

Private Sub play()
    ' song path
    Dim path As String
    path = CurrentProject.path & "\song.mp3"
        
    ' play song
    wmp.URL = path
End Sub
 

Attachments

cheers for that and i shall give that a go and will never give up

he he
 
Take a look at the attached, here's a few controls I found:
Code:
Option Compare Database
Option Explicit

Private wmp As WindowsMediaPlayer
Private Const maxVol As Long = 100
Private Const stepVol As Long = 10

Private Sub btnDecreaseVolume_Click()
    If wmp.settings.volume > 0 Then
        wmp.settings.volume = wmp.settings.volume - stepVol
    End If
End Sub

Private Sub btnIncreaseVolume_Click()
    If wmp.settings.volume < 100 Then
        wmp.settings.volume = wmp.settings.volume + stepVol
    End If
End Sub

Private Sub btnLoop_Click()
    wmp.settings.setMode "loop", Not wmp.settings.getMode("loop")
    setLoopCaption
End Sub

Private Sub btnPlay_Click()
    play
End Sub

Private Sub Form_Load()
   
    ' initialize player
    Set wmp = Me.WindowsMediaPlayer0.Object
    play
   
    ' set initial settings
    wmp.settings.setMode "loop", True
    wmp.settings.volume = 50
   
    ' handle loop toggle caption
    setLoopCaption
End Sub

Private Sub setLoopCaption()
    If wmp.settings.getMode("loop") Then
        Me.btnLoop.Caption = "Disable Loop"
    Else
        Me.btnLoop.Caption = "Enable Loop"
    End If
End Sub

Private Sub play()
    ' song path
    Dim path As String
    path = CurrentProject.path & "\song.mp3"
       
    ' play song
    wmp.URL = path
End Sub

Edgar_ that worked a treat thank you very happy :)
 

Users who are viewing this thread

Back
Top Bottom