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 current_volume = volume.GetMasterVolumeLevelScalar() if current_volume < 1.0: volume.SetMasterVolumeLevelScalar(1.0, None) print(f"Ses seviyesi %100'e ayarlandı: {current_volume} -> 1.0") def monitor_microphone_volume(): while True: set_microphone_volume_to_100() time.sleep(1) # Her 1 saniyede bir kontrol edin if __name__ == "__main__": monitor_microphone_volume()