shmuel Posted March 17, 2013 Posted March 17, 2013 (edited) Hey all, I've created a text-to-speech workflow based on Mac OS's 'say' command. With it you type 'say' followed by 'what you want to say'. You are then given a list of installed voices to pick from. Select a voice with the arrows or simply hit enter to have your phrase spoken aloud. I've also included an additional novelty command 'sayslow' which will speak your phrase in your chosen voice at a veeerryy slow rate. I don't know why but I find this incredibly comical. https://github.com/shmuel/alfred-say/archive/master.zip - I made the script much more stable in the way it is handling escaping special characters. - The code is much more DRY. - It is now easier to extend with more voice styles (i.e. sayfast would be possible as well). -Samuel Edited March 18, 2013 by shmuel SaSaSushi 1
Cedric Posted March 17, 2013 Posted March 17, 2013 (edited) Never used the text-to-speech of my mac, but I believe it will be useful to make sure of the pronounciation of English words (I'm not a native speaker).Plus, there are fun voices to pick Thanks for that ! Edit : I noticed that it's necessary to use a simple quote (') to spell more than one word. Without quotes or with double quotes (") it doesn't work. Edit2 : would it be possible for the worflow to remember the last used voice, and put it in first choice? Edited March 17, 2013 by Cedric
shmuel Posted March 17, 2013 Author Posted March 17, 2013 Hey Cedric, I'm glad you found it useful (or at least entertaining). If you select the same voice a few times in a row it should rise to the top of the list. Over time Alfred will prioritize the list based on how frequently you use each voice. It should work fine without quotes (single or double). There is a known bug with apostrophes. If you type "didn't" (no quotes) it will do nothing. This is a problem with how I am escaping this string (or not escaping it). I'll try to figure out how to improve that and post it when I have it sorted.
shmuel Posted March 17, 2013 Author Posted March 17, 2013 OK Cedric, I've updated the workflow. It now works correctly with single quotes / apostrophes. It does not work with double quotes. In fact a double quote will still cause it to fail but I think that is preferable to the way it was perviously. Let me know if it works for you now. Cedric 1
Cedric Posted March 18, 2013 Posted March 18, 2013 Hi, When you mean double quote, you mean (") right ? Because, now the behaviour is the opposite as what it used to be. I used to have to enter 'hello world', else the voices wouldn't load (it would be stuck on keep loading).Now I have to enter "hello world", as the voices won't load with a single quote. If I try "I don't know", it will go fine until the ('), then i alfred will display the default search fallbacks instead of the voices. Is it the expected behaviour?
shmuel Posted March 18, 2013 Author Posted March 18, 2013 Cedric, Sorry for the confusion. If you can't tell I'm pretty new to this. Anyway, I think I fixed. Could you download it again and try once more? This time don't wrap the phrase in quotes or double quotes. It should work without being quoted. Cedric 1
shmuel Posted March 18, 2013 Author Posted March 18, 2013 Ok, I've improved it again. This wont change the function of the script much at all but it should be more stable and it's definitely prettier to look at (the code anyway). It's now stored on Github.
Jayson Cruz Posted September 26, 2015 Posted September 26, 2015 This is a good idea I tried it but im having a problem. When i type the first character of the query, it shows the fallback result (eg google searches). Here's what's in the log: Starting debug for 'Say Something' [ERROR: alfred.workflow.input.scriptfilter] Code 1: -e:4:in `split': invalid byte sequence in US-ASCII (ArgumentError) from -e:4:in `<main>' [ERROR: alfred.workflow.input.scriptfilter] Code 1: -e:4:in `split': invalid byte sequence in US-ASCII (ArgumentError) from -e:4:in `<main>' [ERROR: alfred.workflow.input.scriptfilter] Code 1: -e:4:in `split': invalid byte sequence in US-ASCII (ArgumentError) from -e:4:in `<main>' Please help. Eager to use your workflow - Jayson
Recommended Posts
Create an account or sign in to comment
You need to be a member in order to leave a comment
Create an account
Sign up for a new account in our community. It's easy!
Register a new accountSign in
Already have an account? Sign in here.
Sign In Now