<?xml version="1.0" encoding="UTF-8"?><rss xmlns:dc="http://purl.org/dc/elements/1.1/" xmlns:content="http://purl.org/rss/1.0/modules/content/" xmlns:atom="http://www.w3.org/2005/Atom" version="2.0"><channel><title><![CDATA[Wave-Dateien aus dem Arbeitsspeicher abspielen]]></title><description><![CDATA[<p>Hallo,<br />
ich habe folgendes Problem:<br />
ich möchte eine Wav-Datei abspielen, nur dass der Inhalt im Speicher vorliegt und eben <em>nicht</em> als Datei.<br />
Ich verwende zur Zeit den nachfolgenden Code, der soweit gut funktioniert, sofern man die Sounds als Dateien auf der Festplatte vorliegen hat. Ist es irgendwie möglich mit mciSendCommand eine Wave-Datei aus dem Speicher abzuspielen?<br />
Bei der Funktion PlaySound() kann man das Flag SND_MEMORY setzen, aber diese Funktion wiederum stoppt den bereits spielenden Sound wenn man sie aufruft, was nicht passieren darf.<br />
Ich hoffe, jemand kann mir da einen Fingerzeig geben.</p>
<pre><code>DWORD playWAVEFile(HWND hWndNotify,LPSTR lpszWAVEFileName)
{
 UINT wDeviceID;
 DWORD dwReturn;
 MCI_OPEN_PARMS mciOpenParms;
 MCI_PLAY_PARMS mciPlayParms;
 mciOpenParms.lpstrDeviceType = &quot;waveaudio&quot;;
 mciOpenParms.lpstrElementName = lpszWAVEFileName;
 if (dwReturn=mciSendCommand(0,MCI_OPEN,MCI_OPEN_TYPE|MCI_OPEN_ELEMENT,(DWORD)(LPVOID)&amp;mciOpenParms))
 {
  return (dwReturn);
 }
 wDeviceID=mciOpenParms.wDeviceID;

 mciPlayParms.dwCallback=(DWORD)hWndNotify;
 if (dwReturn=mciSendCommand(wDeviceID,MCI_PLAY,MCI_NOTIFY,(DWORD)(LPVOID)&amp;mciPlayParms))
 {
  mciSendCommand(wDeviceID,MCI_CLOSE,0,NULL);
  return (dwReturn);
 }
 return (0L);
}

void PlayWave(String FileName)
{
 playWAVEFile(Form1-&gt;Handle,FileName.c_str());
}
</code></pre>
]]></description><link>https://www.c-plusplus.net/forum/topic/162336/wave-dateien-aus-dem-arbeitsspeicher-abspielen</link><generator>RSS for Node</generator><lastBuildDate>Sat, 18 Jul 2026 03:54:08 GMT</lastBuildDate><atom:link href="https://www.c-plusplus.net/forum/topic/162336.rss" rel="self" type="application/rss+xml"/><pubDate>Tue, 17 Oct 2006 17:34:14 GMT</pubDate><ttl>60</ttl><item><title><![CDATA[Reply to Wave-Dateien aus dem Arbeitsspeicher abspielen on Tue, 17 Oct 2006 17:34:30 GMT]]></title><description><![CDATA[<p>Hallo,<br />
ich habe folgendes Problem:<br />
ich möchte eine Wav-Datei abspielen, nur dass der Inhalt im Speicher vorliegt und eben <em>nicht</em> als Datei.<br />
Ich verwende zur Zeit den nachfolgenden Code, der soweit gut funktioniert, sofern man die Sounds als Dateien auf der Festplatte vorliegen hat. Ist es irgendwie möglich mit mciSendCommand eine Wave-Datei aus dem Speicher abzuspielen?<br />
Bei der Funktion PlaySound() kann man das Flag SND_MEMORY setzen, aber diese Funktion wiederum stoppt den bereits spielenden Sound wenn man sie aufruft, was nicht passieren darf.<br />
Ich hoffe, jemand kann mir da einen Fingerzeig geben.</p>
<pre><code>DWORD playWAVEFile(HWND hWndNotify,LPSTR lpszWAVEFileName)
{
 UINT wDeviceID;
 DWORD dwReturn;
 MCI_OPEN_PARMS mciOpenParms;
 MCI_PLAY_PARMS mciPlayParms;
 mciOpenParms.lpstrDeviceType = &quot;waveaudio&quot;;
 mciOpenParms.lpstrElementName = lpszWAVEFileName;
 if (dwReturn=mciSendCommand(0,MCI_OPEN,MCI_OPEN_TYPE|MCI_OPEN_ELEMENT,(DWORD)(LPVOID)&amp;mciOpenParms))
 {
  return (dwReturn);
 }
 wDeviceID=mciOpenParms.wDeviceID;

 mciPlayParms.dwCallback=(DWORD)hWndNotify;
 if (dwReturn=mciSendCommand(wDeviceID,MCI_PLAY,MCI_NOTIFY,(DWORD)(LPVOID)&amp;mciPlayParms))
 {
  mciSendCommand(wDeviceID,MCI_CLOSE,0,NULL);
  return (dwReturn);
 }
 return (0L);
}

