Hello Guest it is December 21, 2024, 10:48:32 AM

Author Topic: Question regarding wav files  (Read 7856 times)

0 Members and 1 Guest are viewing this topic.

Offline lew

*
  •  74 74
Question regarding wav files
« 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
Re: Question regarding wav files
« Reply #1 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
« Last Edit: August 01, 2007, 05:10:07 PM by Brian Barker »
Fixing problems one post at a time ;)

www.newfangledsolutions.com
www.machsupport.com

Offline lew

*
  •  74 74
Re: Question regarding wav files
« Reply #2 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
Re: Question regarding wav files
« Reply #3 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
Fixing problems one post at a time ;)

www.newfangledsolutions.com
www.machsupport.com

Offline lew

*
  •  74 74
Re: Question regarding wav files
« Reply #4 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

Offline Chaoticone

*
  • *
  •  5,624 5,624
  • Precision Chaos
Re: Question regarding wav files
« Reply #5 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
;D If you could see the things I have in my head, you would be laughing too. ;D

My guard dog is not what you need to worry about!

Offline lew

*
  •  74 74
Re: Question regarding wav files
« Reply #6 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

Offline Chaoticone

*
  • *
  •  5,624 5,624
  • Precision Chaos
Re: Question regarding wav files
« Reply #7 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
« Last Edit: August 02, 2007, 10:19:36 PM by Chaoticone »
;D If you could see the things I have in my head, you would be laughing too. ;D

My guard dog is not what you need to worry about!

Offline lew

*
  •  74 74
Re: Question regarding wav files
« Reply #8 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

Offline Chaoticone

*
  • *
  •  5,624 5,624
  • Precision Chaos
Re: Question regarding wav files
« Reply #9 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
;D If you could see the things I have in my head, you would be laughing too. ;D

My guard dog is not what you need to worry about!