diff --git a/.gitignore b/.gitignore index 73eb23bd..527f72d5 100644 --- a/.gitignore +++ b/.gitignore @@ -11,4 +11,4 @@ examples/grammars/Recordings/**/User6/* examples/grammars/Recordings/**/User7/* examples/grammars/Recordings/**/User8/* examples/grammars/Recordings/**/User9/* - +TTS/11labs/*.wav diff --git a/TTS/11labs/synthesize.py b/TTS/11labs/synthesize.py new file mode 100644 index 00000000..c4dd3895 --- /dev/null +++ b/TTS/11labs/synthesize.py @@ -0,0 +1,25 @@ +import requests + +CHUNK_SIZE = 1024 +url = "https://api.elevenlabs.io/v1/text-to-speech/7p1Ofvcwsv7UBPoFNcpI?output_format=pcm_16000" + +headers = { + "Accept": "audio/wav", + "Content-Type": "application/json", + "xi-api-key": "" +} + +data = { + "text": "To verify your account, I will need 3 things: your full name, your date of birth, and your address. Can you provide me those 3 things please?", + "model_id": "eleven_monolingual_v1", + "voice_settings": { + "stability": 0.5, + "similarity_boost": 0.5 + } +} + +response = requests.post(url, json=data, headers=headers) +with open('11-labs-output-e1.wav', 'wb') as f: + for chunk in response.iter_content(chunk_size=CHUNK_SIZE): + if chunk: + f.write(chunk) diff --git a/declarative-ivr/select-and-transfer.json b/declarative-ivr/select-and-transfer.json new file mode 100644 index 00000000..63142b9e --- /dev/null +++ b/declarative-ivr/select-and-transfer.json @@ -0,0 +1,107 @@ +{ + "DEFAULTS": { + "repromtOnDisconfirm": "Sorry, I did not hear it.", + "prefixes": { + "noInput": [ + "Sorry, I did not hear it.", + "Sorry, I still did not hear it." + ], + "noMatch": [ + "Sorry, I did not get it.", + "Sorry, I still did not get it." + ] + } + }, + "GRAMMARS": { + "NameCheck": { + "type": "JJSGF", + "parameters": { + "tag-format": "semantics/1.0-literals" + }, + "grammar": "namecheck", + "public": { + "root": " {Bob} | {Frank} " + }, + "rules": { + "Bob": "(Bob)", + "Frank": "(Frank)" + } + } + }, + "ENTRY": { + "type": "VOID", + "voice": "catherine", + "next": "Welcome" + }, + "ERROR": { + "type": "DISCONNECT", + "prompt": "Sorry, there was an error. Please call back later", + "reason": "ERROR" + }, + "Welcome": { + "type": "OUTPUT", + "voice": "catherine", + "prompt": "Welcome to Transfer Genie", + "next": "HandleUserSelection" + }, + "HandleUserSelection": { + "type": "INPUT", + "name": "userSelect", + "voice": "catherine", + "prompt": "Please say the name of the person you want to talk to", + "bargeIn": true, + "grammar": [ + "NameCheck" + ], + "noInputMax": 2, + "noMatchMax": 2, + "confirmation": { + "threshold": 0.5, + "prompt": "You selected ${userSelect}. Is that correct?" + }, + "fail": "CallHealth", + "next": "ProcessUserSelection" + }, + "ProcessUserSelection": { + "type": "EVAL", + "eval": "'${userSelect}'", + "case": [ + { + "expr": "'${1}'=='Bob'", + "next": "TransferforBob" + }, + { + "expr": "'${1}'=='Frank'", + "next": "TransferforFrank" + } + ] + }, + "TransferforBob": { + "type": "TRANSFER", + "voice": "catherine", + "prompt": "Dialing Bob's extension 20955088", + "phone": { + "phoneNumber": "+13212918281,www20955088" + }, + "fail": "TransferFailed" + }, + "TransferforFrank": { + "type": "TRANSFER", + "voice": "catherine", + "prompt": "Dialing Frank's extension 703", + "phone": { + "phoneNumber": "+19725180863,www7w0w3" + }, + "fail": "TransferFailed" + }, + "TransferFailed": { + "type": "DISCONNECT", + "prompt": "Sorry, the transfer failed. Good bye.", + "reason": "Transfer Failed" + }, + "CallHealth": { + "type": "DISCONNECT", + "prompt": "I have trouble understanding you. Please call back later", + "reason": "CALL-HEALTH" + } +} \ No newline at end of file diff --git a/declarative-ivr/select-and-transfer.yml b/declarative-ivr/select-and-transfer.yml new file mode 100644 index 00000000..12f906bf --- /dev/null +++ b/declarative-ivr/select-and-transfer.yml @@ -0,0 +1,82 @@ +--- +DEFAULTS: + repromtOnDisconfirm: Sorry, I did not hear it. + prefixes: + noInput: + - Sorry, I did not hear it. + - Sorry, I still did not hear it. + noMatch: + - Sorry, I did not get it. + - Sorry, I still did not get it. +GRAMMARS: + NameCheck: + type: JJSGF + parameters: + tag-format: semantics/1.0-literals + grammar: namecheck + public: + root: " {Bob} | {Frank} " + rules: + Bob: "(Bob)" + Frank: "(Frank)" + +ENTRY: + type: VOID + voice: catherine + next: Welcome +ERROR: + type: DISCONNECT + prompt: Sorry, there was an error. Please call back later + reason: ERROR +Welcome: + type: OUTPUT + voice: catherine + prompt: Welcome to Transfer Genie + next: HandleUserSelection +HandleUserSelection: + type: INPUT + name: userSelect + voice: catherine + prompt: Please say the name of the person you want to talk to + bargeIn: true + grammar: + - NameCheck + noInputMax: 2 + noMatchMax: 2 + confirmation: + threshold: 0.5 + prompt: 'You selected ${userSelect}. Is that correct?' + fail: CallHealth + next: ProcessUserSelection +ProcessUserSelection: + type: EVAL + eval: "'${userSelect}'" + case: + - expr: "'${1}'=='Bob'" + next: TransferforBob + - expr: "'${1}'=='Frank'" + next: TransferforFrank +TransferforBob: + type: TRANSFER + voice: catherine + prompt: Dialing Bob's extension + phone: + phoneNumber: "+19725180863,wwww700" + fail: TransferFailed +TransferforFrank: + type: TRANSFER + voice: catherine + prompt: Dialing Frank's extension + phone: + phoneNumber: "+19725180863,wwww701" + fail: TransferFailed +TransferFailed: + type: DISCONNECT + prompt: Sorry, the transfer failed. Good bye. + reason: Transfer Failed +CallHealth: + type: DISCONNECT + prompt: I have trouble understanding you. Please call back later + reason: CALL-HEALTH + + diff --git a/new-examples/off-line/ol-upload-bulk.py b/new-examples/off-line/ol-upload-bulk.py index 9f53ecd1..d892c261 100644 --- a/new-examples/off-line/ol-upload-bulk.py +++ b/new-examples/off-line/ol-upload-bulk.py @@ -13,9 +13,9 @@ inputFolder = cfg.get("DEFAULT", "INPUTFOLDER") outputFolder = cfg.get("DEFAULT", "OUTPUTFOLDER") -#model = "VoiceGain-omega" +model = "VoiceGain-omega" #model = None -model = "whisper:medium" +#model = "whisper:medium" print("model: {}".format(model)) @@ -52,8 +52,11 @@ }, "settings": { "asr": { - #"languages" : ["es", "en"], - "languages" : ["en"], + "languages" : ["es", "en"], + #"languages" : ["en"], + "languageDetection" : { + "aggregation" : "start_weighted", + }, "acousticModelNonRealTime" : model, "noInputTimeout": -1, "completeTimeout": -1, diff --git a/new-examples/off-line/ol-upload-single.py b/new-examples/off-line/ol-upload-single.py index f31a4899..eb793aad 100644 --- a/new-examples/off-line/ol-upload-single.py +++ b/new-examples/off-line/ol-upload-single.py @@ -14,9 +14,9 @@ inputFname = cfg.get("DEFAULT", "INPUTFILE") outputFolder = cfg.get("DEFAULT", "OUTPUTFOLDER") -#model = "VoiceGain-omega" +model = "VoiceGain-omega" #model = None -model = "whisper:medium" +#model = "whisper:medium" print("model: {}".format(model)) @@ -55,8 +55,8 @@ }, "settings": { "asr": { - #"languages" : ["es", "en"], - "languages" : ["de"], + "languages" : ["es", "en"], + #"languages" : ["de"], "acousticModelNonRealTime" : model, "noInputTimeout": -1, "completeTimeout": -1,