Custom ringtone in alarm clock

hellxox

New member
Joined
Jan 10, 2010
Messages
3
Programming Experience
Beginner
This is my alarm clock , I want to publish to the public . So , I want it to be customise alarm clock. Everyone got their own favourite ringtone. So do I . How can I make my alarm clock ringtone to be custom ?

thanks in advance.

This is my alarm clock. I will give you the source code if you want ;)

02590436002333437721.png


VB.NET:
http://www.mediafire.com/?owyyizl3tmf
 
Last edited:
I think what you are trying to explain is that you do this now:
VB.NET:
My.Computer.Audio.Play(My.Resources.ringout, AudioPlayMode.BackgroundLoop)
and that you want to do this instead:
VB.NET:
My.Computer.Audio.Play([U]?user selected audio?[/U], AudioPlayMode.BackgroundLoop)
If you look at the help file you see there are several options to provide audio to play: My.Computer.Audio.Play Method
For example instead of playing a resource you can have the user browse to an audio file with a OpenFileDialog and store that path in an application setting (My.Settings.filepath) and you can then play that:
VB.NET:
My.Computer.Audio.Play(My.Settings.filepath, AudioPlayMode.BackgroundLoop)
OpenFileDialog Class (System.Windows.Forms)
My.Settings Object
 
Yes. But there's a error ( red ) :

VB.NET:
Type 'Stream' is not defined.

I'm using OpenFileDialog

Dim myStream As Stream = Nothing
Dim openFileDialog1 As New OpenFileDialog()

openFileDialog1.InitialDirectory = "c:\"
openFileDialog1.Filter = "txt files (*.wav)|*.wav|All files (*.*)|*.*"
openFileDialog1.FilterIndex = 2
openFileDialog1.RestoreDirectory = True

If openFileDialog1.ShowDialog() = System.Windows.Forms.DialogResult.OK Then
Try
myStream = openFileDialog1.OpenFile()
If (myStream IsNot Nothing) Then
' Insert code to read the stream here.
End If
Catch Ex As Exception
MessageBox.Show("Cannot read file from disk. Original error: " & Ex.Message)
Finally
' Check this again, since we need to make sure we didn't throw an exception on open.
If (myStream IsNot Nothing) Then
myStream.Close()
End If
End Try
End If
End Sub
 
Last edited:
BUMP ~ I know how to make openfiledialog . but I dont know how to intergerate with the ringtone someone help me.
 
You don't need a IO.Stream to play audio file.
help said:
' Usage
My.Computer.Audio.Play(location)


location

A String containing the name of the sound file
Location parameter is the string path of the file, which is what the file dialog provides with FileName property.
 
Back
Top