Echo and cat questions

Discussion in 'Mac Programming' started by jamesapp, Sep 19, 2009.

  1. jamesapp macrumors 6502a

    Joined:
    Mar 7, 2008
    #1
    Hello,
    I am testing out a doubletalk speech synthesizer, which I have plugged into a ftdi chip USB to serial adaptor. I have the ftdi driver installed. My question is do I have to configure something in terminal to get the echo and or cat command to work? Like do I need to set the speed on my mac to 9600 baud, which is the speed the synthesizer needs? The speed is just an example, pretty sure it is set right. Just wondering is there anything I can do to make the cat and echo commands work? When I try echo and cat now with my synthesizer plugged in I redirect the command to my USB to serial adaptor, on my computer I type
    cat > /dev/cu.usbserial-FTKVMAFF
    I don't get any error messages when I run these commands, but I don't get any audio output either. Any help would be appreciated. btw I used a terminal emulator, ckermit, in terminal and was able to get some audio output from my synthesizer. So I am pretty sure that certain things are working i.e. My synthesizer was talking and my USB to serial adaptor is working. But I can't get the echo or cat commands to give audio output.
     
  2. chown33 macrumors 604

    Joined:
    Aug 9, 2009
    #2
    If echo and cat don't work, then don't use them. Use your ckermit command, since it's obviously capable of initializing the serial port so it correctly communicates with the doubletalk speech synthesizer. The echo and cat commands can't, so stop using them for things they aren't capable of.

    You've been asking questions about this same subject for quite some time. May I ask what you're doing (or trying to do), that you need a speech synthesizer connected by a serial-port? Why not use the builtin Mac OS X synthesizer? It has a command-line (the 'say' command) that lets you specify any text or file, and specify different voices by name. Farting around trying to get 15-year-old technology to play nice just seems like a colossal waste of time.

    http://developer.apple.com/mac/library/documentation/Darwin/Reference/ManPages/man1/say.1.html
     
  3. jamesapp thread starter macrumors 6502a

    Joined:
    Mar 7, 2008
    #3
    In the user manual for my doubletalk lt speech synthesizer it talks about how you can program the tone generators. Also I think I can get my synthesizer to speak Spanish. That is the kind of thing I am interested in. I was communicating with one of the creaters of ckermit the terminal emulator I had been using with my synthesizer. We were trying to use ckermit to log a session redirecting it to my synthesizer. But it didn't work, so my theory is that what ever is causing the cat and echo command not to work is also what is causing the session log in ckermit not to work. So I am wondering is there anything I need to set up with my computer to get cat and or echo to work?
     
  4. chown33 macrumors 604

    Joined:
    Aug 9, 2009
    #4
    What do you want the tone generators for? Are you saying that you need a Spanish language speech synthesizer?

    What is your goal? Be specific.

    I'm asking because you seem unsure that those are the things you need to do. "I think I can..." sounds more like a possible outcome of an exploration.

    Your theory (which is really a hypothesis) could be flawed. It could even be completely wrong. You need a thorough understanding of the serial-port ioctl functions and options to assess that hypothesis. If you don't have that, then you're just guessing.

    I'm hardly an expert on the tty ioctl functions & options, but I do know the device has to be configured after it's opened. The device will initially open with some defaults, but if those aren't what's needed, then you have to configure it.

    Neither cat nor echo know anything about having to configure a serial device. So if it doesn't work with the device defaults, then it won't work with cat or echo. I know of nothing that would change that, because the device defaults are pretty much hard-wired.

    You picked a difficult area to explore, if you're simply interested in exploration. Serial-ports are one of the most obscure and obtuse things in Unix. Then throw in the fact that you're also dealing with a driver for a USB-connected serial-port, and it's even more difficult. If you don't have the skills to be hacking on the port in C using ioctl() and other low-level functions, then getting it all to work reliably is even more unlikely.

    It would probably be simpler to just get an old clunker PC with an actual serial port. Then you could use all those old PC programs that were important when serial ports were common.

    If one of your goals is Spanish language speech synthesis, I recommend getting one of the Spanish language voices from Cepstral.

    http://cepstral.com/

    You can download them and try them for free, but it will automatically speak a "trial message" until you pay for an unlock key. I've evaluated several of the Spanish and French language voices, and the quality is quite good. I recommended that my client pay for the license, which he did. I haven't heard from him about Snow Leopard yet. That could mean he hasn't tried to upgrade, or it could mean there are no problems with the voices.

    If you want tone generators, you'll have to be specific about what kind of tones you want to generate. Without any other information, I'm guessing that the Core Audio API would be involved, but that's just a guess. It could be that simple sampled-sound playback would also work. It's impossible to say without details.
     
  5. jamesapp thread starter macrumors 6502a

    Joined:
    Mar 7, 2008
    #5
    I believe I am using cu like I use /dev/cu.usbserial-FTKVMAFF to access my serial port, don't know if that makes a difference or not? What does ioctl mean? When you say "then you have to configure it." when refering to the device, does that mean, I can't change the cat and echo commands to work with the device? Would it be hard to configure the device, like would it be almost impossible?
     
  6. chown33 macrumors 604

    Joined:
    Aug 9, 2009
    #6
    It's still a tty-type device (or technically, a character special device). cu just changes one thing about how opening it works.

    It means the ioctl() C function. It's one of the low-level I/O functions. man ioctl.

    Are you prepared to edit the source of those commands and make them do something special with serial-port devices?

    Review the following message thread:

    http://forums.macrumors.com/showthread.php?t=769327

    If all the code and discussion makes sense to you, then the answer is "No, not impossible". Difficult, probably, but not impossible. If none of the code or discussion makes sense, then the answer is "Yes, impossible".

    And I reiterate my question: What is your goal? Be specific.
     
  7. jamesapp thread starter macrumors 6502a

    Joined:
    Mar 7, 2008
    #7
    I appreciate the responses. One of my goals is to use my synthesizer along with a screen reader program. So what ever gets written to the screen gets said by the synthesizer. I have been told about VoiceOver but I wanted to use my doubletalk speech synthesizer. I was close with ckermit using the log session command and then ssh localhost, the commands seemed to work but I didn't get audio output. If I did get the log session command to give audio output, I was then going to try and automate some of the commands by putting them in a shell script. I read in the doubletalk lt manual about tone generators, they said in the manual something about telephone tones. Like my synthesizer can send out telephone tones. I thought that was kind of neat. Another thing the manual talked about was another set of tones you can generate, I would like to fool around with my synthesizer and see what sounds I could generate. The link you gave me about serial ports with tiger and leopard, I have to admit is very technical. I don't know where I would start to learn about what I would want to do? One thing I thought about was that I had sent my doubletalk lt speech synthesizer in to the company that makes it to get it tested, to make sure it was working. I talked to one of the guys from the company and he said they had updated the software on the doubletalk. So I am wondering, maybe if I knew what to configure, they could do it for me. Or maybe if I had the proper software I could configure it myself? Thanks again for responses.
     

Share This Page