Tagged: Thread blocked
- This topic has 10 replies, 2 voices, and was last updated 10 years, 2 months ago by meVenkatarao.
-
AuthorPosts
-
February 16, 2014 at 2:31 pm #1020154meVenkataraoParticipant
both aren’t working at the same time on iPhone. I read multithreading is handled on openEars, but one is getting blocked.
February 16, 2014 at 4:56 pm #1020161Halle WinklerPolitepixHello,
Take a look at the sample app for an example of using them both together.
February 19, 2014 at 5:58 pm #1020222meVenkataraoParticipantHi,
Thanks! I looked at sample code. At a time I guess only one thread can access audio (please let me know correct thing on this). So I am doing text to voice (big one), & in parallel giving voce input; its not working. I was asking can we have those two operations in parallel.Thanks,
VenkatFebruary 19, 2014 at 6:15 pm #1020224Halle WinklerPolitepixI don’t think they should be blocking each other, but OpenEars suspends listening during TTS so that the TTS speech doesn’t become part of the recognized speech. This shouldn’t be the case when using headphones since the isolation of the mic and audio output from each other means there isn’t the same danger of confused recognition. Is that the issue you’re seeing? If not, I guess I’d need a more detailed clarification of exactly what is happening versus what you’re aiming for.
February 20, 2014 at 7:19 pm #1020231meVenkataraoParticipantQuestion from other thread: Then how can I check if its not blocking (taking) main thread? just to if text to voice & voice recognition could be run in parallel.
February 20, 2014 at 7:23 pm #1020235meVenkataraoParticipantRequirement: Text To Voice is in progress; user should be able to interrupt by voice while its reading (text to voice)
1. You said if I put earphones, it would work as required. Am I understanding it correct?
2. What about in normal state? Cant be put both operations in parallel?Thanks,
VenkatFebruary 20, 2014 at 7:28 pm #1020236Halle WinklerPolitepixIt shouldn’t be necessary to check this because they run in parallel. Can you take a look at my previous reply and describe in more depth what the symptom is that makes it seem like they are blocking each other? Speech recognition in OpenEars is 100% multithreaded and it doesn’t do anything on mainThread but start and send notifications. FliteController may do synthesis on mainThread but that only accounts for the moment of synthesis – all the playback is asynchronous. NeatSpeech doesn’t even do the synthesis on mainThread. So I’d need a bit more information about what the situation you are seeing is that seems like everything is blocking – is it the UI being frozen, and if so, under which circumstances, or is it one of the OpenEars elements not being responsive, and if so, which one and under which circumstances? Or is this because recognition suspends during speech for the reason I explained above?
February 20, 2014 at 7:38 pm #1020237Halle WinklerPolitepixOK, that isn’t really about threading so you don’t need a thread-based solution to that issue. Yes, you can interrupt TTS speech using speech recognition if you require the user to use headphones, or you can alter FliteController to not call the methods sendSuspendNotificationOnMainThread and sendResumeNotificationOnMainThread if you want to experiment with what happens when speech recognition doesn’t suspend while the user is using the main speaker.
February 21, 2014 at 11:44 am #1020272meVenkataraoParticipantThanks for the clarification. Yes! voice recognition is suspended while reading. I have seen that recogniser is picking up what is being read, could that be stopped & without earphones, can it be workable?
Thanks,
VenkatFebruary 21, 2014 at 11:56 am #1020274Halle WinklerPolitepixI don’t recommend doing it because you are always going to encounter the issue that live speech in the same shared audio environment in which you are doing recognition will be attempted to be processed by the recognition engine. You could try to control it using Rejecto, but even in that case you are going to get mixed results, just like if you were just doing speech recognition but two people were talking into it at the same time.
February 22, 2014 at 2:09 pm #1020293meVenkataraoParticipantOk! so not compliable to put both recognition & synthesis. Thanks halle, good responses. You could close the ticket.
Thanks,
Venkat -
AuthorPosts
- You must be logged in to reply to this topic.