1

I'm currently making a program to listen to and record sounds. I use mcisendring, WMPLib.WindowsMediaPlayer lib. but i have a problem.

After I insert the URL of the playlist as an array value, play it back, and want to change the label value after all playback, the label value changes before playback. I think the AxWindows MediaPlayer object needs to be initialized after playback, but I don't know how.

I want to change button1.text after AxWindowsMediaPlayer1.Ctlcontrols.play(). but this code doen't.

here is the code

For i = 0 To songs.Length - 1
    songs(i) = songDir & "\" & tmpmix(i) & ".mp3"
Next
Dim media As WMPLib.IWMPMedia = Nothing
Player = New WMPLib.WindowsMediaPlayer

For Each song As String In songs
    media = AxWindowsMediaPlayer1.newMedia(song)
    AxWindowsMediaPlayer1.currentPlaylist.appendItem(media)
Next

AxWindowsMediaPlayer1.Ctlcontrols.play()

If Main.RadioButton1.Checked Then
    Button1.Text = "Remember numbers."
End If

No errors are reported.

rene
  • 41,474
  • 78
  • 114
  • 152
JUNSEOK OH
  • 11
  • 1
  • "before playback" doesn't mean that much. It is busy playing after you call play(). But it will need some time to find and open the file, buffer its content, perhaps play through silence at the start of the song. Could take a couple of seconds. You might prefer its PlayStateChange to update the UI. – Hans Passant Jun 01 '19 at 09:44

0 Answers0