{"id":3836,"date":"2014-03-30T05:58:04","date_gmt":"2014-03-30T05:58:04","guid":{"rendered":"https:\/\/unknownerror.org\/index.php\/2014\/03\/30\/correct-sound-api-to-use-collection-of-common-programming-errors\/"},"modified":"2014-03-30T05:58:04","modified_gmt":"2014-03-30T05:58:04","slug":"correct-sound-api-to-use-collection-of-common-programming-errors","status":"publish","type":"post","link":"https:\/\/unknownerror.org\/index.php\/2014\/03\/30\/correct-sound-api-to-use-collection-of-common-programming-errors\/","title":{"rendered":"Correct sound api to Use-Collection of common programming errors"},"content":{"rendered":"<ul>\n<li><img decoding=\"async\" src=\"http:\/\/i.msdn.microsoft.com\/dn186180.LOGO_Win1211(id-id,MSDN.10).png\" \/><br \/>\nmsdn I am using native (C++) to develop a game which can play sounds. I want to play sound from memory and not from open files. so using sndPlaySound with the flag SND_MEMORY. which works well. Now the problem starts , there are no event to know when the sound stopped or not even a call to stop the sound.<\/p>\n<p>The other set of Api&#8217;s i.e SndOpen requires a filename and not a raw buffer.<\/p>\n<p>SO how do I play , stop and receive events for a sound when given raw data pointer to the system runtime?<\/li>\n<li><img decoding=\"async\" src=\"http:\/\/i.msdn.microsoft.com\/dn186180.LOGO_Win1211(id-id,MSDN.10).png\" \/><br \/>\nmsdn1 Hi aajustin,Please take a look at following article for playing sound in WM platform:<\/p>\n<ul>\n<li>Playing multiple wave files continuously and simultaneously<br \/>\nMay 15, 2003. Windows has various APIs for outputting wave files. The simplest way is to use PlaySound(), which I bet you have already used. It seemed to work fine &#8211; until you realized it is unable to play more than one wave at the same time, which makes it useless for purposes like game sound effects. On this article I&#8217;ll explain how to turn around this limitation, but for that we&#8217;ll have to forget about the so-beautiful PlaySound(), and take a look at the waveOut interface. It is a bit scary at first sight (specially for those used to PlaySound), but I&#8217;ll try to take it easy by using only what we really need from it.<\/li>\n<li>QA: How can I change sound volume from my program?<br \/>\nOctober 02, 2001. I need to change sound volume from my program. It could be changed in the Control Panel in Sounds &amp; Reminders applet but I need to change sound from my program. How can I do it?<\/li>\n<li>Play wav sounds on Pocket PC<br \/>\nAugust 23, 2001. There are several functions on Pocket PC that can be used for playing sounds in your programs. These are: <em>PlaySound<\/em>, <em>MessageBeep<\/em>, <em>waveOutWrite<\/em> and other <em>waveOut&#8230;<\/em> functions. This article covers working with a <em>PlaySound<\/em> function. In it, there is a description how to play a .wav file, play a sound from resources and play a .wav file located in memory.<\/li>\n<li>Playing audio on a Pocket PC<br \/>\nSeptember 20, 2001. It is not easy to play a custom sound on Pocket PC, there are a lot of questions in newsgroups. This article describes using waveOut&#8230; functions for playing custom sounds. You will be able to use the information and the sample to play active sounds in your games or any other applications.<\/li>\n<p>Best regards,<\/p>\n<p>Guang-Ming Bian &#8211; MSFT<\/p>\n<\/ul>\n<\/li>\n<li><img decoding=\"async\" src=\"http:\/\/i.msdn.microsoft.com\/dn186180.LOGO_Win1211(id-id,MSDN.10).png\" \/><br \/>\nmsdn2 Hi aajustin,Please take a look at following article for playing sound in WM platform:<\/p>\n<ul>\n<li>Playing multiple wave files continuously and simultaneously<br \/>\nMay 15, 2003. Windows has various APIs for outputting wave files. The simplest way is to use PlaySound(), which I bet you have already used. It seemed to work fine &#8211; until you realized it is unable to play more than one wave at the same time, which makes it useless for purposes like game sound effects. On this article I&#8217;ll explain how to turn around this limitation, but for that we&#8217;ll have to forget about the so-beautiful PlaySound(), and take a look at the waveOut interface. It is a bit scary at first sight (specially for those used to PlaySound), but I&#8217;ll try to take it easy by using only what we really need from it.<\/li>\n<li>QA: How can I change sound volume from my program?<br \/>\nOctober 02, 2001. I need to change sound volume from my program. It could be changed in the Control Panel in Sounds &amp; Reminders applet but I need to change sound from my program. How can I do it?<\/li>\n<li>Play wav sounds on Pocket PC<br \/>\nAugust 23, 2001. There are several functions on Pocket PC that can be used for playing sounds in your programs. These are: <em>PlaySound<\/em>, <em>MessageBeep<\/em>, <em>waveOutWrite<\/em> and other <em>waveOut&#8230;<\/em> functions. This article covers working with a <em>PlaySound<\/em> function. In it, there is a description how to play a .wav file, play a sound from resources and play a .wav file located in memory.<\/li>\n<li>Playing audio on a Pocket PC<br \/>\nSeptember 20, 2001. It is not easy to play a custom sound on Pocket PC, there are a lot of questions in newsgroups. This article describes using waveOut&#8230; functions for playing custom sounds. You will be able to use the information and the sample to play active sounds in your games or any other applications.<\/li>\n<p>Best regards,<\/p>\n<p>Guang-Ming Bian &#8211; MSFT<\/p>\n<\/ul>\n<\/li>\n<li><img decoding=\"async\" src=\"http:\/\/i.msdn.microsoft.com\/dn186180.LOGO_Win1211(id-id,MSDN.10).png\" \/><br \/>\nmsdn3 hello , none of the above links work.<\/li>\n<li><img decoding=\"async\" src=\"http:\/\/i.msdn.microsoft.com\/dn186180.LOGO_Win1211(id-id,MSDN.10).png\" \/><br \/>\nmsdn4 Hi Ssachin,Sorry for it, I have correct the link, they work now.Best regards,<\/p>\n<p>Guang-Ming Bian &#8211; MSFT<\/p>\n<\/li>\n<li><img decoding=\"async\" src=\"http:\/\/i.msdn.microsoft.com\/dn186180.LOGO_Win1211(id-id,MSDN.10).png\" \/><br \/>\nmsdn5 Thank you sir. ThankYou sachinijesukaran<\/li>\n<\/ul>\n","protected":false},"excerpt":{"rendered":"<p>msdn I am using native (C++) to develop a game which can play sounds. I want to play sound from memory and not from open files. so using sndPlaySound with the flag SND_MEMORY. which works well. Now the problem starts , there are no event to know when the sound stopped or not even a [&hellip;]<\/p>\n","protected":false},"author":1,"featured_media":0,"comment_status":"closed","ping_status":"closed","sticky":false,"template":"","format":"standard","meta":{"footnotes":""},"categories":[1],"tags":[],"class_list":["post-3836","post","type-post","status-publish","format-standard","hentry","category-uncategorized"],"_links":{"self":[{"href":"https:\/\/unknownerror.org\/index.php\/wp-json\/wp\/v2\/posts\/3836","targetHints":{"allow":["GET"]}}],"collection":[{"href":"https:\/\/unknownerror.org\/index.php\/wp-json\/wp\/v2\/posts"}],"about":[{"href":"https:\/\/unknownerror.org\/index.php\/wp-json\/wp\/v2\/types\/post"}],"author":[{"embeddable":true,"href":"https:\/\/unknownerror.org\/index.php\/wp-json\/wp\/v2\/users\/1"}],"replies":[{"embeddable":true,"href":"https:\/\/unknownerror.org\/index.php\/wp-json\/wp\/v2\/comments?post=3836"}],"version-history":[{"count":0,"href":"https:\/\/unknownerror.org\/index.php\/wp-json\/wp\/v2\/posts\/3836\/revisions"}],"wp:attachment":[{"href":"https:\/\/unknownerror.org\/index.php\/wp-json\/wp\/v2\/media?parent=3836"}],"wp:term":[{"taxonomy":"category","embeddable":true,"href":"https:\/\/unknownerror.org\/index.php\/wp-json\/wp\/v2\/categories?post=3836"},{"taxonomy":"post_tag","embeddable":true,"href":"https:\/\/unknownerror.org\/index.php\/wp-json\/wp\/v2\/tags?post=3836"}],"curies":[{"name":"wp","href":"https:\/\/api.w.org\/{rel}","templated":true}]}}