SiriProxy icon indicating copy to clipboard operation
SiriProxy copied to clipboard

Grab Siri Output

Open ethernet8023 opened this issue 14 years ago • 35 comments

There seems to be no way to intercept the audio file that Siri recorded. If I'm wrong, please point me in the right direction.

ethernet8023 avatar Dec 27 '11 03:12 ethernet8023

It should theoretically be possible, since the decrypted audio packets do pass through your proxy.

terriblybored avatar Dec 28 '11 11:12 terriblybored

Good point. Do you know where in the source code it sends the audio files to guzzoni.apple.com and expects a response? I'm quite new to this, but I plan to make Siri use google's voice recognition instead.

ethernet8023 avatar Dec 28 '11 17:12 ethernet8023

The audio is definitely there. I'll be looking at grabbing some of it later. It should be encoded in speex. Maybe you could look at the original applidium files for audio. I think they built everything there.

On 29 Dec, 2011, at 1:46 AM, aerobit [email protected] wrote:

Do they pass thru as speex files or some other format? I can't quite find the part where the proxy forwards the audio.


Reply to this email directly or view it on GitHub: https://github.com/plamoni/SiriProxy/issues/209#issuecomment-3293149

terriblybored avatar Dec 29 '11 00:12 terriblybored

Are you still working on using google's voice recognition?

terriblybored avatar Dec 30 '11 03:12 terriblybored

Yes, yes I am. I'm actually still thinking my way around this, because I have no idea how to make this work.

ethernet8023 avatar Dec 30 '11 03:12 ethernet8023

I'm starting to work on it now too. Shouldn't be that hard. The packets are being sent, and are even recorded in log.

terriblybored avatar Dec 30 '11 03:12 terriblybored

Yeah, the only problem is that you'd have to rewrite Siri unless you used apple's logic as well. Unless the logic is client-side, which I doubt.

ethernet8023 avatar Dec 30 '11 03:12 ethernet8023

I don't think the logic is client side. I was more interested in the transcription though. I can't decode the speex packets I'm capturing though. I'm looking at https://github.com/applidium/Cracking-Siri/blob/master/speexDec.m too, but I can't read objective C.

terriblybored avatar Dec 30 '11 04:12 terriblybored

Well, as long as you have ffmpeg, you can just ffmpeg speex to flac, then go

require 'rest_client' require 'json' a = FLAC file here! r = RestClient.post 'https://www.google.com/speech-api/v1/recognize?lang=en-US', a, :content_type => 'audio/x-flac; rate=16000' if j = JSON.parse(r) result = {j['hypotheses'].first['utterance']} end

EDIT: This may be of interest to you... http://rubydoc.info/github/moumar/ruby-ogginfo/master/Ogg/Codecs/Speex

ethernet8023 avatar Dec 30 '11 22:12 ethernet8023

Have you managed to do so? I'm unable to actually do anything with my speex data. I've extracted them from the packets and concatenated them into a file. I believe it requires some processing before I feed it to a decoder, as all I get are messages that it is corrupt, and a bad output.

On 31 Dec, 2011, at 6:36 AM, aerobit [email protected] wrote:

Well, as long as you have ffmpeg, you can just ffmpeg speex to flac, then go

require 'rest_client' require 'json' a = FLAC file here! r = RestClient.post 'https://www.google.com/speech-api/v1/recognize?lang=en-US', a, :content_type => 'audio/x-flac; rate=16000' if j = JSON.parse(r) result = {j['hypotheses'].first['utterance']} end


Reply to this email directly or view it on GitHub: https://github.com/plamoni/SiriProxy/issues/209#issuecomment-3317893

terriblybored avatar Dec 30 '11 22:12 terriblybored

No, not yet. I'm actually learning ruby, just for this.... are you maintaining a fork of this project with google speech recognition?

ethernet8023 avatar Dec 30 '11 22:12 ethernet8023

No. Mine isn't for that. I'm learning ruby for this too. :)

On 31 Dec, 2011, at 6:48 AM, aerobit [email protected] wrote:

No, not yet. I'm actually learning ruby, just for this.... are you maintaining a fork of this project with google speech recognition?


Reply to this email directly or view it on GitHub: https://github.com/plamoni/SiriProxy/issues/209#issuecomment-3317982

terriblybored avatar Dec 30 '11 22:12 terriblybored

It's quite hard XD How are you capturing the packets?

ethernet8023 avatar Dec 30 '11 22:12 ethernet8023

Modify connection.rb. Is there another way to communicate where I can attach files?

terriblybored avatar Dec 30 '11 23:12 terriblybored

not as far as I know. What are the exact errors you're getting? Mind posting a sample intercepted speex file? I don't have a 4s so I can't test it :C

ethernet8023 avatar Dec 30 '11 23:12 ethernet8023

It's just a stream of packets concatenated together. I'm not getting a playable file after conversion. The official decoder tells me it's not a valid speex file too (probably because the headers are thrown out) Could we exchange emails privately? It'll be easier to send files. You could message me in my profile.

On 31 Dec, 2011, at 7:16 AM, aerobit [email protected] wrote:

not as far as I know. What are the exact errors you're getting? Mind posting a sample intercepted speex file? I don't have a 4s so I can't test it :C


Reply to this email directly or view it on GitHub: https://github.com/plamoni/SiriProxy/issues/209#issuecomment-3318198

terriblybored avatar Dec 30 '11 23:12 terriblybored

I would, but it says that you have not provided an email.

ethernet8023 avatar Dec 30 '11 23:12 ethernet8023

Okay. Threw it out there for a while.

On 31 Dec, 2011, at 7:21 AM, aerobit [email protected] wrote:

I would, but it says that you have not provided an email.


Reply to this email directly or view it on GitHub: https://github.com/plamoni/SiriProxy/issues/209#issuecomment-3318239

terriblybored avatar Dec 30 '11 23:12 terriblybored

anyone figured this out yet? I seem to be able to extract the speech packets using sampledec from crackingSiri but i don't seem to be able to play it back. According to the docs the audio parameters are:

Audio data flows in as speex_wideband by default. You can decompress using the speex library. Managed to uncompress using the following parameters :

  • framesize = 320
  • packet size = 139 (For some reason the audio packets in the plist are 695 bytes long, and 695 = 139*5, so they probably cram 5 speex packets in each plist)
  • sample rate is 16Khz

kelvl avatar Jan 08 '12 09:01 kelvl

I've gotten playback. You need to use speex libraries to decode, and then convert the raw result using sox (or any other tool of choice) to something playable in any standard player.

On 8 Jan, 2012, at 5:21 PM, kelvl [email protected] wrote:

anyone figured this out yet? I seem to be able to extract the speech packets using sampledec from crackingSiri but i don't seem to be able to play it back. According to the docs the audio parameters are:

Audio data flows in as speex_wideband by default. You can decompress using the speex library. Managed to uncompress using the following parameters :

  • framesize = 320
  • packet size = 139 (For some reason the audio packets in the plist are 695 bytes long, and 695 = 139*5, so they probably cram 5 speex packets in each plist)
  • sample rate is 16Khz

Reply to this email directly or view it on GitHub: https://github.com/plamoni/SiriProxy/issues/209#issuecomment-3401153

terriblybored avatar Jan 08 '12 10:01 terriblybored