<?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[Problem beim Abspielen eines Soundbuffers]]></title><description><![CDATA[<p>Hi,</p>
<p>will mit PlaySound den in einer WAVEHDR enthaltenen Sound abspielen. Dazu rufe ich die Funktion wie folgt auf:</p>
<pre><code class="language-cpp">PlaySound(WaveHeader.lpData, 0, SND_MEMORY | SND_ASYNC);
</code></pre>
<p>Klappt leider nicht. Kann mir da wer helfen?</p>
<p>Gruß<br />
Alex</p>
<p>Ps. Die Daten sind auch wirklich in der Struktur, da das ganze als File gespeichert funktioniert.</p>
]]></description><link>https://www.c-plusplus.net/forum/topic/158879/problem-beim-abspielen-eines-soundbuffers</link><generator>RSS for Node</generator><lastBuildDate>Tue, 21 Jul 2026 14:45:17 GMT</lastBuildDate><atom:link href="https://www.c-plusplus.net/forum/topic/158879.rss" rel="self" type="application/rss+xml"/><pubDate>Sat, 09 Sep 2006 14:07:30 GMT</pubDate><ttl>60</ttl><item><title><![CDATA[Reply to Problem beim Abspielen eines Soundbuffers on Sat, 09 Sep 2006 14:07:30 GMT]]></title><description><![CDATA[<p>Hi,</p>
<p>will mit PlaySound den in einer WAVEHDR enthaltenen Sound abspielen. Dazu rufe ich die Funktion wie folgt auf:</p>
<pre><code class="language-cpp">PlaySound(WaveHeader.lpData, 0, SND_MEMORY | SND_ASYNC);
</code></pre>
<p>Klappt leider nicht. Kann mir da wer helfen?</p>
<p>Gruß<br />
Alex</p>
<p>Ps. Die Daten sind auch wirklich in der Struktur, da das ganze als File gespeichert funktioniert.</p>
]]></description><link>https://www.c-plusplus.net/forum/post/1134234</link><guid isPermaLink="true">https://www.c-plusplus.net/forum/post/1134234</guid><dc:creator><![CDATA[krötenlecker]]></dc:creator><pubDate>Sat, 09 Sep 2006 14:07:30 GMT</pubDate></item><item><title><![CDATA[Reply to Problem beim Abspielen eines Soundbuffers on Sat, 09 Sep 2006 14:33:13 GMT]]></title><description><![CDATA[<p>[url=http://msdn.microsoft.com/library/default.asp?url=/library/en-us/wcewave/html/_wcesdk_win32_playsound.asp]BOOL WINAPI PlaySound(<br />
LPCSTR pszSound,<br />
HMODULE hmod,<br />
DWORD fdwSound<br />
)[/url]</p>
<p>Edit:<br />
Ich denke, du musst die ganze Datei im Speicher übergeben. Nicht nur den Datenteil der .WAV.</p>
]]></description><link>https://www.c-plusplus.net/forum/post/1134246</link><guid isPermaLink="true">https://www.c-plusplus.net/forum/post/1134246</guid><dc:creator><![CDATA[[[global:guest]]]]></dc:creator><pubDate>Sat, 09 Sep 2006 14:33:13 GMT</pubDate></item><item><title><![CDATA[Reply to Problem beim Abspielen eines Soundbuffers on Sat, 09 Sep 2006 14:40:08 GMT]]></title><description><![CDATA[<p>Ok, thx.</p>
<p>Aber wie kann ich das dann machen?</p>
]]></description><link>https://www.c-plusplus.net/forum/post/1134249</link><guid isPermaLink="true">https://www.c-plusplus.net/forum/post/1134249</guid><dc:creator><![CDATA[krötenlecker]]></dc:creator><pubDate>Sat, 09 Sep 2006 14:40:08 GMT</pubDate></item><item><title><![CDATA[Reply to Problem beim Abspielen eines Soundbuffers on Sat, 09 Sep 2006 14:56:45 GMT]]></title><description><![CDATA[<p>krötenlecker schrieb:</p>
<blockquote>
<p>Ok, thx.</p>
<p>Aber wie kann ich das dann machen?</p>
</blockquote>
<p>Ich vermute nur, dass das so ist. Wenn, dann so:</p>
<pre><code class="language-cpp">char* buf[1024*200];
  FILE* fp;
  fp = fopen(&quot;datei.wav&quot;, &quot;rb&quot;);

  if (fp != NULL) {
    fread(buf, 1024, 200, fp);

    fclose(fp);

    PlaySound(buf, 0, SND_MEMORY | SND_ASYNC);
  }
