Hi,
I am doing a alarm system project which allows a user to select a particular alarm and test the sound. It will also enable the user to save the alarm as the prefered type. So that the next time the alarm rings, it will be that tone which the user has selected.
i have already done the select alarm button, play and stop button, but i am having trouble with the save button.
the bottom is my code for the select and play and stop button coding:
I am doing a alarm system project which allows a user to select a particular alarm and test the sound. It will also enable the user to save the alarm as the prefered type. So that the next time the alarm rings, it will be that tone which the user has selected.
i have already done the select alarm button, play and stop button, but i am having trouble with the save button.
the bottom is my code for the select and play and stop button coding:
Imports System.media
Imports System.IO
Imports system
Public Class alarm
Dim opendialog As New OpenFileDialog
Private Sub Button1_Click(ByVal sender As System.Object, ByVal e As System.EventArgs) Handles Button1.Click
opendialog.Filter = "WAV Files|*.wav|ALL Files|*.*"
If opendialog.ShowDialog = Windows.Forms.DialogResult.OK Then
End If
End Sub
Private Sub Button2_Click(ByVal sender As System.Object, ByVal e As System.EventArgs) Handles Button2.Click
End Sub
Private Sub Button3_Click(ByVal sender As System.Object, ByVal e As System.EventArgs) Handles Button3.Click
'only wav files with small size can play
Dim player As New SoundPlayer(opendialog.FileName)
Try
player.Play()
Catch ex As Exception
MsgBox("An error occured while playing media file")
Finally
player.Dispose()
End Try
End Sub
Private Sub Button4_Click(ByVal sender As System.Object, ByVal e As System.EventArgs) Handles Button4.Click
Dim player As New SoundPlayer(opendialog.FileName)
player.Stop()
player.Dispose()
End Sub
End Class