www.digitalmars.com         C & C++   DMDScript  

digitalmars.D.learn - Basic sounds' playing

reply Cleverson Casarin Uliana via Digitalmars-d-learn writes:
Hello all, starting to learn d, apreciating it so far. I'd like to 
play/stop wave sound files assynchronously on Windows. Can I get a 
module for that by installing a particular compiler, or is there any 
package for it instead?

Thank you,
Cleverson
Oct 07 2016
next sibling parent Vadim Lopatin <coolreader.org gmail.com> writes:
On Saturday, 8 October 2016 at 01:00:20 UTC, Cleverson Casarin 
Uliana wrote:
 Hello all, starting to learn d, apreciating it so far. I'd like 
 to play/stop wave sound files assynchronously on Windows. Can I 
 get a module for that by installing a particular compiler, or 
 is there any package for it instead?

 Thank you,
 Cleverson
Here you can find list of DUB audio related packages. http://code.dlang.org/?sort=updated&category=library.audio Not sure what would be suitable for you. What kind of app are you developing?
Oct 07 2016
prev sibling parent reply John C <johnch_atms hotmail.com> writes:
On Saturday, 8 October 2016 at 01:00:20 UTC, Cleverson Casarin 
Uliana wrote:
 Hello all, starting to learn d, apreciating it so far. I'd like 
 to play/stop wave sound files assynchronously on Windows. Can I 
 get a module for that by installing a particular compiler, or 
 is there any package for it instead?

 Thank you,
 Cleverson
For basic playback of wave files, you could use the native PlaySound function, imported in core.sys.windows.mmsystem. https://msdn.microsoft.com/en-us/library/windows/desktop/dd743680(v=vs.85).aspx
Oct 08 2016
parent reply Cleverson Casarin Uliana via Digitalmars-d-learn writes:
Thank you Vadim and John, the PlaySound function is enough for now. I'm 
not yet developing an app, just experimenting with some exercises.

The wasapi library seems interesting, does it also implement a 
playSound-like function?

Greetings
Cleverson
Oct 08 2016
parent John C <johnch_atms hotmail.com> writes:
On Saturday, 8 October 2016 at 13:35:57 UTC, Cleverson Casarin 
Uliana wrote:
 Thank you Vadim and John, the PlaySound function is enough for 
 now. I'm not yet developing an app, just experimenting with 
 some exercises.

 The wasapi library seems interesting, does it also implement a 
 playSound-like function?

 Greetings
 Cleverson
WASAPI looks more complicated - see this sample for playing a file https://msdn.microsoft.com/en-us/library/windows/desktop/dd316756(v=vs.85).aspx
Oct 08 2016