void PlayWave(String FileName)
{
 playWAVEFile(Form1-&gt;Handle,FileName.c_str());
}
</code></pre>
]]></description><link>https://www.c-plusplus.net/forum/post/1156499</link><guid isPermaLink="true">https://www.c-plusplus.net/forum/post/1156499</guid><dc:creator><![CDATA[Nanyuki]]></dc:creator><pubDate>Tue, 17 Oct 2006 17:34:30 GMT</pubDate></item><item><title><![CDATA[Reply to Wave-Dateien aus dem Arbeitsspeicher abspielen on Tue, 17 Oct 2006 17:36:54 GMT]]></title><description><![CDATA[<p>Mit PlaySound kannst du eine Wave aus der Ressource oder aus dem Speicher wiedergeben.</p>
]]></description><link>https://www.c-plusplus.net/forum/post/1156503</link><guid isPermaLink="true">https://www.c-plusplus.net/forum/post/1156503</guid><dc:creator><![CDATA[[[global:former_user]]]]></dc:creator><pubDate>Tue, 17 Oct 2006 17:36:54 GMT</pubDate></item><item><title><![CDATA[Reply to Wave-Dateien aus dem Arbeitsspeicher abspielen on Tue, 17 Oct 2006 17:42:30 GMT]]></title><description><![CDATA[<p>Luckie schrieb:</p>
<blockquote>
<p>Mit PlaySound kannst du eine Wave aus der Ressource oder aus dem Speicher wiedergeben.</p>
</blockquote>
<p>Ja, aber dann tritt das Problem auf, das ich ja schon erwähnt habe.<br />
Bereits laufende Sounds werden gestoppt.</p>
]]></description><link>https://www.c-plusplus.net/forum/post/1156509</link><guid isPermaLink="true">https://www.c-plusplus.net/forum/post/1156509</guid><dc:creator><![CDATA[Nanyuki]]></dc:creator><pubDate>Tue, 17 Oct 2006 17:42:30 GMT</pubDate></item><item><title><![CDATA[Reply to Wave-Dateien aus dem Arbeitsspeicher abspielen on Wed, 18 Oct 2006 08:40:58 GMT]]></title><description><![CDATA[<p>Hast du dir schon mal die möglichen Flags angeguckt?</p>
]]></description><link>https://www.c-plusplus.net/forum/post/1156830</link><guid isPermaLink="true">https://www.c-plusplus.net/forum/post/1156830</guid><dc:creator><![CDATA[[[global:former_user]]]]></dc:creator><pubDate>Wed, 18 Oct 2006 08:40:58 GMT</pubDate></item><item><title><![CDATA[Reply to Wave-Dateien aus dem Arbeitsspeicher abspielen on Wed, 18 Oct 2006 10:07:15 GMT]]></title><description><![CDATA[<p><a class="plugin-mentions-user plugin-mentions-a" href="https://www.c-plusplus.net/forum/uid/11483">@Nanyuki</a>: SND_NOSTOP gibt es nämlich auch!</p>
]]></description><link>https://www.c-plusplus.net/forum/post/1156932</link><guid isPermaLink="true">https://www.c-plusplus.net/forum/post/1156932</guid><dc:creator><![CDATA[Martin Richter]]></dc:creator><pubDate>Wed, 18 Oct 2006 10:07:15 GMT</pubDate></item><item><title><![CDATA[Reply to Wave-Dateien aus dem Arbeitsspeicher abspielen on Wed, 18 Oct 2006 16:01:54 GMT]]></title><description><![CDATA[<p>Ich hätte genauer sagen müssen, was ich eigentlich möchte:<br />
Ich möchte Sounds vom Speicher aus abspielen, wobei mehrere Sounds (auch der gleiche) gleichzeitig ablaufen können.<br />
Beim Flag SND_NOSTOP wird der Sound ja nicht abgespielt, wenn schon ein anderer läuft. Ohne das Flag wird der bereits spielende Sound gestoppt. Mit der Funktion, die ich gepostet habe, kann man zwar mehrere Sounds gleichzeitig abspielen lassen, aber nicht dieselbe Datei zweimal zur selben Zeit, und es geht auch nicht vom Speicher aus.</p>
<p>Es muss doch eine Möglichkeit geben, die all das verbindet?</p>
]]></description><link>https://www.c-plusplus.net/forum/post/1157200</link><guid isPermaLink="true">https://www.c-plusplus.net/forum/post/1157200</guid><dc:creator><![CDATA[Nanyuki]]></dc:creator><pubDate>Wed, 18 Oct 2006 16:01:54 GMT</pubDate></item><item><title><![CDATA[Reply to Wave-Dateien aus dem Arbeitsspeicher abspielen on Sat, 21 Oct 2006 09:34:09 GMT]]></title><description><![CDATA[<p>Hallo</p>
<p>Auf meiner Homepage <a href="http://members.inode.at/anton.zechner/az/index.html" rel="nofollow">http://members.inode.at/anton.zechner/az/index.html</a> findest du ein Beispiel namens AudioDemo.<br />
Wenn du die Klasse WavClass so umbaust das sie statt von einer Datei<br />
aus dem Speicher etwas aus liest, dann hast du ein fertiges Beispiel.</p>
]]></description><link>https://www.c-plusplus.net/forum/post/1158566</link><guid isPermaLink="true">https://www.c-plusplus.net/forum/post/1158566</guid><dc:creator><![CDATA[AZ]]></dc:creator><pubDate>Sat, 21 Oct 2006 09:34:09 GMT</pubDate></item><item><title><![CDATA[Reply to Wave-Dateien aus dem Arbeitsspeicher abspielen on Sat, 21 Oct 2006 10:00:14 GMT]]></title><description><![CDATA[<p>DirectSound</p>
]]></description><link>https://www.c-plusplus.net/forum/post/1158585</link><guid isPermaLink="true">https://www.c-plusplus.net/forum/post/1158585</guid><dc:creator><![CDATA[x]]></dc:creator><pubDate>Sat, 21 Oct 2006 10:00:14 GMT</pubDate></item></channel></rss>