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 #47

Open
sharmmoh1983 opened this issue Jun 2, 2017 · 15 comments
Open

Text to speech #47

sharmmoh1983 opened this issue Jun 2, 2017 · 15 comments

Comments

@sharmmoh1983
Copy link

Are you planning to use any text to speech conversion

@sharmmoh1983
Copy link
Author

like Amazon polly

@evancohen
Copy link
Owner

I'd considered baking it into the library #25 but it's so simple to add on I'm not sure it's worth it. Super simple sudocode example of how could do this:

sonus.on('final-result', result => {
  intent.process(result, => (response, prompt) {
    say.speek(response)
    if(prompt) {
      sonus.trigger(sonus, 0, 'some hotword')
    }
  }
})

@sharmmoh1983
Copy link
Author

what is this intent process and prompt.I need to implement session using hotword so as long as session is open i don't want hotrod to be associated with statement in session

@evancohen
Copy link
Owner

It's just sudocode. You'd replace that with whatever actual intent processor you have. If you say the hotword while cloud recognition is in progress is will not begin another recognition.

@sharmmoh1983
Copy link
Author

Ok I am trying to trigger the hotrod once all the response is flushed out to the speaker if prompt is required from the user.

Player.on('flush' , function(){console.log("In flush block");
if(session)
sonus.trigger(sonus, 0, 'snowboy') ;

        });

Is this oK

Also wanted to know if I can use hotword only during the start of the conversation and not in all subsequent interactions until i say stop

@sharmmoh1983
Copy link
Author

How to make sure when speaker has played out the response and then trigger hotword manually

@sharmmoh1983
Copy link
Author

sharmmoh1983 commented Jun 5, 2017

Sonus.pause and resume are not working it is still picking what is said after user utterance

After triggering hotword manually I am getting what was said in speaker. it seems it keeps on listening after sonus.pause

Sinus.Pause is not stoping mic to stop listening

Please let me know how to access Audio buffer from microphone

@evancohen
Copy link
Owner

Are you use you are using Sonus.pause() correctly? You cannot call .pause() on your created Sonus object. To be clear:

const sonus = Sonus.init({ hotwords }, speech)

sonus.pause() // does nothing
Sonus.pause(sonus) // should work

@sharmmoh1983
Copy link
Author

I am doing following thing:

sonus.on('final-result', result => {
console.log("UserSpeech : ", result)
Sinus.pause(sonus);


bufferStream.pipe(Player)

         Player.on('flush' , function(){console.log("In flush block");
          //if(session)
            

        });
         Player.on('close' , function(){console.log("In player close block")
          Sonus.resume(sonus) 
           sonus.trigger(sonus, 0, 'snowboy') ;
       });

and then in some function down the line I am executing Sonus.resume(sonus) after that calling manual trigger of hotword
But it seems it is taking time to do pause and resume both

There is no possibility of capturing pauseOnComplete and resumeOnComplete events while pausing and resuming mic?

I need on functionality where mic listens nothing till I emit hotword manually which seems to be not the case as it is going into endless loop of recognising things which are played out by speaker

@16alexanders
Copy link

Still doesn't work even after that change I made

@evancohen
Copy link
Owner

I'll be online after work today and will have time to take a look at this and give you a hand. There's an unofficial Discord channel: https://discord.gg/35zesAR

I should be on at ~7:30 PST

@sharmmoh1983
Copy link
Author

So it is 7:30 am or pm

@sharmmoh1983
Copy link
Author

I have joined the channel .. Are u available on the channel

@sharmmoh1983
Copy link
Author

How to configure for multiple languages(Google Speech API) in sonus

@evancohen
Copy link
Owner

evancohen commented Jun 8, 2017

@sharmmoh1983 please open separate issues for new questions. Right now there is no support for multiple simultaneous languages: API.md#languages

I'm closing this issue because it has been resolved.

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

No branches or pull requests

3 participants