<?xml version="1.0" encoding="UTF-8"?>
<rss version="2.0">
  <channel>
    <link>http://www.mathworks.com/matlabcentral/newsreader/view_thread/264251</link>
    <title>MATLAB Central Newsreader - Simulink: playing and recording audio at the same time</title>
    <description>Feed for thread: Simulink: playing and recording audio at the same time</description>
    <language>en-us</language>
    <copyright>&amp;copy;1994-2012 by MathWorks, Inc.</copyright>
    <webmaster>webmaster@mathworks.com</webmaster>
    <generator>MATLAB Central Newsreader</generator>
    <docs>http://blogs.law.harvard.edu/tech/rss</docs>
    <ttl>60</ttl>
    <image>
      <title>MathWorks</title>
      <url>http://www.mathworks.com/images/membrane_icon.gif</url>
    </image>
    <item>
      <pubDate>Tue, 27 Oct 2009 19:05:04 -0400</pubDate>
      <title>Simulink: playing and recording audio at the same time</title>
      <link>http://www.mathworks.com/matlabcentral/newsreader/view_thread/264251#690115</link>
      <author>Free </author>
      <description>Hi&lt;br&gt;
&lt;br&gt;
I setup a simple simulink circuit consisting of a sine wave generator, a speaker ('to audio device' - block), a microphone ('from audio device' - block) and a 'To workspace' - block. The purpose is to play the sinus trough my loudspeaker, recording it AT THE SAME TIME with my microphone and then write the recorded signal to the MATLAB workspace. This all goes well but when I plot the recorded signal in MATLAB I get alternating zero - sine wave - zero - sine wave - zero - and so on... This while I expect a continuous (noisy) sine wave...&lt;br&gt;
&lt;br&gt;
What could be the problem? I'm working under Linux. Maybe it is because of the linux scheduler which gives both tasks (play &amp; record) alternating some processor time. Has anybody a solution?&lt;br&gt;
&lt;br&gt;
Thanks </description>
    </item>
    <item>
      <pubDate>Tue, 03 Nov 2009 22:53:01 -0500</pubDate>
      <title>Re: Simulink: playing and recording audio at the same time</title>
      <link>http://www.mathworks.com/matlabcentral/newsreader/view_thread/264251#691871</link>
      <author>Free </author>
      <description>Finally I found the solution by myself after searching for more then a week. Matlab is using the open source library &quot;portaudio&quot; (&lt;a href=&quot;http://www.portaudio.com/)&quot;&gt;http://www.portaudio.com/)&lt;/a&gt; for the &quot;to/from audio devices&quot;. Originally this library is compiled for the linux &quot;open sound system&quot; (OSS) driver while I was using ALSA. So you have to download the source code for portaudio from the website, compile it and then copy the library into your matlab install directory (matlab_install_dir/bin/glnx86).&lt;br&gt;
&lt;br&gt;
Procedure:&lt;br&gt;
- Download and unpack portaudio source code&lt;br&gt;
- In portaudio dir type: &lt;br&gt;
./configure &amp;&amp; make&lt;br&gt;
make install&lt;br&gt;
(The driver you are using will automatically be found)&lt;br&gt;
- Copy libportaudio.so to matlab_install_dir/bin/glnx86</description>
    </item>
    <item>
      <pubDate>Tue, 03 Nov 2009 22:54:02 -0500</pubDate>
      <title>Re: Simulink: playing and recording audio at the same time</title>
      <link>http://www.mathworks.com/matlabcentral/newsreader/view_thread/264251#691872</link>
      <author>Free </author>
      <description>Finally I found the solution by myself after searching for more then a week. Matlab is using the open source library &quot;portaudio&quot; (&lt;a href=&quot;http://www.portaudio.com/)&quot;&gt;http://www.portaudio.com/)&lt;/a&gt; for the &quot;to/from audio devices&quot;. Originally this library is compiled for the linux &quot;open sound system&quot; (OSS) driver while I was using ALSA. So you have to download the source code for portaudio from the website, compile it and then copy the library into your matlab install directory (matlab_install_dir/bin/glnx86).&lt;br&gt;
&lt;br&gt;
Procedure:&lt;br&gt;
- Download and unpack portaudio source code&lt;br&gt;
- In portaudio dir type: &lt;br&gt;
./configure &amp;&amp; make&lt;br&gt;
make install&lt;br&gt;
(The driver you are using will automatically be found)&lt;br&gt;
- Copy libportaudio.so to matlab_install_dir/bin/glnx86</description>
    </item>
  </channel>
</rss>

