candle icon indicating copy to clipboard operation
candle copied to clipboard

Whisper microphone example: do not repeatedly acquire and release the microphone

Open lavafroth opened this issue 1 year ago • 2 comments
trafficstars

Changes

  • The input stream from the microphone is built once in the thread that handles it.
  • Inside the loop block, the stream is played and paused for the defined duration (300ms) to capture the pcm data.
  • The iter::repeat(()).enumerate() to keep track of the inference iteration is replaced with a simple 0.. range.

lavafroth avatar Mar 18 '24 04:03 lavafroth

@lavafroth did you have any luck actually getting useful outputs after your change? I can see the reaquiring issue (almost) solved, some flickering on microphone access visible in xfce taskbar but in pulseaudio (pavucontrol) I can see that the recording device is not re acquired repeatingly .

I'm asking since the mic example does not work for others (see referenced issue) from @krzytofwos

chris-aeviator avatar Jul 23 '24 10:07 chris-aeviator

I have a pretty low end machine but yes it works better than the previous iteration. 😇

-------- Original Message -------- On 23/07/24 16:13, chris-aeviator wrote:

@.***(https://github.com/lavafroth) did you have any luck actually getting useful outputs after your change? I can see the reaquiring issue (almost) solved, some flickering on microphone access visible in xfce taskbar but in pulseaudio (pavucontrol) I can see that the recording device is not re acquired repeatingly .

I'm asking since the mic example does not work for others (see referenced issue) from @krzytofwos

— Reply to this email directly, view it on GitHub, or unsubscribe. You are receiving this because you were mentioned.Message ID: @.***>

lavafroth avatar Jul 23 '24 11:07 lavafroth