mirror of
https://github.com/python/cpython.git
synced 2025-08-31 05:58:33 +00:00
Closes #11620: Fix support for SND_MEMORY in winsound.PlaySound.
Based on a patch by Tim Lesher.
This commit is contained in:
parent
0e76e67246
commit
ae8298bfb7
5 changed files with 63 additions and 16 deletions
|
@ -87,6 +87,22 @@ class PlaySoundTest(unittest.TestCase):
|
|||
winsound.PlaySound,
|
||||
"none", winsound.SND_ASYNC | winsound.SND_MEMORY
|
||||
)
|
||||
self.assertRaises(TypeError, winsound.PlaySound, b"bad", 0)
|
||||
self.assertRaises(TypeError, winsound.PlaySound, "bad",
|
||||
winsound.SND_MEMORY)
|
||||
self.assertRaises(TypeError, winsound.PlaySound, 1, 0)
|
||||
|
||||
def test_snd_memory(self):
|
||||
with open(support.findfile('pluck-pcm8.wav',
|
||||
subdir='audiodata'), 'rb') as f:
|
||||
audio_data = f.read()
|
||||
safe_PlaySound(audio_data, winsound.SND_MEMORY)
|
||||
audio_data = bytearray(audio_data)
|
||||
safe_PlaySound(audio_data, winsound.SND_MEMORY)
|
||||
|
||||
def test_snd_filename(self):
|
||||
fn = support.findfile('pluck-pcm8.wav', subdir='audiodata')
|
||||
safe_PlaySound(fn, winsound.SND_FILENAME | winsound.SND_NODEFAULT)
|
||||
|
||||
def test_aliases(self):
|
||||
aliases = [
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue