sonus icon indicating copy to clipboard operation
sonus copied to clipboard

Text to speech

Open sharmmoh1983 opened this issue 7 years ago • 15 comments

Are you planning to use any text to speech conversion

sharmmoh1983 avatar Jun 02 '17 19:06 sharmmoh1983

like Amazon polly

sharmmoh1983 avatar Jun 02 '17 19:06 sharmmoh1983

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')
    }
  }
})

evancohen avatar Jun 02 '17 23:06 evancohen

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

sharmmoh1983 avatar Jun 03 '17 17:06 sharmmoh1983

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.

evancohen avatar Jun 04 '17 18:06 evancohen

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 avatar Jun 05 '17 01:06 sharmmoh1983

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

sharmmoh1983 avatar Jun 05 '17 08:06 sharmmoh1983

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

sharmmoh1983 avatar Jun 05 '17 09:06 sharmmoh1983

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

evancohen avatar Jun 05 '17 17:06 evancohen

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

sharmmoh1983 avatar Jun 05 '17 23:06 sharmmoh1983

Still doesn't work even after that change I made

16alexanders avatar Jun 06 '17 21:06 16alexanders

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

evancohen avatar Jun 07 '17 00:06 evancohen

So it is 7:30 am or pm

sharmmoh1983 avatar Jun 07 '17 02:06 sharmmoh1983

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

sharmmoh1983 avatar Jun 07 '17 02:06 sharmmoh1983

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

sharmmoh1983 avatar Jun 08 '17 06:06 sharmmoh1983

@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.

evancohen avatar Jun 08 '17 18:06 evancohen