     
     public func startListening()
     {
-        let NUM_BUFFERS = 2
-        let BUFFER_SIZE:UInt32 = 4096
-    
+        
         var queue = AudioQueueRef()
-        var buffers:[AudioQueueBufferRef] = [AudioQueueBufferRef(),
+        let buffers:[AudioQueueBufferRef] = [AudioQueueBufferRef(),
             AudioQueueBufferRef(),
             AudioQueueBufferRef()]
         
-        var format = AudioStreamBasicDescription(
+        let format = AudioStreamBasicDescription(
             mSampleRate: 16000,
             mFormatID: kAudioFormatLinearPCM,
             mFormatFlags: kLinearPCMFormatFlagIsSignedInteger | kLinearPCMFormatFlagIsPacked,

            mBitsPerChannel: 8 * 2,
            mReserved: 0)
        
        AudioQueueNewInput(&format, recordCallback, nil,
            CFRunLoopGetCurrent(), kCFRunLoopCommonModes, 0, &queue)

        for index in 0...NUM_BUFFERS {
            AudioQueueAllocateBuffer(queue, BUFFER_SIZE, &buffers[index])
            //&buffers[index].maAudioDataByteSize = BUFFER_SIZE
            recordCallback(nil, queue, buffers[index], nil, 0, nil )
        }
        
        AudioQueueStart(queue, nil)
        CFRunLoopRun()
        
    }
    
    var recordCallback : AudioQueueInputCallback =
    {
         inUserData, inAQ, inBuffer, inStartTime, inNumberPacketDescriptions, inPacketDescs in
        
    
        print("inside of callback")
    }
    
    /**

    var callback: ((SpeechToTextResponse?, NSError?) -> Void)?
    
    
    struct AudioRecorderState {
        var dataFormat: AudioStreamBasicDescription
        var queue: AudioQueueRef
        var buffers: [AudioQueueBufferRef]
        var bufferByteSize: UInt32
        var currentPacket: Int64
        var isRunning: Bool
    }
    
    let NUM_BUFFERS = 2
    let BUFFER_SIZE:UInt32 = 4096

    
    init() {
        
