<?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[Sounds Spielen?]]></title><description><![CDATA[<p>Hallo.</p>
<p>habe jetzt schon lange gegoogelt, aber nichts gefunden:<br />
Wie kann ich einen Sound (beispielsweise einen .mp3 sound)<br />
in meinem programm laufen lassen?<br />
ich glaube man muss da was mit playsound() und so<br />
machen, aberkann mir mal einer erklären, wie das richtig geht?(bitte mit code <img
      src="https://www.c-plusplus.net/forum/plugins/nodebb-plugin-emoji/emoji/emoji-one/1f603.png?v=ab1pehoraso"
      class="not-responsive emoji emoji-emoji-one emoji--grinning_face_with_big_eyes"
      title=":D"
      alt="😃"
    /> )<br />
danke schonmal im v o r r a u s<br />
martinustreveri</p>
]]></description><link>https://www.c-plusplus.net/forum/topic/224434/sounds-spielen</link><generator>RSS for Node</generator><lastBuildDate>Fri, 02 Oct 2026 12:06:52 GMT</lastBuildDate><atom:link href="https://www.c-plusplus.net/forum/topic/224434.rss" rel="self" type="application/rss+xml"/><pubDate>Thu, 09 Oct 2008 13:49:46 GMT</pubDate><ttl>60</ttl><item><title><![CDATA[Reply to Sounds Spielen? on Thu, 09 Oct 2008 13:50:23 GMT]]></title><description><![CDATA[<p>Hallo.</p>
<p>habe jetzt schon lange gegoogelt, aber nichts gefunden:<br />
Wie kann ich einen Sound (beispielsweise einen .mp3 sound)<br />
in meinem programm laufen lassen?<br />
ich glaube man muss da was mit playsound() und so<br />
machen, aberkann mir mal einer erklären, wie das richtig geht?(bitte mit code <img
      src="https://www.c-plusplus.net/forum/plugins/nodebb-plugin-emoji/emoji/emoji-one/1f603.png?v=ab1pehoraso"
      class="not-responsive emoji emoji-emoji-one emoji--grinning_face_with_big_eyes"
      title=":D"
      alt="😃"
    /> )<br />
