无法播放WAV文件

时间:2014-10-18 06:18:49

标签: windows livecode

我在卡片1上创建了一个播放器,并将播放器的文件名设置为path/sound。我将独立应用程序保存到Windows。当我点击按钮开始。声音没有播放。发生了什么?

这是我的代码:

堆栈:

on preOpenStack
      if the platform is "Win32" then 
         set the dontUseQT to true
         set the dontUseQTEffects to true
      end if
end preOpenStack

卡片:

on mouseUp
   set itemDel to slash
   put the effective filename of this stack into realpath
   delete last item of realpath
   if environment() is not "mobile" then
      set the fileName of player "player" to (realpath & slash & "assets/sounds/click.wav")
      set the currentTime of player "player" to 0
      start player "player"
   else
      put realpath & slash & "assets/sounds/click.wav" into tPath
      put "clickbtn" into tChannelName
      mobilePlaySoundOnChannel tPath, tChannelName , "now"
   end if
end mouseUp

1 个答案:

答案 0 :(得分:0)

如果没有QuickTime,您无法在播放器控件中播放wav文件。而是将声音导入为控件并使用

play audioClip "Name of sound.wav"

或使用声音的路径:

play "path/to/sound.wav"