@@ -0,0 +1,1823 @@
+#!/usr/bin/env python3%0Afrom Tkinter import *%0Afrom threading import Timer%0Aimport time%0Aimport pyaudio, wave, sys%0Aimport requests%0Aimport speech_recognition as sr%0A%0Ar =  sr.Recognizer()%0A%0Achunk =  1024%0AFORMAT = pyaudio.paInt16%0ACHANNELS = 1%0ARATE = 44100%0ARECORD_SECONDS = 8%0AWAVE_OUTPUT_FILENAME = 'audio.wav'%0AAPI_URL = 'http://open-caption-dank.mybluemix.net/'%0A%0Ap = pyaudio.PyAudio()%0Achannel_map = (0, 1)%0A%0Astream_info = pyaudio.PaMacCoreStreamInfo(%0A    flags = pyaudio.PaMacCoreStreamInfo.paMacCorePlayNice,%0A    channel_map = channel_map)%0A%0Awhile True:%0A    stream = p.open(format = FORMAT,%0A                    rate = RATE,%0A                    input = True,%0A                    input_host_api_specific_stream_info = stream_info,%0A                    channels = CHANNELS)%0A%0A    all = %5B%5D%0A    for i in range(0, RATE / chunk * RECORD_SECONDS):%0A            data = stream.read(chunk)%0A            all.append(data)%0A    stream.close()%0A    p.terminate()%0A%0A    data = ''.join(all)%0A    wf = wave.open(WAVE_OUTPUT_FILENAME, 'wb')%0A    wf.setnchannels(CHANNELS)%0A    wf.setsampwidth(p.get_sample_size(FORMAT))%0A    wf.setframerate(RATE)%0A    wf.writeframes(data)%0A    wf.close()%0A%0A    root = Tk()%0A    root.wm_title(%22openCaption%22)%0A    root.geometry('2800x100')%0A    root.attributes(%22-topmost%22, True)%0A%0A    var = StringVar()%0A    label = Label( root, textvariable=var, relief=RAISED)%0A%0A%0A    with sr.WavFile(%22audio.wav%22) as source:%0A        audio = r.record(source)%0A%0A    try:%0A        list = r.recognize(audio,True)%0A        print(%22Possible transcriptions%22)%0A        for prediction in list:%0A            print(%22 %22 + prediction%5B%22text%22%5D + %22 (%22 + str(prediction%5B%22confidence%22%5D*100) + %22%25)%22)%0A            var.set(prediction%5B%22text%22%5D)%0A    except LookupError:%0A        print(%22Could not understand audio%22)%0A%0A    label.pack()%0A    root.mainloop()%0A    threading.Timer(0.1, f).start()%0A

Add Python/Mac Desktop Application