AI Zone Admin Forum Add your forum

NEWS: Chatbots.org survey on 3000 US and UK consumers shows it is time for chatbot integration in customer service!read more..

Naïve question
 
 

Hello,

I’m new to ChatScript.

I downloaded version 9 to a Windows 10 - 64bit laptop and extracted the contents.

As documented I doubled clicked on chatscript.exe in BINARIES but the conversation was strange :
—————————————-
Enter user name: michel

TES: Gambit1
michel: > Hey !
TEST: Gambit1
michel: tell me
TEST: Gambit1
michel: >
—————————————-

- is that normal ? Looks like a test bot ? How should I start talking with the default bot ?

Thanks in advance for your help,
-michel

 

 
  [ # 1 ]

Yes, I must have uploaded a testbed bot. Just type into it :build harry

 

 
  [ # 2 ]

Thank you Bruce.

My default bot now has voice in, which is a problem as my default french laptop’s voice speaks english with a french accent ...

Is it possible to remove voice from that default bot ? Some param or recompile needed ?

Kind regards from a newbie,
-michel

 

 
  [ # 3 ]

2 ways. you can remove the code in simplecontrol.top for the entire xpostprocess topic at the end

Or in the botmacro add
$SHUTUP = 1

 

 
  [ # 4 ]

Also, if you do want voice, you can customise the language and voice of your bot using the web speech API in JavaScript.

This would be helpful boiler plate for you which you can use to customise the one in the Chatscript WEBINTERFACE/SPEECH/speech.php file which I presume you are using:

// TTS code taken and modified from here:
// http://stephenwalther.com/archive/2015/01/05/using-html5-speech-recognition-and-text-to-speech
//---------------------------------------------------------------------------------------------------
// say a message
function speak(textcallback{
    
var = new SpeechSynthesisUtterance();
    
u.text text;
    
u.lang 'fr-FR';
    
// u.lang = 'en-US';
    //u.lang = 'en-GB';
    
u.voice 4;   // 3 = american female  0 worse female 1 = not best femal
    
u.rate 1.0// .85
    
u.pitch .9;  
    
u.volume 1.0;  // .5 

My own speech code is different to the CS boiler plate, but assuming you are using CS you can see that there is a u.lang key with value ‘fr-FR’. Your bot will now be able to speak French if fed French text and associated with a French voice. Below it I have commented out the American and British English equivalents. You can choose which you can use, as long as only one is uncommented.

The second key element, which is the one you’re having trouble with, is the u.voice. If you keep changing the numbers you will eventually find one that has the right accent for you. For instance for me 6 is a posh British man, where 22 is a Spanish speaker. In Chrome voice 9 is French. Try different numbers until you get what you like.

Having said that, the web speech API can be tricky in terms of ensuring consistency of voices across platforms. It taps into the voice synthesis (and recognition) systems of each OS and even browser in the case of Chrome, so what you hear in your computer may not be what others hear on different platforms, so worth cross-platform testing if this matters in your implementation.

For now, if you want to have speech enabled, but don’t want a garbled accent, just ensure the lang setting is set to the language you want and either comment out the voice parameter (the default will be for the api to find the voice that best matches the language) or else play around with different numbers until you find the voice you like.

 

 
  [ # 5 ]

Hi,

I started to study the excellent docs and also played a bit.

Still have this issue :

Bruce Wilcox - Jan 21, 2019:

Yes, I must have uploaded a testbed bot. Just type into it :build harry

I did this :build harry a number of times, but it still says it is TEST :

TEST:  Hi, again.
michel: > how are you today ?
TEST:  As good as can be expected.
michel: >
TEST:  I don’t know what to say.
michel: >

I could not find from where “TEST” could be coming ... maybe that’s in the code ??

Thanks again for the help,
-michel

 

 
  [ # 6 ]

the bot message prefix will be in the bot macro in simplecontrol.top.
But merely doing build will not redefine the contents of the bot macro for a particular user that exists. You either have to change to a new user name, delete contents of the USERS folder, or type :reset

 

 
  [ # 7 ]

thank you Bruce !

 

 
  [ # 8 ]

Thank you Ismael !
-michel

Ismael Velasco - Jan 25, 2019:

Also, if you do want voice, you can customise the language and voice of your bot using the web speech API in JavaScript.

This would be helpful boiler plate for you which you can use to customise the one in the Chatscript WEBINTERFACE/SPEECH/speech.php file which I presume you are using:

// TTS code taken and modified from here:
// http://stephenwalther.com/archive/2015/01/05/using-html5-speech-recognition-and-text-to-speech
//---------------------------------------------------------------------------------------------------
// say a message
function speak(textcallback{
    
var = new SpeechSynthesisUtterance();
    
u.text text;
    
u.lang 'fr-FR';
    
// u.lang = 'en-US';
    //u.lang = 'en-GB';
    
u.voice 4;   // 3 = american female  0 worse female 1 = not best femal
    
u.rate 1.0// .85
    
u.pitch .9;  
    
u.volume 1.0;  // .5 

My own speech code is different to the CS boiler plate, but assuming you are using CS you can see that there is a u.lang key with value ‘fr-FR’. Your bot will now be able to speak French if fed French text and associated with a French voice. Below it I have commented out the American and British English equivalents. You can choose which you can use, as long as only one is uncommented.

The second key element, which is the one you’re having trouble with, is the u.voice. If you keep changing the numbers you will eventually find one that has the right accent for you. For instance for me 6 is a posh British man, where 22 is a Spanish speaker. In Chrome voice 9 is French. Try different numbers until you get what you like.

Having said that, the web speech API can be tricky in terms of ensuring consistency of voices across platforms. It taps into the voice synthesis (and recognition) systems of each OS and even browser in the case of Chrome, so what you hear in your computer may not be what others hear on different platforms, so worth cross-platform testing if this matters in your implementation.

For now, if you want to have speech enabled, but don’t want a garbled accent, just ensure the lang setting is set to the language you want and either comment out the voice parameter (the default will be for the api to find the voice that best matches the language) or else play around with different numbers until you find the voice you like.

 

 
  login or register to react