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

Mic Sensitivity #255

Open
al-yakubovich opened this issue Aug 26, 2024 · 4 comments
Open

Mic Sensitivity #255

al-yakubovich opened this issue Aug 26, 2024 · 4 comments

Comments

@al-yakubovich
Copy link

al-yakubovich commented Aug 26, 2024

Speaker input works great, but mic input only works when I am very close to the microphone. Other software (Zoom, Teams, etc.) can capture microphone input perfectly. It looks like Transcribe reduces mic sensitivity with the default settings. How do I increase mic sensitivity?

Is ambient noise = mic sensitivity? When I run the app, it says:

[INFO] Adjusting for ambient noise from Default Mic. Please make some noise from the Default Mic...
[INFO] Completed ambient noise adjustment for Default Mic.

How do I adjust ambient noise manually?

@mang0sw33t
Copy link
Collaborator

Are you using the default Mic or are you using a different Mic.

Please provide output for python main.py -l
This will show the various audio devices present

@al-yakubovich
Copy link
Author

@mang0sw33t I am using default microphone (ATR2100x-USB Microphone).

Here is output:

(py311_v2) PS F:\Desktop\transcribe\app\transcribe> python main.py -l
[INFO] Using default microphone.
[INFO] Adjusting for ambient noise from Default Mic. Please make some noise from the Default Mic...
[INFO] Completed ambient noise adjustment for Default Mic.
[INFO] Using default speaker.
[INFO] Listening to sound from Speaker: #18 - Speakers (2- HP USB Media Audio) [Loopback]
D:\anaconda\envs\py311_v2\Lib\site-packages\whisper\__init__.py:146: FutureWarning: You are using `torch.load` with `weights_only=False` (the current default value), which uses the default pickle module implicitly. It is possible to construct malicious pickle data which will execute arbitrary code during unpickling (See https://github.com/pytorch/pytorch/blob/main/SECURITY.md#untrusted-models for more details). In a future release, the default value for `weights_only` will be flipped to `True`. This limits the functions that could be executed during unpickling. Arbitrary objects will no longer be allowed to be loaded via this mode unless they are explicitly allowlisted by the user via `torch.serialization.add_safe_globals`. We recommend you start setting `weights_only=True` for any use case where you don't have full control of the loaded file. Please open an issue on GitHub for any issues related to this experimental feature.
  checkpoint = torch.load(fp, map_location=device)
[INFO] Speech To Text - Whisper using GPU: False


List all audio drivers and devices on this machine

| ~ Audio Drivers on this machine ~ |

 ^ # INDEX # DRIVER TYPE #  DEVICE COUNT # NAME
-----------------------------------------------
 »   [0]   |      2      |       8       |  MME
 »   [1]   |      1      |       8       |  Windows DirectSound
 »   [2]   |      13     |       9       |  Windows WASAPI



| ~ Audio Devices on this machine ~ |

 ^ # INDEX # HOST API INDEX # LOOPBACK # NAME
---------------------------------------------
 »   [0]          0            False     Microsoft Sound Mapper - Input
 »   [1]          0            False     Microphone (2- ATR2100x-USB Mic
 »   [2]          0            False     Microphone (UC W20 Microphone)
 »   [3]          0            False     Набор микрофонов (Realtek High
 »   [4]          0            False     Microsoft Sound Mapper - Output
 »   [5]          0            False     Speakers (2- HP USB Media Audio
 »   [6]          0            False     Headphones (2- ATR2100x-USB Mic
 »   [7]          0            False     Speaker/Headphone (Realtek High
 »   [8]          1            False     Primary Sound Capture Driver
 »   [9]          1            False     Microphone (2- ATR2100x-USB Microphone)
 »   [10]         1            False     Microphone (UC W20 Microphone)
 »   [11]         1            False     Набор микрофонов (Realtek High Definition Audio)
 »   [12]         1            False     Primary Sound Driver
 »   [13]         1            False     Speakers (2- HP USB Media Audio)
 »   [14]         1            False     Headphones (2- ATR2100x-USB Microphone)
 »   [15]         1            False     Speaker/Headphone (Realtek High Definition Audio)
 »   [16]         2            False     Headphones (2- ATR2100x-USB Microphone)
 »   [17]         2            False     Speaker/Headphone (Realtek High Definition Audio)
 »   [18]         2            False     Speakers (2- HP USB Media Audio)
 »   [19]         2            False     Microphone (UC W20 Microphone)
 »   [20]         2            False     Microphone (2- ATR2100x-USB Microphone)
 »   [21]         2            False     Набор микрофонов (Realtek High Definition Audio)
 »   [22]         2             True     Headphones (2- ATR2100x-USB Microphone) [Loopback]
 »   [23]         2             True     Speaker/Headphone (Realtek High Definition Audio) [Loopback]
 »   [24]         2             True     Speakers (2- HP USB Media Audio) [Loopback]

@al-yakubovich
Copy link
Author

What helped me to increase mic sensitivity:
set up self.dynamic_energy_threshold = False in __init__.py and ENERGY_THRESHOLD = 300 in sdk\audio_recorder.py

@mang0sw33t
Copy link
Collaborator

Great that it helped in your use case. We would very much appreciate a PR with changes that helped in your use case.

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

No branches or pull requests

2 participants