         speechQueue.removeAll()
         recentSpeechTexts.removeAll()
         activeSpeech = nil
+        trashQueue.removeAll()
         log.debug("stopped speech manager.")
     }
 

    func refreshSpeechQueueIfNeeded() {
        let tooManySpeechesInQueue = speechQueue.count > maxSpeechCountForRefresh
        guard tooManySpeechesInQueue else { return }
        speechQueue.removeAll()
        appendToSpeechQueue(text: speechTextRefresh)
    }

    func preloadAudioIfAvailable() {
        let allAudioLoaders = allSpeeches.map { $0.audioLoader }
        let firstLoading = allAudioLoaders.filter({ $0.state == .loading }).first
        if let firstLoading = firstLoading {
            logPreloadStatus("Audio load is in progress for \(firstLoading.text).")
            return
        }
        guard let firstNotLoaded = allAudioLoaders.filter({ $0.state == .notLoaded }).first else {
            logPreloadStatus("Seems no audio needs to request load.")
            return
        }
        logPreloadStatus("Requesting load for \(firstNotLoaded.text)")
        firstNotLoaded.startLoad(
            speedScale: voiceSpeed.asVoicevoxSpeedScale,
            volumeScale: voiceVolume.asVoicevoxVolumeScale,
            speaker: voiceSpeaker)
    }

    func adjustedVoiceSpeed(currentCommentLength current: Int, remainingCommentLength remaining: Int, currentVoiceSpeed: Float) -> Float {

    var asAVSpeechSynthesizerVolume: Float { Float(self) / 100.0 }
}

private extension Array where Element == SpeechManager.Speech {
    func firstAudioLoader(state: AudioLoader.LoadState) -> AudioLoader? {
        return map { $0.audioLoader }.filter { $0.state == state }.first
    }
}

private extension SpeechManager {
    func logAudioQueue() {
        let message = "speechQueueCount: \(speechQueue.count), speed: \(voiceSpeed)"
