dxruby icon indicating copy to clipboard operation
dxruby copied to clipboard

[DXRuby 1.4.7] 64bitでは、Sound.newでエラー

Open noanoa07 opened this issue 4 years ago • 0 comments

64bit版では、Sound.new でエラーになります。

サンプルコード↓

require 'dxruby'

sound = Sound.new("sound.wav")  # sound.wav読み込み
#bgm = Sound.new("bgm.mid")  # bgm.mid読み込み

#bgm.play

Window.loop do
  if Input.key_push?(K_Z) then  # Zキーで再生
    sound.play
  end
end

>ruby sound.rb sound.rb:3:in initialize': DirectMusic initialize error - CoCreateInstance (DXRuby::DXRubyError) from sound.rb:3:in new' from sound.rb:3:in `

'

動作環境

  • Windows 10(64bit)
  • ruby 3.0.0p0 (2020-12-25 revision 95aff21468) [x64-mingw32]
  • Windows Installer for Windows で + Devkit版
  • d3dx9_40.dll(64bit)を C:\Windows\System32フォルダに配置

比較環境(こちらはエラーなく動作)

  • ruby 3.0.0p0 (2020-12-25 revision 95aff21468) [i386-mingw32]
  • d3dx9_40.dll(32bit)を C:\Windows\SysWOW64フォルダに配置

noanoa07 avatar Jan 17 '21 07:01 noanoa07