clint 2

I can save this recorded sound in c:\windows\media\recordings

as

mciSendString("save recsound c:\windows\media\recordings\" & Me.SoundName & ".wav", "", 0, 0)

but I am having trouble trying to save it in

My.Computer.FileSystem.SpecialDirectories.MyMusic & "\recordings"

can someone help please

thanks a million

clint




Re: Visual Basic Express Edition special folders

clint

is this difficult to do....

awaiting answer






Re: Visual Basic Express Edition special folders

DMan1

Whats the error or problem




Re: Visual Basic Express Edition special folders

clint

hi dman

2nd line wont work

mciSendString("save recsound c:\windows\media\recordings\" & Me.SoundName & ".wav", "", 0, 0)

mciSendString("save recsound My.Computer.FileSystem.SpecialDirectories.MyMusic & "\recordings\" & Me.SoundName & ".wav", "", 0, 0)

clint






Re: Visual Basic Express Edition special folders

DMan1

Well..you have already stated that it wont work...are you getting any errors DO you realize that the special folder usually points to the "MyMusic" folder in the users "MyDocuments" and NOT windows\media\recordings




Re: Visual Basic Express Edition special folders

clint

sorry dman

no there are no errors but when I change the code to special folder the ......my.computer..... comes up in red

so it is not recognised......i think.......and it does not save the wav........but it works fine in c:\windows\media






Re: Visual Basic Express Edition special folders

Tall Dude

Change:

mciSendString("save recsound My.Computer.FileSystem.SpecialDirectories.MyMusic & "\recordings\" & Me.SoundName & ".wav", "", 0, 0)

to

mciSendString("save recsound" & My.Computer.FileSystem.SpecialDirectories.MyMusic & "\recordings\" & Me.SoundName & ".wav", "", 0, 0)






Re: Visual Basic Express Edition special folders

clint

thanks tall dude, it looks like it should work but it still wont save in special folder.....and yes....I have a folder called recordings in MyMusic folder....

any other ideas....

funny how it saves in C:\windows\media..............with no problems

Private Sub Button9_Click(ByVal sender As System.Object, ByVal e As System.EventArgs) Handles Button9.Click

Dim msg As String

Dim title As String

Dim style As MsgBoxStyle

Dim response As MsgBoxResult

Button9.ForeColor = Color.HotPink

Label8.ForeColor = Color.Beige

'Button7.ForeColor = Color.Beige

PictureBox3.Visible = False

msg = "Do you wish to save this recording " ' Define message.

style = MsgBoxStyle.YesNo

title = "save/discard" ' Define title.

' Display message.

response = MsgBox(msg, style, title)

If response = MsgBoxResult.Yes Then ' User chose Yes.

Me.SoundName = InputBox("Your sound name")

mciSendString("save recsound" & My.Computer.FileSystem.SpecialDirectories.MyMusic & "\recordings\" & Me.SoundName & ".wav", "", 0, 0)

Button9.ForeColor = Color.Beige

Label1.Text = Me.SoundName & ".wav: saved in recordings"

mciSendString("close recsound", "", 0, 0)

dirbox1.Text = "recordings"

NewSong()

Else

Label14.Visible = False

Button9.ForeColor = Color.Beige

PictureBox3.Visible = False

mciSendString("close recsound", "", 0, 0)

dirbox1.Text = " Favorites"

End If

Label8.Text = "record"

NewSong()

End Sub






Re: Visual Basic Express Edition special folders

Tall Dude

put a msgbox("save recsound" & My.Computer.FileSystem.SpecialDirectories.MyMusic & "\recordings\" & Me.SoundName & ".wav")

in there and see if all the backslashes you need are there.






Re: Visual Basic Express Edition special folders

DMan1

Have you changed the default MyMusic directory

Unless the user changed the default settings..."SpecialDirectories.MyMusic" points to

C:\Documents And Settings\UserName\MyDocuments\MyMusic

and it seems that the OP is trying to use special directories to save to c:\windows\media\

I could be wrong, however I would check MyDocuments\MyMusic\recordings

Add: If still no luck create the MyDocuments\MyMusic\recordings directory and then try and save the file and check to see if it is there






Re: Visual Basic Express Edition special folders

clint

dman

the default has not been changed...the directory does exist and there is no reason why the op would be looking at C:\windows\media unless I enter that directory.....

tall dude

I think you are on the right track......the problem would seem to be with the .... ""........ & .... / ..... \ .......etc

will check out the msgbox.....

later

cheers






Re: Visual Basic Express Edition special folders

clint

ok tall dude

I did this

MsgBox("save recsound" & My.Computer.FileSystem.SpecialDirectories.MyMusic & "\recordings\" & Me.SoundName & ".wav")

msgbox result

save "recsoundC:\documents and settings\noel\my documents\my music\recordings\test.wav"

but there is no test.wav in folder......in green is where I think the problem is






Re: Visual Basic Express Edition special folders

clint

I am baffled

the top line is the only one that works....the other two wont save

mciSendString("save recsound C:\windows\media\recordings\" & Me.SoundName & ".wav", "", 0, 0)


mciSendString("save recsound C:\documents and settings\noel\my documents\MyMusic\recordings\" & Me.SoundName & ".wav", "", 0, 0)


mciSendString("save recsound" & My.Computer.FileSystem.SpecialDirectories.MyMusic & "\recordings\" & Me.SoundName & ".wav", "", 0, 0)






Re: Visual Basic Express Edition special folders

Martin Cowen

But the top line has a space between recsound and C, the last one doesn't.
Also in
mciSendString("save recsound C:\documents and settings\noel\my documents\MyMusic\recordings\" & Me.SoundName & ".wav", "", 0, 0)
is the only one where the path name includes space characters , so try enclosing the whole path in quotes eg
mciSendString("save recsound ""C:\documents and settings\noel\my documents\MyMusic\recordings\" & Me.SoundName & ".wav""", "", 0, 0)
and
mciSendString("save recsound """ & My.Computer.FileSystem.SpecialDirectories.MyMusic & "\recordings\" & Me.SoundName & ".wav""", "", 0, 0)





Re: Visual Basic Express Edition special folders

clint

thanks martin

your last line did the trick....triple quotes

and that is the one I wanted............................special folder

I had tried every variation I could think of.......

thank you very much

cheers

clint