File Dialog Question

K

kronecker

I have a short routine that writes to a wav file. The details of the
wav write file bit is not important. At present it put a file dialog
up and you type in a name for the file name and you save. Works fine.
Actually I want this to be much easier and fix the file name to say
file_name.wav instead of a dialog pop-up. How do I do this apparent
simple task!

Dim sfd As New SaveFileDialog()
Try
sfd.Filter = "All files (*.*)|*.*|wav files (*.wav)|*.wav"
sfd.Title = "Save to a wave file"
sfd.FilterIndex = 2
sfd.RestoreDirectory = True
If sfd.ShowDialog() = DialogResult.OK Then
Dim SpFileMode As SpeechStreamFileMode =
SpeechStreamFileMode.SSFMCreateForWrite
Dim SpFileStream As New SpFileStream()
SpFileStream.Open(sfd.FileName, SpFileMode, False)

' Write text to speech to wav file here
vox.AudioOutputStream = SpFileStream

vox.Speak(read_speak.TextBox1.Text,
SpeechVoiceSpeakFlags.SVSFlagsAsync)

vox.WaitUntilDone(Timeout.Infinite)
SpFileStream.Close()
End If

Catch
' Some stuff here
End Try
 
K

Kerry Moorman

(e-mail address removed),

You are using a file dialog but you don't want to? What's up with that?

Kerry Moorman
 
K

kronecker

(e-mail address removed),

You are using a file dialog but you don't want to? What's up with that?

Kerry Moorman

It needs to be automatic - to use the same name each time. So how to I
ovveride the file dialog thingy so I can fix the filename.

regards

K.
 

Ask a Question

Want to reply to this thread or ask your own question?

You'll need to choose a username for the site, which only take a couple of moments. After that, you can post your question and our members will help you out.

Ask a Question

Top