Hi, i have some problem in swift. I can make rapidears work but when i use setReturnSegments(true) the rapidEarsDidDetectLiveSpeechAsWordArray never called. this is how i set it in swift
var rapidEventsObserver = OEEventsObserver()
….
func loadOpenEars() {
rapidEventsObserver = OEEventsObserver()
self.rapidEventsObserver.delegate = self
…..
}
func startListening() {
do {
try OEPocketsphinxController.sharedInstance().setReturnSegments(true)
try OEPocketsphinxController.sharedInstance().setReturnSegmentTimes(true)
try OEPocketsphinxController.sharedInstance().returnNbest = false
try OEPocketsphinxController.sharedInstance().setRapidEarsReturnNBest(false)
try OEPocketsphinxController.sharedInstance().setActive(true)
try OEPocketsphinxController.sharedInstance().setFinalizeHypothesis(false)
}
catch {
}
OEPocketsphinxController.sharedInstance().startRealtimeListeningWithLanguageModelAtPath(lmPath, dictionaryAtPath: dicPath, acousticModelAtPath: OEAcousticModel.pathToModel(“AcousticModelEnglish”))
}
func rapidEarsDidDetectLiveSpeechAsWordArray(words: [AnyObject]!, andScoreArray scores: [AnyObject]!) {
print(“delegate accessed”)
}
func rapidEarsDidDetectFinishedSpeechAsWordArray(words: [AnyObject]!, andScoreArray scores: [AnyObject]!) {
print(“delegate accessed”)
}
/**The engine has detected in-progress speech. Words and respective scores and timing are delivered in separate arrays with corresponding indexes.*/
func rapidEarsDidDetectLiveSpeechAsWordArray(words: [AnyObject]!, scoreArray scores: [AnyObject]!, startTimeArray startTimes: [AnyObject]!, endTimeArray endTimes: [AnyObject]!) {
print(“delegate accessed”)
}
but none of them being called by rapidears. have I missed something ?
Thank you Halle