     {
         let description = "Transcribe an audio file."
         let expectation = self.expectation(description: description)
+        var expectationFulfilled = false
         
         let bundle = Bundle(for: type(of: self))
         guard let file = bundle.url(forResource: filename, withExtension: withExtension) else {

    }
    
    func validateSTTSpeakerLabels(speakerLabels: [SpeakerLabel]) {
        for speakerLabel in speakerLabels {
            validateSTTSpeakerLabel(speakerLabel: speakerLabel)
        }

            settings.timestamps = true
            settings.filterProfanity = false
            settings.speakerLabels = true

            speechToText.recognize(audio: audio, settings: settings, model: "en-US_NarrowbandModel", learningOptOut: true, failure: failWithError) { results in
                if !expectationFulfilled && results.speakerLabels.count > 0 {
                    self.validateSTTSpeakerLabels(speakerLabels: results.speakerLabels)
                    expectationFulfilled = true
                    expectation.fulfill()
                }
            }
            waitForExpectations()
        } catch {
