Voice over Internet Protocol (VoIP) is an important service with strict quality-of-service (QoS) requirements in wireless local area networks (WLANs). The popular distributed coordination function (DCF) of IEEE 802.11 medium access control (MAC) protocol adopts a binary exponential back-off (BEB) procedure to reduce the packet collision probability in WLANs. In DCF, the size of contention window is doubled upon a collision regardless of the network loads. This paper presents an adaptive MAC scheme to improve the QoS of VoIP in WLANs. This scheme applies a threshold of the collision rate to switch between two different functions for increasing the size of contention window based on the status of network loads. The performance of this scheme is investigated and compared to the original DCF using the network simulator NS-2. The performance results reveal that the adaptive scheme is able to achieve the higher throughput and medium utilization as well as lower access delay and packet loss probability than the original DCF.