SSML code in Curl text to speech IBM Watson - text-to-speech

I am trying to use IBM Watson Text to Speech because I need to get some audio file to insert in a video but I am not a developer, at all! Looking a the scarce tutorial provided on IBM cloud website, I figured out how to get the audio file using curl. But I cannot find a way to use the SSML possibilities to modify the voice. I don't understand where we have to specify the tags in the code. Here is the code I use, it works to produce the audio file. Where should I insert the tags to customize the voice?... Any help would be more than welcome! Many thanks in advance
curl -X POST -u "credential OK":"credential ok" \
--header "Content-Type: application/json" \
--header "Accept: audio/mp3" \
--data '{"text": "The visceral leishmaniasis, also known as kala-azar is characterized by irregular bouts of fever, substantial weight loss, swelling of the spleen and liver, and anaemia. Visceral leishmaniasis is fatal in over 95% of cases if left untreated."}' \
--output Essai.mp3 \
"https://stream.watsonplatform.net/text-to-speech/api/v1/synthesize?voice=en-US_AllisonVoice"\

You put the SSML tags round the text that it need to be applied to
eg. for your example
--data '{"text": "<express-as type='GoodNews'> The visceral leishmaniasis, also known as kala-azar </express-as> is characterized by irregular bouts of fever, substantial weight loss, swelling of the spleen and liver, and anaemia. Visceral leishmaniasis is fatal in over 95% of cases if left untreated."}'

I know this answer is late in coming but it might help someone else with the same problem.
--data "{\"text\": \"<voice-transformation type='Custom' breathiness='35%' pitch='-80%' pitch_range='60%' glottal_tension='-40%' ><p><s>The visceral leishmaniasis, <break strength='500ms'></break>also known as kala-azar, <break strength='500ms'></break> <express-as type='Uncertainty'>is characterized by irregular bouts of fever, substantial weight loss, swelling of the spleen and liver, and anaemia.</express-as></s> <s>Visceral leishmaniasis is fatal in over 95% of cases if left untreated.</s></p></voice-transformation>\"}" \
I believe the reason that the example provided by chughts did not work, may be because of improper escaping of quotes in the JASON object. *Also please note that the the express-as element only works with the en-US_AllisonVoice.
Personally I can't tell the difference in the voice using any of the express-as element type options. FWIW, I much prefer the en-US_LisaV3Voice, but you can't use voice-transformations with the V3 voices.

Related

REST query to get all roles for particular user from parse server

How to create a REST query to get all roles assigned to a user?
As this is many to many relation in the opposite direction the regular $relatedTo operator seems to be not enough...
finally I found the solution which seems to be much easier than I was afraid of :) As I found similar questions on SO and github I hope it will help others.
the curl query to get all the roles directly assigned to a user is:
curl -X GET \
-H "X-Parse-Application-Id: ${APPLICATION_ID}" \
-H "X-Parse-REST-API-Key: ${REST_API_KEY}" \
https://parseapi.back4app.com/roles \
--data-urlencode \
'where={"users":{"__type":"Pointer","className":"_User","objectId":"<objectId>"}}'

splunk rest api search using R

I am trying to replicate the curl method mentioned in splunk rest api doc into R to perform search using R. Sorry, I won't be able provides details on the parameters to replicate. Hence attaching the link for reference.
curl -u admin:changeme -k https://localhost:8089/services/search/jobs -d search="search *"
This returns me a sid from curl. However when I try to replicate the same in R using httr it returns list of all search details. I have tried using both POST & GET in httr just in case. Below is sample code. Ideally below one should return me a sid. however it returns list of existing search details. Not sure what I am missing. I am new to Rcurl,httr. I tried curlperform as well, there also same. Seems, something is missing out. What exactly -d does in curl, is this the thing I am missing to replicate ?
response <- GET(splunk_server,path=search_job_export_endpoint,
config(ssl_verifyhost=FALSE, ssl_verifypeer=0),
authenticate(username, password),
query=list(search=urlencode(search_terms)),
verbose())
result <- read.table(text=content(response, as="text"), sep=",", header=TRUE,
stringsAsFactors=FALSE)

How can I get the disk IO trace with actual input values?