danke schonmal im v o r r a u s<br />
martinustreveri</p>
]]></description><link>https://www.c-plusplus.net/forum/post/1596307</link><guid isPermaLink="true">https://www.c-plusplus.net/forum/post/1596307</guid><dc:creator><![CDATA[martinustreveri]]></dc:creator><pubDate>Thu, 09 Oct 2008 13:50:23 GMT</pubDate></item><item><title><![CDATA[Reply to Sounds Spielen? on Thu, 09 Oct 2008 13:52:32 GMT]]></title><description><![CDATA[<p>martinustreveri schrieb:</p>
<blockquote>
<p>danke schonmal im v o r r a u s</p>
</blockquote>
<p>Probier es mit einem R, dann klappt das auch.</p>
<p>Was für ein Toolkit verwendest du denn? Die WinAPI, oder Qt, oder SDL oder oder oder. C++ kennt keine Sounds, daher wäre das entsprechende Toolkit-Forum angebrachter.</p>
]]></description><link>https://www.c-plusplus.net/forum/post/1596310</link><guid isPermaLink="true">https://www.c-plusplus.net/forum/post/1596310</guid><dc:creator><![CDATA[Fellhuhn]]></dc:creator><pubDate>Thu, 09 Oct 2008 13:52:32 GMT</pubDate></item><item><title><![CDATA[Reply to Sounds Spielen? on Thu, 09 Oct 2008 13:57:01 GMT]]></title><description><![CDATA[<p>Fellhuhn schrieb:</p>
<blockquote>
<p>martinustreveri schrieb:</p>
<blockquote>
<p>danke schonmal im v o r r a u s</p>
</blockquote>
<p>Probier es mit einem R, dann klappt das auch.</p>
<p>Was für ein Toolkit verwendest du denn? Die WinAPI, oder Qt, oder SDL oder oder oder. C++ kennt keine Sounds, daher wäre das entsprechende Toolkit-Forum angebrachter.</p>
</blockquote>
<p>aha, was hätte ich denn da für möglichkeiten, um sounds zu spielen?</p>
]]></description><link>https://www.c-plusplus.net/forum/post/1596317</link><guid isPermaLink="true">https://www.c-plusplus.net/forum/post/1596317</guid><dc:creator><![CDATA[martinustreveri]]></dc:creator><pubDate>Thu, 09 Oct 2008 13:57:01 GMT</pubDate></item><item><title><![CDATA[Reply to Sounds Spielen? on Thu, 09 Oct 2008 14:05:55 GMT]]></title><description><![CDATA[<p>martinustreveri schrieb:</p>
<blockquote>
<p>Fellhuhn schrieb:</p>
<blockquote>
<p>martinustreveri schrieb:</p>
<blockquote>
<p>danke schonmal im v o r r a u s</p>
</blockquote>
<p>Probier es mit einem R, dann klappt das auch.</p>
<p>Was für ein Toolkit verwendest du denn? Die WinAPI, oder Qt, oder SDL oder oder oder. C++ kennt keine Sounds, daher wäre das entsprechende Toolkit-Forum angebrachter.</p>
</blockquote>
<p>aha, was hätte ich denn da für möglichkeiten, um sounds zu spielen?</p>
</blockquote>
<p>Da hilft Dir eine Suchmaschine weiter. Stichworte gibts ja jetzt genug.</p>
]]></description><link>https://www.c-plusplus.net/forum/post/1596323</link><guid isPermaLink="true">https://www.c-plusplus.net/forum/post/1596323</guid><dc:creator><![CDATA[Tachyon]]></dc:creator><pubDate>Thu, 09 Oct 2008 14:05:55 GMT</pubDate></item><item><title><![CDATA[Reply to Sounds Spielen? on Thu, 09 Oct 2008 14:14:51 GMT]]></title><description><![CDATA[<p>So.<br />
Ich habe mir jetzt al SDL angeguckt, jetzt stellt sich nur die frage,<br />
wie ich das machen soll??<br />
(also dann nachher in meinem programm z.. ein lied laufen zu lassen)</p>
]]></description><link>https://www.c-plusplus.net/forum/post/1596330</link><guid isPermaLink="true">https://www.c-plusplus.net/forum/post/1596330</guid><dc:creator><![CDATA[martinustreveri]]></dc:creator><pubDate>Thu, 09 Oct 2008 14:14:51 GMT</pubDate></item><item><title><![CDATA[Reply to Sounds Spielen? on Thu, 09 Oct 2008 14:17:12 GMT]]></title><description><![CDATA[<p>martinustreveri schrieb:</p>
<blockquote>
<p>So.<br />
Ich habe mir jetzt al SDL angeguckt, jetzt stellt sich nur die frage,<br />
wie ich das machen soll??<br />
(also dann nachher in meinem programm z.. ein lied laufen zu lassen)</p>
</blockquote>
<p>Du musst wohl weitersuchen. Schau Dir die APIs an, und probier damit rum, Wenn Du dann nicht weiter kommst, kannst Du nochmal fragen.</p>
]]></description><link>https://www.c-plusplus.net/forum/post/1596332</link><guid isPermaLink="true">https://www.c-plusplus.net/forum/post/1596332</guid><dc:creator><![CDATA[Tachyon]]></dc:creator><pubDate>Thu, 09 Oct 2008 14:17:12 GMT</pubDate></item><item><title><![CDATA[Reply to Sounds Spielen? on Thu, 09 Oct 2008 17:18:20 GMT]]></title><description><![CDATA[<p>Also n gutes SDL tutorial gibt es unter<br />
<a href="http://de.wikibooks.org/wiki/SDL" rel="nofollow">http://de.wikibooks.org/wiki/SDL</a></p>
<p>Sounds abzuspielen wird hier erklärt<br />
<a href="http://de.wikibooks.org/wiki/SDL:_Audio" rel="nofollow">http://de.wikibooks.org/wiki/SDL:_Audio</a></p>
<p>aber fange am besten von vorne an SDL ist echt nicht schwer und man kann<br />
damit tolle 2d Anwendungen machen</p>
<p>mfg</p>
]]></description><link>https://www.c-plusplus.net/forum/post/1596483</link><guid isPermaLink="true">https://www.c-plusplus.net/forum/post/1596483</guid><dc:creator><![CDATA[guest_1]]></dc:creator><pubDate>Thu, 09 Oct 2008 17:18:20 GMT</pubDate></item><item><title><![CDATA[Reply to Sounds Spielen? on Thu, 09 Oct 2008 17:30:02 GMT]]></title><description><![CDATA[<p>SDL ist hauptsächlich eine <strong>Grafik</strong>bibliothek, die übrigens in C geschrieben ist. Um Sound abzuspielen, muss man eine zusätzliche SDL-Lib herunterladen (SDL_mixer). Nur für Sound würde ich das deshalb nicht unbedingt empfehlen. Es gibt viele Soundbibliotheken, die ich jedoch auch nicht genug kenne (z.B. IrrKlang).</p>
<p>Wenn man 2D-Grafik benötigt, rate ich sowieso zu SFML, das ist schneller, benutzerfreundlicher und bietet auch Objektorientierung, da es in C++ geschrieben ist (gibts übrigens auch für andere Programmiersprachen).</p>
]]></description><link>https://www.c-plusplus.net/forum/post/1596491</link><guid isPermaLink="true">https://www.c-plusplus.net/forum/post/1596491</guid><dc:creator><![CDATA[Nexus]]></dc:creator><pubDate>Thu, 09 Oct 2008 17:30:02 GMT</pubDate></item><item><title><![CDATA[Reply to Sounds Spielen? on Thu, 09 Oct 2008 17:55:43 GMT]]></title><description><![CDATA[<p>Ich gehe mal davon aus dass Du unter Windows unterwegs bist.<br />
Die einfachste Möglichkeit ist hier wie Du schon richtig vermutet hast die WinAPI Funktion &quot;PlaySound()&quot;.</p>
<p>So kannst Du eine Wav Datei abspielen:</p>
<pre><code class="language-cpp">PlaySound(&quot;beispiel.wav&quot;, NULL, SND_ASYNC | SND_NODEFAULT);
</code></pre>
<p>Und so kannst das Abspielen vorzeitig beenden:</p>
<pre><code class="language-cpp">PlaySound(NULL, NULL, NULL);
</code></pre>
]]></description><link>https://www.c-plusplus.net/forum/post/1596504</link><guid isPermaLink="true">https://www.c-plusplus.net/forum/post/1596504</guid><dc:creator><![CDATA[bergvagabund]]></dc:creator><pubDate>Thu, 09 Oct 2008 17:55:43 GMT</pubDate></item><item><title><![CDATA[Reply to Sounds Spielen? on Fri, 10 Oct 2008 08:20:01 GMT]]></title><description><![CDATA[<p>Schöner verpackt:</p>
<pre><code class="language-cpp">#include &lt;windows.h&gt;
#include &lt;stdio.h&gt;
//#pragma comment(lib,&quot;winmm.lib&quot;)  //für MSV C++  

