plamoni / SiriProxy

A (tampering) proxy server for Apple's Siri
GNU General Public License v3.0
2.12k stars 343 forks source link

Siri doesn't speak, despite "Say: ..." appearing in log #553

Closed phpmycoder closed 11 years ago

phpmycoder commented 11 years ago

One of my listen_fors runs a script, which accesses and processes data from an API. Because of the size of the data, it takes approximately 1-1.5 seconds to return. Despite the fact that I say something before running the script and then say the results after (both of which appear in the siriproxy logs as being sent to my phone), Siri doesn't say anything and continues spinning until request_completed when it says the default "would you like me to search the web for ...".

listen_for /execute long task/i do
    say "Executing the long running task"  # this is never said
    response = %x(./long-task.sh) # takes ~1 sec to return
    say "Response is" + response # this isn't said either

    request_completed
end

Is there any way to force Siri to say the first statement and make her wait patiently until my second say and subsequent request_completed?

elvisimprsntr commented 11 years ago

I've found spawning a new thread works.

Example:

listen_for(/redeye initialize/i) do say "One moment while I initialize RedEye plugin..." Thread.new { init_redeyes update_resel say "SiriProxy RedEye plugin initialized." request_completed } end

phpmycoder commented 11 years ago

@elvisimprsntr Indeed. This fixes the issue! Thanks for your solution!