I want to generate some trace file from disk IO, but the problem is I need the actual input data along with timestamp, logical address and access block size, etc.
I've been trying to solve the problem by using the "blktrace | blkparse" with "iozone" on the ubuntu VirtualBox environment, but it seems not working.
There is an option in blkparse for setting the output format to show the packet data, -f "%P", but it dose not print anything.
below is the command that i use:
$> sudo blktrace -a issue -d /dev/sda -o - | blkparse -i - -o ./temp/blktrace.sda.iozone -f "%-12C\t\t%p\t%d\t%S:%n:%N\t\t%P\n"
$> iozone -w -e -s 16M -f ./mnt/iozone.dummy -i 0
In the printing format "%-12C\t\t%p\t%d\t%S:%n:%N\t\t%P\n", all other things are printed well, but the "%P" is not printed at all.
Is there anyone who knows why the packet data is not displayed?
OR anyone who knows other way to get the disk IO packet data with actual input value?
As far as I know blktrace does not capture the actual data. It just capture the metadata. One way to capture real data is to write your own kernel module. Some students at FIU.edu did that in this paper:
"I/O deduplication: Utilizing content similarity to ..."
I would ask this question in linux-btrace mailing list as well:
http://vger.kernel.org/majordomo-info.html

Parse geo-queries always empty

Im currently trying to get Parse's geo-query system to work. On my data browser, I have an installation with a key "location" of type geo-point that has a geo-point with latitude 30.27263636013176 and longitude -97.75766807716373 set in it.
However, if I try to query with the following code, I always get "results":[].
curl -X GET \
-H "X-Parse-Application-Id: myAppKey" \
-H "X-Parse-REST-API-Key: myAPIKey" \
-G \ --data-urlencode 'limit=10' \
--data-urlencode 'where={
"location": {
"$nearSphere": {
"__type": "GeoPoint",
"latitude": 30,
"longitude": -97
}
}
}' \
https://api.parse.com/1/classes/PlaceObject
Note that the query is running successfully; there are no errors. The problem is the installation I have should come up.
If I change the latitude and longitude in the query to exactly the latitude and longitude shown in the data browser, I still get empty results. What is the reason for this? Is it not possible to query for device installations near a point?
The Installation class can't be queried from the client, for good reason. Too much sensitive information is stored in the Installation class to allow querying from a client.
Either move the location property to another class you can query, or query it in a Cloud Function.
You can query it in Cloud Code if you use Parse.Cloud.useMasterKey();, though I strongly recommend using a different class to store the location.
Should the url be https://api.parse.com/1/classes/Installation instead of https://api.parse.com/1/classes/PlaceObject ?

split video (avi/h264) on keyframe

Hallo.
I have a big video file. ffmpeg, tcprobe and other tool say, it is an h264-stream in an AVI-container.
Now i'd like to cut out small chunks form the video.
Problem: The index of the video seam corrupted/destroyed. I kind of fixed this via mplayer -forceidx -saveidx <IndexFile> <BigVideoFile>. The Problem here is, that I'm now stuck with mplayer/mencoder which can use this index file via -loadidx <IndexFile>. I have tried correcting the index like described in man aviindex (mplayer -frames 0 -saveidx mpidx broken.avi ; aviindex -i mpidx -o tcindex ; avimerge -x tcindex -i broken.avi -o fixed.avi), but this didn't fix my video - meaning that most tools i've tested couldn't search in the video file.
Problem: I cut out parts of the video via following command: mencoder -loadidx in.idx -ss 8578 -endpos 20 -oac faac -ovc x264 -sws 9 -lavfopts format=mp4 -x264encopts <LotsOfOpts> -of lavf -vf scale=800:-10,harddup in.avi -o out.mp4. Now here the problem is, that some videos are corrupted at the beginning. I think this is because the fact, that i do not necessarily cut at keyframe.
Questions:
What is the best way to fix the index of an avi "inline" so that every tool can again work as expected with it?
How can i split at the keyframes? Is there an mencoder-option for this?
Are Keyframes coming in a frequency? How to find out this frequency? (So with a bit of math it should be possible to calculate the next keyframe and cut there)
Is ther perhaps some completely other way to split this movie? Doing it by hand is no option, i've to cut out 1000+ chunks ...
Thanks a lot!
https://spreadsheets.google.com/ccc?key=0AjWmZ0umsuZHdHNzZVhuMTkxTHdYbUdCQzF3cE51Snc&hl=en lists the various options available for splitting accurately.
I would attempt to use avidemux to repair the file before doing anything. You may also have better results using an MP4 Based Container than AVI.
As for ensuring your specified intervals are right at the keyframe, I would suggest encoding with FFMPEG with the: -g 1 option before using the split below to ensure every frame is in fact a keyframe. FFMPEG refers to keyframs as GOP or Groups of Pictures instead.
ffmpeg -i input.avi -g 1 -vcodec copy -acodec copy out.avi
Then multiple splits (with FFMPEG) :
ffmpeg -i input.avi -ss 00:00:10 -t 00:00:30 out1.avi -ss 00:00:35 -t 00:00:30 out2.avi
Some more options to try:
x264 Mapping FFMPEG encoding in linux