Machsupport Forum

Mach Discussion => General Mach Discussion => Topic started by: lew on July 31, 2007, 08:49:55 PM

Title: Question regarding wav files
Post by: lew on July 31, 2007, 08:49:55 PM
Hi All:
I only read briefly the M-code calling of a macro. I was wondering if anyone has any suggestions or if it's possible to call a wav or other sound file using an M code in a program and making the macro somehow refer to the wav file?
Just thinking "out loud" here. I can see where it might be helpful if I can call a sound file at a program pause that says something like "change the part".
I know I posted something like this before but didn't figure on the possibiliity of using a macro.
Thanks
LEW
Title: Re: Question regarding wav files
Post by: Brian Barker on August 01, 2007, 05:07:31 PM
Check out the customization Manual (mach2) and you will see there is a VB call for that :) Also you can use speak("Feed MEE Seemore")

Thanks
Brian
Title: Re: Question regarding wav files
Post by: lew on August 01, 2007, 08:42:24 PM
Thanks, Brian.
I wonder if you could show me what the exact syntax would be for the speak command in a gcode program. Or, is that actually the correct syntax which you posted?
LEW
Title: Re: Question regarding wav files
Post by: Brian Barker on August 01, 2007, 11:05:26 PM
Speak( "Say this")


You need to have that in a macro... can't be done in VB and you need to see that you have speaking turned on in the configs

Thanks
Brian
Title: Re: Question regarding wav files
Post by: lew on August 02, 2007, 01:17:47 PM
Thanks again Brian. I guess I'm having difficulty seeing that I can type the word speak and then type ("say this") in a file and save it with a "mls" extension. Then call that file with an mcode in a gcode program and have the computer read what I've typed and convert it to sound.????
OK I'm a little low on the learning curve with this one but is what I've described correct? Or, do I have to set something else up so that my typed message can be audiblized? I do have speach toggled on in the general config. screen.
By the way I did just what was described but no sound.
Thanks for your patience.
LEW
Title: Re: Question regarding wav files
Post by: Chaoticone on August 02, 2007, 08:43:52 PM
Lew, that all sounds right to me. I'm not sure about how you will call it from your G-code though. Have you tried stepping through your macro while it is open in the VB script editor?

Brett
Title: Re: Question regarding wav files
Post by: lew on August 02, 2007, 10:10:34 PM
Guys, thanks for the replies.
Here's what I've done so far.
I've made sure the speakers work.
I've made a simple Gcode file like this:
;program to test speech
g90
g0 x1.0 y1.0
m90000   ;this is the macro call. In the manual it explains that end users can use m90000 thru m99999 with no fear of overlapping assigned mcodes.
m01
g0 x0.0 y0.0
m30

I created a macro file with the extension ".m1s" I used the letter L between the "m" and "s"  first and saw that the extension is acutally the number 1 and not an L. I named it m90000.m1s
I put that file in the "macro" directory under the "Mach" directory as instructed in tne manual.
The macro file reads like this:
speak("change the part")

When I run the Gcode it runs through to the m01 and pauses but no audible.
I hit the run key and it finishes the program and sets it back at the start.
Sorry, for being so persistant about this. Just that I have the time now and it's beginning to crank me off a bit that I can't figure it out.
I'm sure I'm doing something wrong  - that's the case usually. But, that's just me. I don't like to back away unsuccessfully.
It's a good suggestion to use the vb editor to examine the file. I'll do that in a short bit.
Thanks again for being patient.
LEW

Title: Re: Question regarding wav files
Post by: Chaoticone on August 02, 2007, 10:16:05 PM
Yeap Lew, I just tried it. I think you need to save it from the VB editor in mach. As it turns out, I have a very nasty machine, you shoould hear the things it was saying to me. LOL That is how it works and it works well. To call it, just type in M???? whatever you named your macro and hit enter in the MDI screen. Save it in the profile you want it to work in. C, Mach3, macros, profile???? and it should work. I don't think you can call a macro from a macro though, that would be fun.

Brett
Title: Re: Question regarding wav files
Post by: lew on August 02, 2007, 10:34:26 PM
Thanks Brett:
I just tried it also. Using the VB editor in Mach and I had to chuckle, it worked pretty good. It uses the built in voice reader which I'll probably change later. For now, though, while it works in the VB editor it does not work from the Gcode file. I didn't try it from the mdi screen but I ran the gcode file a number of times and it does not work. The syntax I used is exactly as typed in my previous email with this one exception. I noticed that I used a lower case "m" in the macro call. m90000. And I saved the file with an upper case "M". So, I changed the lower case "m" in the gcode to an upper case "M". But to no avail. Still confused.
It is pretty cool though.
Oh, I added some typed lines when I heard it work from the VB editor. None too flattering I might add. And, sure enough, it voiced exactly what I typed.
LEW
Title: Re: Question regarding wav files
Post by: Chaoticone on August 02, 2007, 10:39:54 PM
Are you saving it in the profile you are running? That is all I can think of that would cause that problem.

Brett
Title: Re: Question regarding wav files
Post by: lew on August 02, 2007, 10:54:28 PM
Acutally, no.
I have only saved it in the directory "macros" under "mach".
I'll have a look and see if that does it.
Oh, I did try it from the mdi and it did not work there either.
I'll see about saving it in the profile directory.
Thanks
LEW
Title: Re: Question regarding wav files
Post by: lew on August 02, 2007, 11:08:49 PM
Thanks a million Brett.
I just saved it in the correct profile and it works. Simply awesome. So glad this forum and guys like you exist. Now I'm gonna have a blast. It's truly great to have so much functionality in this one package.
LEW
Title: Re: Question regarding wav files
Post by: Chaoticone on August 03, 2007, 06:22:43 AM
 :) I hear you Lew, glad you got it and, your welcome. I have to agree, with all of the functionality of Mach, you just can't help but fall in love.

Brett