<?xml version="1.0" encoding="utf-8" standalone="yes"?>
<oembed>
  <author_name>RIREX</author_name>
  <author_url>https://blog.hatena.ne.jp/RIREX/</author_url>
  <blog_title>P a s t i m e   -   R i R e L o g</blog_title>
  <blog_url>https://rirex.hatenadiary.org/</blog_url>
  <categories>
  </categories>
  <description>私はMacでC++言語を使ってプログラムをしていた。その時、音を出したい場面に遭遇した！結論：system関数を使って外部の音声再生プログラムを呼び出して再生するのが一番簡単なようだ... Macでは標準でafplayコマンドが利用可能であり、引数にファイル名を指定することによってメディアが再生できる。 #include // system関数を利用するためにcstdlibをインクルードint main() { system(&quot;afplay filename.mp3&quot;); // filename.mp3を再生 } 非同期で再生する場合は&amp;を付けると良いようだ。 system(&quot;afplay f…</description>
  <height>190</height>
  <html>&lt;iframe src=&quot;https://hatenablog-parts.com/embed?url=https%3A%2F%2Frirex.hatenadiary.org%2Fentry%2F20170804%2F1501860600&quot; title=&quot;【Mac】簡単にC++上から音声(MP3)を再生する - P a s t i m e   -   R i R e L o g&quot; class=&quot;embed-card embed-blogcard&quot; scrolling=&quot;no&quot; frameborder=&quot;0&quot; style=&quot;display: block; width: 100%; height: 190px; max-width: 500px; margin: 10px 0px;&quot;&gt;&lt;/iframe&gt;</html>
  <image_url></image_url>
  <provider_name>Hatena Blog</provider_name>
  <provider_url>https://hatena.blog</provider_url>
  <published>2017-08-04 00:30:00</published>
  <title>【Mac】簡単にC++上から音声(MP3)を再生する</title>
  <type>rich</type>
  <url>https://rirex.hatenadiary.org/entry/20170804/1501860600</url>
  <version>1.0</version>
  <width>100%</width>
</oembed>
