Sharrnah / whispering-ui

Native UI for the Whispering Tiger project - https://github.com/Sharrnah/whispering (live transcription / translation)
https://whispering-tiger.github.io/
MIT License
232 stars 12 forks source link

Error using WASAPI-Loopback #19

Closed OptimisticGeek closed 4 months ago

OptimisticGeek commented 7 months ago

Hello,Sharrnah

The program reported an error after setting the Loopback. . I can't solve this problem by myself, so I have to come here to trouble you.

This is my configuration image,Note that Audio Input(mic) uses a Loopback. image

An error occurred when tiger started loading image

This is the complete error log image image

Your Chinese friend,OptimisticGeek

Sharrnah commented 7 months ago

Looking at your headset, my guess is that it has issues with 7.1 surround sound.

It can't handle so many channels. Since i don't have 7.1 surround sound, its difficult for me to test. Can you try it with regular stereo sound? That should definetly work.

OptimisticGeek commented 7 months ago

I found out through your code that my headphones are mono induced. image

Yes, my headphones have 7.1 surround sound. I'm trying to figure out how to set up the driver for this headset. I'll give you the answer later.

OptimisticGeek commented 7 months ago

In my tests, 7.1 surround sound will report an error whether it is turned on or off.Because my headphones only support one channel,It does not support dual channels!

Sharrnah commented 7 months ago

one channel should also work.

Thats what it uses as fallback in the code you mentioned.

I think you confuse the microphone (which is mostly 1 channel) and your loudspeaker in the headset (in your case probably 8 channels [7+1])

Another way that you can try is using Voicemeeter https://vb-audio.com/Voicemeeter/

with that, you can route your PC audio to a VAIO Input which again can route to your Headset. When you now use the Loopback device of the VAIO Input, i think it could work. Though i never tested it with surround sound.

I will see if i can find a sultion with more than 2 channels of audio. So i will keep this issue open.

OptimisticGeek commented 7 months ago

I think you confuse the microphone (which is mostly 1 channel) and your loudspeaker in the headset (in your case probably 8 channels [7+1])

I do not understand the difference between single channel and dual channel, but through the online information to look up the following picture, the problem seems to be due to the limitations of my headset hardware.

Note the Input setttings -> format option,I'm guessing the 1 and 2 in your code are based on that. image

Screenshot information link image

Another way that you can try is using Voicemeeter https://vb-audio.com/Voicemeeter/

Yes, I have achieved real-time translation of in-game sounds in this way. And by opening a new process to achieve the voice translation function, thank you very much.

I will see if i can find a sultion with more than 2 channels of audio. So i will keep this issue open.

Okay, I won't close this comment myself anymore.

OptimisticGeek commented 7 months ago

Note that my headset is a USB device with microphone and speaker in one, not two 3.5mm plugs (speaker plug, microphone plug)

Sharrnah commented 7 months ago

Note the Input setttings -> format option,I'm guessing the 1 and 2 in your code are based on that.

Yes. But in your screenshot you edit your microphone. Since you want to use [Loopback] it would actually be the loudspeakers (Output) device.

(Loopback is a feature of WASAPI that allows recording of outgoing audio, so everything that is played to the loudspeakers)

Though it is possible that Windows does not allow changing the channels for output devices. (At least i don't see any option for that, but i only have 2 to begin with.)

OptimisticGeek commented 7 months ago

Through the use of Voicemeeter, I understood some principles of WASAPI. Sharrnah, thank you for your answer!

Sharrnah commented 7 months ago

Should be fixed in the next release version: https://github.com/Sharrnah/whispering/pull/24

I haven't really tested it with more than 2 channels since i don't have anything with more than 2. But i am relatively confident it (should) work. 😬

I will keep this issue open until the next version release.

OptimisticGeek commented 7 months ago

Ok, this is great, I will test this issue after the new version is released! 04538544

Sharrnah commented 4 months ago

I just released the new Update.

I will close this. Let me know if it works with the new update.