def play(wav, device_id=None):
'''Plays a wave file using a playback device.
The function will block until playback is complete.
wav:
An open `wave.Wave_read` object, a `bytes` object containing
a wave file, or a valid argument to `wave.open`.
device_id:
The device to play over. Defaults to the first available.
'''
if device_id is None:
device_id = get_playback_devices()[0][1]
with _open_wav(wav) as w:
return _play(device_id, w)
评论列表
文章目录