Text to speech - not getting audio in the .wav (connection refused) - azure-speech

I run a flask server in which this function is called whenever an specific action occurs on the page :
def generate_audio(text, target):
# create the path
tmp_dir = os.path.join(os.getcwd(), "app/data/audio")
if not os.path.exists(tmp_dir):
os.mkdir(tmp_dir)
path = os.path.join(tmp_dir, f'{target}-{text}.wav')
# query the API
speech_config = SpeechConfig(
subscription=cfg['speech']['key'], region=cfg['speech']['location'])
audio_config = AudioOutputConfig(filename=path)
synthesizer = SpeechSynthesizer(
speech_config=speech_config, audio_config=audio_config)
synthesizer.speak_text("A simple test")
At the end of the execution, the file containing the audio is just an empty 0B file. I literally copy pasted the quick start guide, so I do not know what is wrong.
What I did try is to change the subscription key to something random and no error was raised. In the logs from the azure service webpage nothing comes up either.
Here's the cancellation details
SpeechSynthesisCancellationDetails(reason=CancellationReason.Error, error_details="Connection failed (no connection to the remote host). Internal error: 11. Error details: Code: 0. USP state: 2. Received audio size: 0 bytes.")
Here's the log
https://pastebin.com/aapsMXYc

I was also facing the same issue and found that I was entering incorrect location name. E.g. in resource, you will see a location name like Central India but in SDK it should be entered as centralindia (this name I found under key management). Hope this will help in resolving this issue.
Thanks

Related

While running recorded simulation in Gatling, I got file not found error

