MaxScript播放wav

--ActiveX版本
rollout test
"Test" 350
(
--去掉visible可以显示出播放控制界面
ActiveXControl axmp
"MediaPlayer.MediaPlayer" height:50 visible:false
on test open
do
(
axmp.filename
= "d:\\games\\小鬼的罗嗦.wav"
--这个参数如果为0,则是一直重复,其他数字为重复次数
axmp.playCount
=1
axmp.play()
)
)

-- .Net版本
SoundPlayer
= DotNetObject "System.Media.SoundPlayer"
SoundPlayer.SoundLocation
= "d:\\games\\小鬼的罗嗦.wav"
SoundPlayer.Play()
/*
SoundPlayer.PlayLooping()
SoundPlayer.Stop()
*/
原文地址:https://www.cnblogs.com/sitt/p/2086143.html