package top.yeij.cyrene.voice.hotword

import kotlinx.coroutines.flow.MutableStateFlow
import kotlinx.coroutines.flow.asStateFlow

class HotwordDetector {

    private val _isListening = MutableStateFlow(false)
    val isListening = _isListening.asStateFlow()

    private val _onDetected = MutableStateFlow(false)
    val onDetected = _onDetected.asStateFlow()

    fun startListening(wakeWord: String) {
        _isListening.value = true
        // Integrate system AlwaysOnHotwordDetector or Porcupine SDK here
    }

    fun stopListening() {
        _isListening.value = false
    }

    fun updateWakeWord(newWord: String) {
        stopListening()
        startListening(newWord)
    }
}
