mallorbc / whisper_mic

Project that allows one to use a microphone with OpenAI whisper.
MIT License
705 stars 158 forks source link

Provide a method to obtain the results of `listen_loop` #63

Closed antoniosarosi closed 8 months ago

antoniosarosi commented 8 months ago

Currently the listen_loop method simply prints the results to STDOUT. There is no way to access the string values. This PR moves the listening logic to listen_continuously, which yields the results one by one, and listen_loop can just call the new function. This is just a quick idea that came to my mind, there's probably a better way of doing it. But I need to read the values in my program to do stuff like terminating the process with a voice command, so I think this feature has its use cases.

mallorbc commented 8 months ago

Great work!