From: MENON Jean-Francois Date: 2002-11-11T04:12:11+09:00 Subject: Re: sound under windows Bill Kelly wrote: > > Hi, > > From: "MENON Jean-Francois" > > hello, > > what is the good way for output simple sounds with Ruby under windows ? > > I looked in the RAA but it seems to be only libs for linux > > One way is to use Win32API: > > SND_MEMORY = 0x00000004 # from "mmsystem.h" > SND_FILENAME = 0x00020000 > > PlaySound = Win32API.new("winmm", "PlaySound", ['P', 'L', 'L'], 'I') > > # play from file: > PlaySound.call("C:/your/sound.wav", 0, SND_FILENAME) > > # play from memory: > wav = File.open("C:/your/sound.wav", File::RDONLY) {|f| f.binmode; f.read } > PlaySound.call(wav, 0, SND_MEMORY) > > HTH, > > Bill thank you very much :-> I don't know if it is planned for future releases of Ruby, but I think it would be good to have a standard (platform independent) way to play wav files with ruby. regards, jf