Open ianb821 opened 12 years ago
@ianb821: you need to say "Spotify" before anything. The problem is that this does very similar things to the built-in Siri functionality.
Also: "Spotify" isn't a real word, so Siri often interprets it very differently. It may take a few attempts to get one of the known permutations...
Thanks for your response. I did notice that Siri has a really difficult time understanding the word "spotify" and I noticed all of the alternatives that you offered in your code as well. After trying multiple options with the same response, I tried changing spotify to the name "Charles" just for kicks, and it still didn't work even when she showed the exacted wording that she was listening for from the code. I'll keep trying, but any additional suggestions would be great!
On Nov 30, 2011, at 4:18 AM, Simon Maddoxreply@reply.github.com wrote:
@ianb821: you need to say "Spotify" before anything. The problem is that this does very similar things to the built-in Siri functionality.
Also: "Spotify" isn't a real word, so Siri often interprets it very differently. It may take a few attempts to get one of the known permutations...
Reply to this email directly or view it on GitHub: https://github.com/simonmaddox/SiriProxy-Spotify/issues/1#issuecomment-2958129
@ianb821: Interesting. What's the exact phrase you're using?
@simonmaddox: I originally was using the "Spotify play the next track/song" command. It wouldn't recognize "Spotify" so I used "Spot a fight" because it would recognize that consistently. I then replaced all of the options of "Spotify" with "Charles" in that command, and Siri would recognize "Charles play the next track/song" but that's when I would get that error I mentioned. I haven't tried any other random keywords at the beginning, so I may do that when I get a few minutes and see if I can get a response.
@simonmaddox: Okay, so I've done a little playing around. First, I cloned the whole plugin again and replaced the old one with no success. This time, I used "Specify", but it still interacted with my Music application. I know all of the custom commands that I have set up in the original siriproxy-example file were working fine, so I copied just this part of your SiriProxy-Spotify.rb file into the siriproxy-example.rb:
def commandSpotify(command)
return (osascript -e 'tell application "Spotify"\n#{command}\nend'
).strip
end
def detailedNowPlayingCommand() return "set nowPlaying to current track\nreturn \"\" & name of nowPlaying & \" by \" & artist of nowPlaying" end
listen_for /(spotify|spotter five|spot of phi|spot fie|spot a fight|specify|spot if i|spotted by|stultify) play the next (track|song)/i do
response = commandSpotify("next track\n#{detailedNowPlayingCommand()}")
say "Ok, playing #{response}"
request_completed
end
With no luck, but when I changed what Siri was listening for to:
listen_for /Charles next please/i do response = commandSpotify("next track\n#{detailedNowPlayingCommand()}") say "Ok, playing #{response}"
request_completed
end
It worked like a charm. So I'm not sure what exactly isn't happening between the plugin files that I have, because I tried the same thing in the SiriProxy-Spotify.rb file, with no luck. I'm just copying the commands into the other file and editing what Siri listens for.
I cloned your files to my Macbook Pro, and I have the SiriProxy up and running perfectly. I have already set up some custom responses from Siri and they have all worked. I tried running this with Spotify, but I always get an error saying:
"Sorry, I can't do that. You're not listening to the Music Application."
Any ideas on what could be causing this error? Thanks for any help.