Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Text-To-Speech #386

Open
decentralgabe opened this issue Aug 31, 2016 · 9 comments
Open

Text-To-Speech #386

decentralgabe opened this issue Aug 31, 2016 · 9 comments

Comments

@decentralgabe
Copy link

decentralgabe commented Aug 31, 2016

Continuing what I was working on in #280.

I have read when you (Evan) have written about TTS in #78, and agree that having a speech response to most commands would be useless; however, when asking "what time is it?" I think it would be a nice feature if the mirror spoke the time at the user, though the "what time is it" feature should be fixed to display the time on the mirror too if any other services are open. There are other cases too where TTS could be useful down the line – speaking results from the Wolfram Alpha API, announcing sports scores, timed reminders and so on.

I had been looking into the SpeechSynthesis API; however, it appears that Google has dropped support for the API within embedded/dev Chromium environments as of the other month. The problem isn't with the SpeechSynthesis commands itself (they are available within the mirror), but there are no voices available for the API to work with (evident by a call to speechSynthesis.getVoices()). Here's a demo of the API in action using Angular.

I had looked into a few other user's projects that make use of the Speech API (they too do not work in the mirror), including Artyom, and Speech-Synthesis.

What I will attempt next is to work with a few of the Linux-specific TTS solutions outlined here.

Edit: Might be worth noting that SpeechSynthesisUtterances work when I run the mirror code on my Mac, but does not work on the RPi.

@decentralgabe
Copy link
Author

decentralgabe commented Sep 6, 2016

I've been working with getting Festival to speak commands, which work via the terminal, and would work through Vocal; however, ALSA does not allow multiple sound sources (the mirror and festival) to go at the same time.

I've been playing around with the .asoundrc file to see if I can get DMIX to work, but I don't understand this stuff too well yet.

By the way, here's the DMIX guide I've been trying to figure out.

@evancohen
Copy link
Owner

Sorry for the delay in response here! You've answered your own question, DMIX is the way to go. It would be helpful to know what issues you've been having trying to figure it out.

Just taking a stab in the dark here, but if you are using the provided ~/.asoundrc file then you should just be able to update the plugged pcm device, for instance:

pcm.pluged {
    type dmix
    ipc_key 1024
    #this is your output device
    slave.pcm "hw:0,1"
}

@decentralgabe
Copy link
Author

decentralgabe commented Oct 8, 2016

EDIT

Working asoundrc...

pcm.!default {
      type asym
      playback.pcm {
          type plug
          # This is your output device
          slave.pcm "hw:0,0"
      }
      capture.pcm {
          type plug
          # Input device
          slave.pcm "hw:1,0"
      }
}

@evancohen
Copy link
Owner

With the updated speech recognition work that I just completed, my recommendation would be to use Say: https://github.com/Marak/say.js

Troublesome audio configuration should be a thing of the past (I still have to verify this though).

@decentralgabe
Copy link
Author

I had tried say back when I started down this rabbit hole. Just tried it again with the updated mirror code, and it has no output sound, no error messages. I'm guessing there's still a dmix issue.

@evancohen
Copy link
Owner

@glcohen have you followed the updated documentation? I tried Say with Sonus a few weeks ago and it worked without a hitch.

@decentralgabe
Copy link
Author

Updated asoundrc worked!

Should I submit a pull request?

@justbill2020
Copy link
Collaborator

what's the status on this one... @glcohen were you able to submit a pull request to the dev branch can this and #280 be closed? also i'm concerned with the asoundrc info above leading people down the wrong troubleshooting path... can you please update the asoundrc file that is working for you?

@decentralgabe
Copy link
Author

Just submitted pull request here. #280 can be closed.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Projects
None yet
Development

No branches or pull requests

3 participants