用法:
winsound.SND_ALIAS
sound
參數是來自注冊表的聲音關聯名稱。如果注冊表不包含此類名稱,則播放係統默認聲音,除非還指定了SND_NODEFAULT
。如果沒有注冊默認聲音,請提高RuntimeError
。不要與SND_FILENAME
一起使用。所有 Win32 係統至少支持以下內容;大多數係統支持更多:
PlaySound()
name
對應的控製麵板聲音名稱
'SystemAsterisk'
Asterisk
'SystemExclamation'
Exclamation
'SystemExit'
退出窗口
'SystemHand'
關鍵停止
'SystemQuestion'
Question
例如:
import winsound # Play Windows exit sound. winsound.PlaySound("SystemExit", winsound.SND_ALIAS) # Probably play Windows default sound, if any is registered (because # "*" probably isn't the registered name of any sound). winsound.PlaySound("*", winsound.SND_ALIAS)
相關用法
- Python wsgiref.simple_server.make_server用法及代碼示例
- Python wsgiref.util.FileWrapper用法及代碼示例
- Python wsgiref.util.setup_testing_defaults用法及代碼示例
- Python OpenCV waitKeyEx()用法及代碼示例
- Python weakref.WeakMethod用法及代碼示例
- Python wsgiref.validate.validator用法及代碼示例
- Python OpenCV waitKey()用法及代碼示例
- Python cudf.core.column.string.StringMethods.is_vowel用法及代碼示例
- Python torch.distributed.rpc.rpc_async用法及代碼示例
- Python torch.nn.InstanceNorm3d用法及代碼示例
- Python sklearn.cluster.MiniBatchKMeans用法及代碼示例
- Python pandas.arrays.IntervalArray.is_empty用法及代碼示例
- Python tf.compat.v1.distributions.Multinomial.stddev用法及代碼示例
- Python numpy.less()用法及代碼示例
- Python tf.compat.v1.distribute.MirroredStrategy.experimental_distribute_dataset用法及代碼示例
- Python Sympy Permutation.list()用法及代碼示例
- Python dask.dataframe.Series.apply用法及代碼示例
- Python networkx.algorithms.shortest_paths.weighted.all_pairs_dijkstra_path用法及代碼示例
- Python scipy.ndimage.binary_opening用法及代碼示例
- Python pyspark.pandas.Series.dropna用法及代碼示例
注:本文由純淨天空篩選整理自python.org大神的英文原創作品 winsound.SND_ALIAS。非經特殊聲明,原始代碼版權歸原作者所有,本譯文未經允許或授權,請勿轉載或複製。