import time from ctypes import cast, POINTER from comtypes import CLSCTX_ALL from pycaw.pycaw import AudioUtilities, IAudioEndpointVolume def set_microphone_volume_to_100(): devices = AudioUtilities.GetSpeakers() interface = devices.Activate(IAudioEndpointVolume._iid_, CLSCTX_ALL, None) volume = cast(interface, POINTER(IAudioEndpointVolume)) # Ses seviyesini %100'e ayarlayın volume.SetMasterVolumeLevelScalar(1.0, None) def monitor_microphone_volume(): while True: set_microphone_volume_to_100() time.sleep(5) # Her 5 saniyede bir kontrol edin if __name__ == "__main__": monitor_microphone_volume()