BOOL play(char *name)
{
  PlaySound(name, NULL, SND_FILENAME | SND_ASYNC);
  return 0;
}

int main()
{  
  play(&quot;test.wav&quot;);  
  getchar();
  return 0;
}
</code></pre>
]]></description><link>https://www.c-plusplus.net/forum/post/1596706</link><guid isPermaLink="true">https://www.c-plusplus.net/forum/post/1596706</guid><dc:creator><![CDATA[Kóyaánasqatsi]]></dc:creator><pubDate>Fri, 10 Oct 2008 08:20:01 GMT</pubDate></item><item><title><![CDATA[Reply to Sounds Spielen? on Fri, 10 Oct 2008 09:11:02 GMT]]></title><description><![CDATA[<p>hm..<br />
way ich hab mir mal den code kopiert und angesehen.</p>
<p>da kommt dann aber volgende meldung:</p>
<p>[Link Error] undefines reference to `PlaySoundA@12'<br />
id returned 1 exit status<br />
[Build Error] [PlaySound.exe] Error1</p>
<p>Was hat das zu bedeuten???<br />
ich habe die datei, die ich abspielen wollte, in &quot;meer&quot; umbennant,<br />
sie in das verzeichnis kopiert und dann halt playsound...(&quot;meer.mp3&quot;)<br />
kann es sein dass es einfach nur mit mp3 nicht funktioniert?!?</p>
]]></description><link>https://www.c-plusplus.net/forum/post/1596754</link><guid isPermaLink="true">https://www.c-plusplus.net/forum/post/1596754</guid><dc:creator><![CDATA[martinustreveri]]></dc:creator><pubDate>Fri, 10 Oct 2008 09:11:02 GMT</pubDate></item><item><title><![CDATA[Reply to Sounds Spielen? on Fri, 10 Oct 2008 09:21:36 GMT]]></title><description><![CDATA[<p>Es können nur .wav-Musikdateien abgespielt werden...(:<br />
Falls du den Sound abspielen möchtest, müsstest du dir einen Mp3 to Wav Converter downloaden (:. Frag nach wenn du einen Link haben möchtest, suche dir dann einen raus...</p>
]]></description><link>https://www.c-plusplus.net/forum/post/1596761</link><guid isPermaLink="true">https://www.c-plusplus.net/forum/post/1596761</guid><dc:creator><![CDATA[Kóyaánasqatsi]]></dc:creator><pubDate>Fri, 10 Oct 2008 09:21:36 GMT</pubDate></item><item><title><![CDATA[Reply to Sounds Spielen? on Fri, 10 Oct 2008 09:32:18 GMT]]></title><description><![CDATA[<p>Wegen solchen Dingen habe ich Dich an eine Suchmaschine verwiesen. Dann würdest Du nämlich gelesen haben, dass man auch noch zusätzliche Bibliotheken linken muss und einen kleinen Überblick darüber bekommen, wie das ganze überhaupt funktioniert.<br />
Man hat einen besseren Lerneffekt dabei. Der Lerneffekt beim bloßen kopieren von Quellcode ist dagegen quasi gleich null.</p>
]]></description><link>https://www.c-plusplus.net/forum/post/1596763</link><guid isPermaLink="true">https://www.c-plusplus.net/forum/post/1596763</guid><dc:creator><![CDATA[Tachyon]]></dc:creator><pubDate>Fri, 10 Oct 2008 09:32:18 GMT</pubDate></item><item><title><![CDATA[Reply to Sounds Spielen? on Fri, 10 Oct 2008 09:32:54 GMT]]></title><description><![CDATA[<p>Najut, also so einfach ist das nicht, dass man das hier mal schnell posten<br />
kann... Vorausgesetzt man will den decoder selber schreiben! Wenn nicht,<br />
dann braucht man das DX-SDK. mit DirectShow geht das.</p>
<p>Den Download gibts bei <a href="http://microsoft.com" rel="nofollow">microsoft.com</a> (~220MB)<br />
-&gt;Einfach mal &quot;DirectX SDK&quot; bei der Suche eingaben (natürlich ohne &quot;&quot;)</p>
]]></description><link>https://www.c-plusplus.net/forum/post/1596772</link><guid isPermaLink="true">https://www.c-plusplus.net/forum/post/1596772</guid><dc:creator><![CDATA[Kóyaánasqatsi]]></dc:creator><pubDate>Fri, 10 Oct 2008 09:32:54 GMT</pubDate></item><item><title><![CDATA[Reply to Sounds Spielen? on Fri, 10 Oct 2008 12:15:09 GMT]]></title><description><![CDATA[<p>way schrieb:</p>
<blockquote>
<p>Schöner verpackt</p>
</blockquote>
<p>...</p>
<pre><code class="language-cpp">#include &lt;stdio.h&gt;   // der Header heisst immer noch &lt;cstdio&gt;

// Wieso BOOL, wenn es bool gibt? Wieso hat man überhaupt einen
// Rückgabetypen, wenn man immer 0 zurückgibt? Wieso einen
// Rückgabetypen, wenn man ihn beim Aufruf nicht einmal abfragt?
// Ausserdem wäre vielleicht const char* besser als Parametertyp.
BOOL play(char *name)
{
  PlaySound(name, NULL, SND_FILENAME | SND_ASYNC);
  return 0;
}
</code></pre>
<p>Ausserdem wundere ich mich ein bisschen wegen der hier präsentierten &quot;Möglichkeiten&quot;, um Musik abzuspielen. Zuerst MP3-to-WAV-Converter downloaden, und dann noch das gesamte DirectX-SDK... Naja. Es gibt sicher reine Sound-Bibliotheken, mit denen man sich auch von plattformabhängigen Zwischenlösungen trennen kann.</p>
]]></description><link>https://www.c-plusplus.net/forum/post/1596911</link><guid isPermaLink="true">https://www.c-plusplus.net/forum/post/1596911</guid><dc:creator><![CDATA[Nexus]]></dc:creator><pubDate>Fri, 10 Oct 2008 12:15:09 GMT</pubDate></item><item><title><![CDATA[Reply to Sounds Spielen? on Fri, 10 Oct 2008 15:31:32 GMT]]></title><description><![CDATA[<p>Wenn es unter Windows sein soll, kann man für MP3s auch einfach MCI verwenden:</p>
<pre><code class="language-cpp">std::string filename=&quot;d:\\test.mp3&quot;;
mciSendString((&quot;open &quot; +filename+&quot; type MPEGVideo alias myMP3_1&quot;).c_str(),0,0,0);
mciSendString(&quot;play myMP3_1 from 0&quot;,0,0,0);
</code></pre>
<p>Zum Stoppen:</p>
<pre><code class="language-cpp">mciSendString(&quot;stop myMP3_1&quot;,0,0,0);
mciSendString(&quot;close myMP3_1&quot;,0,0,0);
</code></pre>
<p>An eine bestimmte Position springen und anhalten geht auch.</p>
]]></description><link>https://www.c-plusplus.net/forum/post/1597066</link><guid isPermaLink="true">https://www.c-plusplus.net/forum/post/1597066</guid><dc:creator><![CDATA[Nanyuki]]></dc:creator><pubDate>Fri, 10 Oct 2008 15:31:32 GMT</pubDate></item><item><title><![CDATA[Reply to Sounds Spielen? on Sat, 11 Oct 2008 14:48:02 GMT]]></title><description><![CDATA[<p>oha,das hört sich gut an.<br />
werde gleich mal suchen (ver-)<br />
ach, eine frage noch:<br />
wie sieht dieses MCI aus?<br />
meine damit, ob das ne lib oder ein programm oder was auch immer ist?</p>
]]></description><link>https://www.c-plusplus.net/forum/post/1597441</link><guid isPermaLink="true">https://www.c-plusplus.net/forum/post/1597441</guid><dc:creator><![CDATA[martinustreveri]]></dc:creator><pubDate>Sat, 11 Oct 2008 14:48:02 GMT</pubDate></item></channel></rss>