<?xml version="1.0" encoding="UTF-8" standalone="no"?> <!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.0 Transitional//EN" "http://www.w3.org/TR/xhtml1/DTD/xhtml1-transitional.dtd"> <html xmlns="http://www.w3.org/1999/xhtml"> <head> <meta http-equiv="Content-Type" content="text/html; charset=UTF-8" /> <title>mp3in</title> <link rel="stylesheet" type="text/css" href="csound.css" /> <link rel="stylesheet" type="text/css" href="syntax-highlighting.css" /> <meta name="generator" content="DocBook XSL Stylesheets Vsnapshot" /> <link rel="home" href="index.html" title="The Canonical Csound Reference Manual" /> <link rel="up" href="OpcodesTop.html" title="Orchestra Opcodes and Operators" /> <link rel="prev" href="moscil.html" title="moscil" /> <link rel="next" href="mp3len.html" title="mp3len" /> </head> <body> <div class="navheader"> <table width="100%" summary="Navigation header"> <tr> <th colspan="3" align="center">mp3in</th> </tr> <tr> <td width="20%" align="left"><a accesskey="p" href="moscil.html">Prev</a> </td> <th width="60%" align="center">Orchestra Opcodes and Operators</th> <td width="20%" align="right"> <a accesskey="n" href="mp3len.html">Next</a></td> </tr> </table> <hr /> </div> <div class="refentry"> <a id="mp3in"></a> <div class="titlepage"></div> <a id="IndexMp3in" class="indexterm"></a> <div class="refnamediv"> <h2> <span class="refentrytitle">mp3in</span> </h2> <p>mp3in — Reads mono or stereo audio data from an external MP3 file. </p> </div> <div class="refsect1"> <a id="idm281472912229128"></a> <h2>Description</h2> <p> Reads mono or stereo audio data from an external MP3 file. </p> </div> <div class="refsect1"> <a id="idm281472912155880"></a> <h2>Syntax</h2> <pre class="synopsis">ar1, ar2 <span class="command"><strong>mp3in</strong></span> ifilcod[, iskptim, iformat, iskipinit, ibufsize]</pre> <pre class="synopsis">ar1 <span class="command"><strong>mp3in</strong></span> ifilcod[, iskptim, iformat, iskipinit, ibufsize]</pre> </div> <div class="refsect1"> <a id="idm281472912152232"></a> <h2>Initialization</h2> <p> <span class="emphasis"><em>ifilcod</em></span> -- integer or character-string denoting the source soundfile name. An integer denotes the file soundin.filcod ; a character-string (in double quotes, spaces permitted) gives the filename itself, optionally a full pathname. If not a full path, the named file is sought first in the current directory, then in that given by the environment variable <a class="link" href="CommandEnvironment.html" title="Csound Environment Variables"><em class="citetitle">SSDIR</em></a> (if defined) then by <a class="link" href="CommandEnvironment.html" title="Csound Environment Variables"><em class="citetitle">SFDIR</em></a>. </p> <p> <span class="emphasis"><em>iskptim</em></span> (optional) -- time in seconds of input sound to be skipped. The default value is 0. </p> <p> <span class="emphasis"><em>iformat</em></span> (optional) -- specifies the audio data file format: currently not implemented and always defaults to stereo. </p> <p> <span class="emphasis"><em>iskipinit</em></span> (optional) -- switches off all initialisation if non zero (default =0). </p> <p> <span class="emphasis"><em>ibuffersize</em></span> (optional) -- sets the internal buffer size for reading. If the value is omitted, zero or negative it defaults to 4096 bytes. </p> </div> <div class="refsect1"> <a id="idm281472912144856"></a> <h2>Performance</h2> <p> Reads audio data from an external MP3 file. </p> </div> <div class="refsect1"> <a id="idm281472912143592"></a> <h2>Examples</h2> <p> Here is an example of the mp3in opcode. It uses the file <a class="ulink" href="examples/mp3in.csd" target="_top"><em class="citetitle">mp3in.csd</em></a>. </p> <div class="example"> <a id="idm281472912141736"></a> <p class="title"> <strong>Example 580. Example of the mp3in opcode.</strong> </p> <div class="example-contents"> <p>See the sections <a class="link" href="UsingRealTime.html" title="Real-Time Audio"><em class="citetitle">Real-time Audio</em></a> and <a class="link" href="CommandFlags.html" title="Csound command line"><em class="citetitle">Command Line Flags</em></a> for more information on using command line flags.</p> <div class="refsect1"> <a id="idm281472736356136"></a> <pre class="programlisting"> <span class="nt"><CsoundSynthesizer></span> <span class="nt"><CsOptions></span> <span class="c1">; Select audio/midi flags here according to platform</span> -odac <span class="c1">;;;realtime audio out</span> <span class="c1">;-iadc ;;;uncomment -iadc if realtime audio input is needed too</span> <span class="c1">; For Non-realtime ouput leave only the line below:</span> <span class="c1">; -o mp3in.wav -W ;;; for file output any platform</span> <span class="nt"></CsOptions></span> <span class="nt"><CsInstruments></span> <span class="vg">sr</span> <span class="o">=</span> <span class="mi">44100</span> <span class="vg">ksmps</span> <span class="o">=</span> <span class="mi">32</span> <span class="vg">nchnls</span> <span class="o">=</span> <span class="mi">2</span> <span class="vg">0dbfs</span> <span class="o">=</span> <span class="mi">1</span> <span class="kd">instr</span> <span class="nf">1</span> i<span class="n">skptim</span> <span class="o">=</span> <span class="mf">.3</span> i<span class="n">bufsize</span> <span class="o">=</span> <span class="mi">64</span> a<span class="n">r1</span><span class="p">,</span> a<span class="n">r2</span> <span class="nb">mp3in</span> <span class="s">"beats.mp3"</span><span class="p">,</span> i<span class="n">skptim</span><span class="p">,</span> <span class="mi">0</span><span class="p">,</span> <span class="mi">0</span><span class="p">,</span> i<span class="n">bufsize</span> <span class="nb">outs</span> a<span class="n">r1</span><span class="p">,</span> a<span class="n">r2</span> <span class="kd">endin</span> <span class="nt"></CsInstruments></span> <span class="nt"><CsScore></span> <span class="nb">i</span> <span class="mi">1</span> <span class="mi">0</span> <span class="mi">2</span> <span class="nb">e</span> <span class="nt"></CsScore></span> <span class="nt"></CsoundSynthesizer></span> </pre> </div> </div> </div> <p><br class="example-break" /> </p> </div> <div class="refsect1"> <a id="idm281472912137448"></a> <h2>See Also</h2> <p> <a class="link" href="diskin.html" title="diskin"><em class="citetitle">diskin</em></a>, <a class="link" href="ins.html" title="ins"><em class="citetitle">ins</em></a>, <a class="link" href="in.html" title="in"><em class="citetitle">in</em></a>, <a class="link" href="inch.html" title="inch"><em class="citetitle">inh</em></a>, <a class="link" href="inh.html" title="inh"><em class="citetitle">inh</em></a>, <a class="link" href="ino.html" title="ino"><em class="citetitle">ino</em></a>, <a class="link" href="inq.html" title="inq"><em class="citetitle">inq</em></a>, <a class="link" href="mp3len.html" title="mp3len"><em class="citetitle">mp3len</em></a>, <a class="link" href="soundin.html" title="soundin"><em class="citetitle">soundin</em></a> </p> </div> <div class="refsect1"> <a id="idm281472912128072"></a> <h2>Credits</h2> <p> </p> <table border="0" summary="Simple list" class="simplelist"> <tr> <td>Author: John ffitch</td> </tr> <tr> <td>Codemist Ltd</td> </tr> <tr> <td>2009</td> </tr> </table> <p> </p> <p>New in version 5.11</p> <p>Mono added in 6.05</p> </div> </div> <div class="navfooter"> <hr /> <table width="100%" summary="Navigation footer"> <tr> <td width="40%" align="left"><a accesskey="p" href="moscil.html">Prev</a> </td> <td width="20%" align="center"> <a accesskey="u" href="OpcodesTop.html">Up</a> </td> <td width="40%" align="right"> <a accesskey="n" href="mp3len.html">Next</a></td> </tr> <tr> <td width="40%" align="left" valign="top">moscil </td> <td width="20%" align="center"> <a accesskey="h" href="index.html">Home</a> </td> <td width="40%" align="right" valign="top"> mp3len</td> </tr> </table> </div> </body> </html>