digitalmars.D.learn - Simple way to play sounds using D
- Murilo (3/3) Feb 05 2019 Hi guys, I would like to play simple sounds but I want something
- Adam D. Ruppe (3/6) Feb 05 2019 If you are on Windows, the OS has a nice function for little ones:
- Murilo (10/17) Feb 05 2019 Hi, thanks for the reply.
- Adam D. Ruppe (6/9) Feb 05 2019 It might have to be "shoot.wav"w, notice the w on the end.
- Murilo (4/13) Feb 05 2019 You were right :) No need for the w but it was necessary the
Hi guys, I would like to play simple sounds but I want something easy to use, can you show me the simplest way to do that? Like a function that just loads a .wav and plays it.
Feb 05 2019
On Tuesday, 5 February 2019 at 16:50:36 UTC, Murilo wrote:Hi guys, I would like to play simple sounds but I want something easy to use, can you show me the simplest way to do that? Like a function that just loads a .wav and plays it.If you are on Windows, the OS has a nice function for little ones: https://docs.microsoft.com/en-us/previous-versions//dd743680(v=vs.85)#examples
Feb 05 2019
On Tuesday, 5 February 2019 at 17:01:54 UTC, Adam D. Ruppe wrote:On Tuesday, 5 February 2019 at 16:50:36 UTC, Murilo wrote:Hi, thanks for the reply. import std.stdio, core.sys.windows.mmsystem; void main() { PlaySound("shoot.wav", null, SND_FILENAME); } When I compile the code above the compiler says Error: linker exited with status 1 What should I do?Hi guys, I would like to play simple sounds but I want something easy to use, can you show me the simplest way to do that? Like a function that just loads a .wav and plays it.If you are on Windows, the OS has a nice function for little ones: https://docs.microsoft.com/en-us/previous-versions//dd743680(v=vs.85)#examples
Feb 05 2019
On Tuesday, 5 February 2019 at 17:09:10 UTC, Murilo wrote:When I compile the code above the compiler says Error: linker exited with status 1 What should I do?It might have to be "shoot.wav"w, notice the w on the end. But I am guessing the main problem is not linking in the winmm lib and dll. It will probably work to add pragma(lib, "winmm"); to your file right after the import.
Feb 05 2019
On Tuesday, 5 February 2019 at 17:14:05 UTC, Adam D. Ruppe wrote:On Tuesday, 5 February 2019 at 17:09:10 UTC, Murilo wrote:You were right :) No need for the w but it was necessary the pragma(lib, "winmm"); It worked! Thanks so much man, all the best to you.When I compile the code above the compiler says Error: linker exited with status 1 What should I do?It might have to be "shoot.wav"w, notice the w on the end. But I am guessing the main problem is not linking in the winmm lib and dll. It will probably work to add pragma(lib, "winmm"); to your file right after the import.
Feb 05 2019