Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

How to give raw audio file to stream instead of microphone? #377

Open
SmartManoj opened this issue Jan 6, 2023 · 4 comments
Open

How to give raw audio file to stream instead of microphone? #377

SmartManoj opened this issue Jan 6, 2023 · 4 comments
Labels
question Further information is requested

Comments

@SmartManoj
Copy link

SmartManoj commented Jan 6, 2023

I am trying to live captioning a call.

@ggerganov ggerganov added the question Further information is requested label Jan 6, 2023
@ggerganov
Copy link
Owner

One way would be to make a loopback audio capture device on your system and select it via the -c argument of stream.
Another approach would be something like the twitch.sh stream tool.

@tomheno
Copy link

tomheno commented Jan 9, 2023

Hi, @ggerganov
In the case of twitch.sh, main is called numerous of time, meaning the model is loaded at each iteration, right ?

./main -t $threads -m ./models/ggml-$model.bin -f /tmp/whisper-live.wav --no-timestamps -otxt 2> /tmp/whispererr | tail -n 1

Would there be a way to avoid that, and keep it warm in the memory, as it's a continuous process ?
Thanks a lot for the job done on this library !

@ggerganov
Copy link
Owner

@tomheno
Maybe the idea from #182 (reply in thread) can be utilised for this:

  • start main and configure it to monitor a folder for new .wav files
  • when there is a new .wav file - transcribe it
  • start a separate process that reads twitch stream audio and chunks it into .wav files -- the files are written to the folder monitored by main

@pbengert
Copy link

pbengert commented Mar 5, 2023

Here is what you can do to use audio output instead of the microphone:
Get VB-Cable from https://vb-audio.com/Cable/
It will install a virtual audio cable. With that you can reroute sound from sound output to input. Choose VB Cable as your "speaker" and on the other side as your "microphone". That way you can use any sound output with stream. That works nice with e.g. YouTube.
When you start "stream" you can find the capture devices at the beginning of the init output. Mine looks like that:
init: - Capture device #2: 'VB-Cable'
So you append: -c 2to the command to use this a your sound source.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
question Further information is requested
Projects
None yet
Development

No branches or pull requests

4 participants