</code></pre>
]]></description><link>https://www.c-plusplus.net/forum/post/1134258</link><guid isPermaLink="true">https://www.c-plusplus.net/forum/post/1134258</guid><dc:creator><![CDATA[[[global:guest]]]]></dc:creator><pubDate>Sat, 09 Sep 2006 14:56:45 GMT</pubDate></item><item><title><![CDATA[Reply to Problem beim Abspielen eines Soundbuffers on Sat, 09 Sep 2006 16:23:44 GMT]]></title><description><![CDATA[<p>Ja, aber dann lade ich die Datei ja.<br />
Ich habe aber Daten im Speicher, die ich gerade erst generiert habe. <img
      src="https://www.c-plusplus.net/forum/plugins/nodebb-plugin-emoji/emoji/emoji-one/1f609.png?v=ab1pehoraso"
      class="not-responsive emoji emoji-emoji-one emoji--winking_face"
      title=";)"
      alt="😉"
    /></p>
]]></description><link>https://www.c-plusplus.net/forum/post/1134288</link><guid isPermaLink="true">https://www.c-plusplus.net/forum/post/1134288</guid><dc:creator><![CDATA[krötenlecker]]></dc:creator><pubDate>Sat, 09 Sep 2006 16:23:44 GMT</pubDate></item><item><title><![CDATA[Reply to Problem beim Abspielen eines Soundbuffers on Sat, 09 Sep 2006 16:56:44 GMT]]></title><description><![CDATA[<p>Also ich würde sagen, dass die Funktion PlaySound schon richtig angewandt wurde, jedoch<br />
der adressierte Speicherbereich, indem die abzuspielenden Musikdaten liegen <strong>sollten</strong>,<br />
fehlerhaft ist.</p>
]]></description><link>https://www.c-plusplus.net/forum/post/1134305</link><guid isPermaLink="true">https://www.c-plusplus.net/forum/post/1134305</guid><dc:creator><![CDATA[CodeFinder]]></dc:creator><pubDate>Sat, 09 Sep 2006 16:56:44 GMT</pubDate></item><item><title><![CDATA[Reply to Problem beim Abspielen eines Soundbuffers on Sat, 09 Sep 2006 17:35:56 GMT]]></title><description><![CDATA[<p>Also die Daten müssten eigendlich im Speicher sein, da ich sie auch zu Debugzwecken in eine .wav-Datei schreiben lasse. Das funktioniert.</p>
]]></description><link>https://www.c-plusplus.net/forum/post/1134324</link><guid isPermaLink="true">https://www.c-plusplus.net/forum/post/1134324</guid><dc:creator><![CDATA[krötenlecker]]></dc:creator><pubDate>Sat, 09 Sep 2006 17:35:56 GMT</pubDate></item><item><title><![CDATA[Reply to Problem beim Abspielen eines Soundbuffers on Sat, 09 Sep 2006 19:09:29 GMT]]></title><description><![CDATA[<p>Habe jetzt die waveOut...-Funktionen entdeckt. Nur ist das MSDN da wieder alles andere als übersichtlich. Könnte jemand mal drei Zeilen Code posten, wie ich so einen Datenpuffer wie oben abspielen und anhalten kann? Danke!</p>
]]></description><link>https://www.c-plusplus.net/forum/post/1134375</link><guid isPermaLink="true">https://www.c-plusplus.net/forum/post/1134375</guid><dc:creator><![CDATA[krötenlecker]]></dc:creator><pubDate>Sat, 09 Sep 2006 19:09:29 GMT</pubDate></item><item><title><![CDATA[Reply to Problem beim Abspielen eines Soundbuffers on Sun, 10 Sep 2006 09:48:31 GMT]]></title><description><![CDATA[<pre><code class="language-cpp">HWAVEOUT wo;
waveOutOpen(&amp;wo, WAVE_MAPPER, &amp;wf, 0, 0, CALLBACK_NULL);
waveOutPrepareHeader(wo, &amp;wh, sizeof(WAVEHDR));
waveOutWrite(wo, &amp;wh, sizeof(WAVEHDR));
waveOutUnprepareHeader(wo, &amp;wh, sizeof(WAVEHDR));
waveOutReset(wo);
waveOutClose(wo);
</code></pre>
<p>Ist das so richtig?<br />
Manchmal bekomme ich den Sound sogar ausgegeben. Brauche aber eine perfekt laufende Lösung. <img
      src="https://www.c-plusplus.net/forum/plugins/nodebb-plugin-emoji/emoji/emoji-one/1f609.png?v=ab1pehoraso"
      class="not-responsive emoji emoji-emoji-one emoji--winking_face"
      title=";)"
      alt="😉"
    /></p>
<p>Ach ja, waveOutUnprepareHeader schlägt manchmal fehl!?</p>
<p>Danke für Hilfe!</p>
]]></description><link>https://www.c-plusplus.net/forum/post/1134537</link><guid isPermaLink="true">https://www.c-plusplus.net/forum/post/1134537</guid><dc:creator><![CDATA[krötenlecker]]></dc:creator><pubDate>Sun, 10 Sep 2006 09:48:31 GMT</pubDate></item></channel></rss>