now I'm trying to conduct load test with gatling.
I have been trying create gatling's simulation script via gatling recorder and
it was going well.
but, when I executed that, I encountered file not found error below although there are files
(in this case /step1/0006_request.json is exist)
request_6: Failed to build request: Resource /step1/0006_request.json not found
there are many json files and that error occurred some of specific post requests.
every requests which is failed are composed following setting.
using request header 'headers_6' below
using RawFileBody method
(even if this is obvious thing because content-type is 'application/json')
I already have been using 12 hour over and I have to finish my task in a timely manner.
I'm so sorry about that I can't share my application which is target of this issue.
if anyone have any idea or kindly want to more detail please ask me.
val headers_6 = Map(
"Content-Type" -> "application/json",
"Origin" -> "applicationServerURL")
.exec(http("request_6")
.post("requestUrl")
.headers(headers_6)
.body(RawFileBody("/step1/0006_request.json"))
.resources(http("request_7")
additionally, I checked json files which were created by gatling recorder on 'resource' directory, them contains only one char 'X'.
this means Gatling recorder doesn't capture request json file's content?
env:
Gatling version gatling 3.5.1
Used Browser: FireFox
I just solved this issue.
this issue was caused by very simple fact.
firstly, I encountered error message below
request_6: Failed to build request: Resource /step1/0006_request.json not found
and I have to check the file paths although this script was auto created by gatling recorder(do not trust gatling tool).
The auto created file path was absolute path and start with ‘/’. And the script started to work once I remove the ‘/’.
I referred other post on stack overflow, and it was written that file path must be written with absolute path if you are using gatling version 3 or later version.
I hope my reply can be informative to someone who may be having same issue as me.
Using 'relative path'.
//As is
.exec(http("request_6")
.post("requestUrl")
.headers(headers_6)
.body(RawFileBody("/step1/0006_request.json"))
.resources(http("request_7")
//To be
.exec(http("request_6")
.post("requestUrl")
.headers(headers_6)
.body(RawFileBody("step1/0006_request.json"))
.resources(http("request_7")

Download Sharepoint Online file using Python

I am trying to automate some work processes by using Python to download an Excel file from our SharePoint site. Some background is that I'm fairly new to Python and am mostly self-taught. I have read over many examples here using sharepy, office365, requests, etc. and none seem to work. Below is what I have tried (basically copied from another example) with the error below that:
from office365.runtime.auth.authentication_context import AuthenticationContext
from office365.sharepoint.client_context import ClientContext
from office365.sharepoint.file import File
#Inputs
url_shrpt = "https://company.sharepoint.com/sites/teamsite"
username_shrpt = "user#company.com"
password_shrpt = "password"
folder_url_shrpt = "sites/teamsite/library"
#Authentication
ctx_auth = AuthenticationContext(url_shrpt)
if ctx_auth.acquire_token_for_user(username_shrpt, password_shrpt):
ctx = ClientContext(url_shrpt, ctx_auth)
web = ctx.web
ctx.load(web)
ctx.execute_query()
print("Authenticated into sharepoint as: ",web.properties['Title'])
else:
print(ctx_auth.get_last_error())
#Function for extracting the file names from a folder
global print_folder_contents
def print_folder_contents(ctx, folder_url):
try:
folder = ctx.web.get_folder_by_server_relative_url(folder_url)
fold_names = []
sub_folders = folder.files
ctx.load(sub_folders)
ctx.execute_query()
for s_folder in sub_folders:
fold_names.append(s_folder.properties["Name"])
return fold_names
except Exception as e:
print('Problem printing out library contents: ', e)
######################################################
# Call the function by giving your folder URL as input
filelist_shrpt=print_folder_contents(ctx,folder_url_shrpt)
#Print the list of files present in the folder
print(filelist_shrpt)
Here is the error I receive:
Error: HTTPSConnectionPool(host='login.microsoftonline.com', port=443): Max retries exceeded with url: /extSTS.srf (Caused by NewConnectionError(': Failed to establish a new connection: [WinError 10060] A connection attempt failed because the connected party did not properly respond after a period of time, or established connection failed because connected host has failed to respond'))
After collaborating with some more knowledgeable coworkers, I was told it might be a permissions issue; but I'm not sure how to verify that. Any help and/or advice would be appreciated.

moodle invalid response after successful userlogin

i was facing issue in moodle user was not able to logged in so i change the DB collation and user is now able to login into dashboard but i am also getting this error.
Now user is able to login but this popup error is coming.
invalidresponse
Invalid response value detected
File: /lib/externallib.php
Line: 425
Stack trace:
Error in response - Missing following required key in a single structure: tourconfig
Error code: invalidresponse
* line 425 of /lib/externallib.php: invalid_response_exception thrown
* line 250 of /lib/externallib.php: call to external_api::clean_returnvalue()
* line 59 of /lib/ajax/service.php: call to external_api::call_external_function()
For me, user was not able to login into Moodle and it was the dmlwrite exception. So i changed the DB collation of user table and it's started throwing an error after user logged in.
We are running this whole setup on digital ocean and due to some issue in CPU & Memory, i recycle my whole kubernetes cluster and error resolve automatically.
So as #adrian-sărmaș suggested clear cache and give it try for me maybe it was only issue of caching.

setting dropbox as custom backp on whm/cpanel error

I am trying to set dropbox as custom backup destination following below cpanel blog. The connection is working, but the backup files are not being transferred to DropBox. And when I press validate to custom backup destination it gives following error .
https://blog.cpanel.com/cpanel-whm-custom-backup-transport-example-dropbox/
Error: Validation for transport “dropbox” failed: Could not list files in
destination: Executed /usr/local/bin/backup_transport_dropbox.pl ls /
remotehost remoteuser : 2018-08-26T15:54:21 [WebService::Dropbox] [ERROR]
https://api.dropboxapi.com/2/files/list_folder {"path":"/"} -> [400] Error in
call to API function "files/list_folder": request body: path: Specify the root
folder as an empty string rather than as "/". at
/usr/local/share/perl5/WebService/Dropbox.pm line 184.
I am new to dropbox api and have no idea of perl so could not figure out what is discusses on below links.
https://github.com/silexlabs/unifile/issues/77
The error message is correctly indicating that the Dropbox API expects the value "" when referring to the root alone. The code is instead sending the value "/". This looks like a bug in the code.
It looks like you've already opened an issue with the developer for this:
https://github.com/CpanelInc/backup-transport-dropbox/issues/3
They should update the code to use "" when referring to the root folder on Dropbox.

Failed to load launch URL with error: Error Domain=TVMLKitErrorDomain Code=3 "(null)"

Description:
I created a new TVML project and launched it. The first error was the App Transport Security, which I fixed via Info.plist :
App Transport Security Settings -> Allow Arbitrary Loads -> YES
Then I ran it again and I'm getting this error:
Failed to load launch URL with error: (null)
appController(_:didFailWithError:) invoked with error: Error
Domain=TVMLKitErrorDomain Code=3 "(null)"
The project seems to stop here (application func in AppDelegate.swift):
appControllerContext.launchOptions["BASEURL"] = AppDelegate.tvBaseURL
print(launchOptions) //returns nil
//error on following line
if let launchOptions = launchOptions as? [String: AnyObject] {
//does not enter here
for (kind, value) in launchOptions {
appControllerContext.launchOptions[kind] = value
}
}
What I've tried:
I attempted changing the tvBaseURL from "http://localhost:9001/" to http://MY-IP-ADDRESS-HERE:9001/
but that didn't change anything.
Question:
What is causing this error and how do I solve it?
You should start the server with port number
enter the following command in terminal
ruby -run -ehttpd . -p9001
And finally your tvBaseURL should navigate to the server folder like this
"http://yourLocalhost:9001/Downloads/TVMLCatalogUsingTVMLTemplates/Server/"
I also faced the same problem, I solved it by changing tvBaseURL in AppDelegate
static let tvBaseURL = "http://127.0.0.1:9001/Downloads/TVMLCatalogUsingTVMLTemplates/Server/"
As you see - I have to show exact path to Server folder. That also works if you put it to some web server.
Hope that it can help!
I just ran into this issue. You need to pay close attention to the terminal output.
I got:
[2019-03-15 12:28:43] INFO WEBrick 1.3.1
[2019-03-15 12:28:43] INFO ruby 2.3.7 (2018-03-28) [universal.x86_64-darwin17]
/System/Library/Frameworks/Ruby.framework/Versions/2.3/usr/lib/ruby/2.3.0/socket.rb:205:
in `bind': Address already in use - bind(2) for 0.0.0.0:9001 (Errno::EADDRINUSE)
Address already in use - bind(2) for 0.0.0.0:9001
At this point you either have to choose a different port number (if you decide to do such then make sure your server's port and your Xcode's project port match) or kill the previous server by ctrl + c or just killing that terminal window.
Also note in some of Apple's sample projects the ruby -run -ehttpd . -p9001 command is to be done in a folder named Server and for others it's just suppose to be done in the App's main folder. Just look into the README file to figure this out.