         // add to transcription queue
     }
 }
+
+

    }
    
    /**
     Establishes a Websocket connection if one does not exist already.
     */
    private func connectWebsocket() {
        
        // check to see if a connection has been established.
        if let socket = socket {
            
            if socket.isConnected {
                return
            }
        }
        
        if let token = token {
                
            //let authURL = "\(self.url)?watson-token=\(token)"
            let authURL = self.url
            self.socket = WebSocket(url: NSURL(string: authURL)!)
            
            if let socket = self.socket {
                    
                socket.delegate = self
                    
                socket.headers["X-Watson-Authorization-Token"] = token
                    
                socket.connect()
                    
            } else {
                Log.sharedLogger.error("Socket could not be created")
            }
            
        }
    }

}

// MARK: - <#WebSocketDelegate#>
extension WatsonSocket : WebSocketDelegate {

}

/// Holds upload information
internal class AudioUploadOperation : NSOperation {
    
    private let data: NSData!
    private let watsonSocket: WatsonSocket!
    
    internal init(data: NSData, watsonSocket: WatsonSocket){
        
        self.data = data
        self.watsonSocket = watsonSocket
        
    }
    
    internal override func main() {
        
        if self.cancelled {
            return
