Meditation Analyzer is not reporting Data (Android)
I am trying to subscribe to the level and level progress values from the meditation analyzer, I have the Alpha, Beta, Delta, and Theta values reading correctly through the EegIndexChannel but when I try and create the Meditation Channel with the same EegIndexChannel the Meditation values do not return anything
I am using the following code to setup my Meditation Analyzer
fun startMeditationStream() {
if(currentDevice == null) return
if(_eegIndexChannel == null) {
startEEGStream()
}
_meditationAnalyzer = MeditationAnalyzer(_eegIndexChannel)
_meditationAnalyzer?.let { meditationAnalyzer ->
Timber.d("Starting Meditation Analyzer") // <-- Prints
meditationAnalyzer.levelChanged.subscribe { _, nParam ->
Timber.d("Meditation Level Changed: $nParam") // <-- Never Prints
_meditationLevel.postValue(nParam)
}
meditationAnalyzer.levelProgressChanged.subscribe { _, nParam ->
Timber.d("Meditation Progress: $nParam") // <-- Never Prints
_meditationProgress.postValue(nParam)
}
}?:run {
Toast.makeText(
context,
"Device is not connected, please connect to a brainbit device",
Toast.LENGTH_LONG
).show()
}
}
Thanks, Chris