-
Notifications
You must be signed in to change notification settings - Fork 0
/
compiling.html
87 lines (79 loc) · 10.8 KB
/
compiling.html
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
78
79
80
81
82
83
84
85
86
<?xml version="1.0" encoding="UTF-8"?>
<!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.0 Strict//EN" "http://www.w3.org/TR/xhtml1/DTD/xhtml1-strict.dtd">
<html xmlns="http://www.w3.org/1999/xhtml" xml:lang="en" lang="en">
<head>
<link rel="stylesheet" type="text/css" href="style/style.css" />
<title>Playrec - Getting Started</title>
<!--[if lt IE 9]>
<script src="//html5shiv.googlecode.com/svn/trunk/html5.js"></script>
<![endif]-->
</head>
<body>
<div id="container">
<div id="header">
<h1><a href="index.html">Playrec</a></h1>
<h2><a href="index.html">Multi-channel Matlab Audio</a></h2>
<div id="menu">
<ul id="navlist">
<li><a href="index.html">Home</a></li>
<li class="selected"><a href="compiling.html">Getting Started</a></li>
<li><a href="usage.html">Usage</a></li>
<li><a href="documentation.html">Documentation</a></li>
<li><a href="download.html">Download</a></li>
<li><a href="contact.html">Contact</a></li>
</ul>
</div>
</div>
<div id="content">
<h3>Getting Started</h3>
Before the playrec utility can be used it must first be compiled. This is not ideal but allows the utility to be used on as many platforms and with as many APIs as possible. Provided Matlab is installed, no other software needs to be purchased to achieve this on any platform, and when using Octave then no software needs to be purchased. The following steps try to cover all scenarios, but if you have any problems please <a href="contact.html">contact me</a>. After compiling, an overview of how to use Playrec is given in <a href="usage.html">usage</a> with the <a href="documentation.html">documentation</a> giving information on all available commands.
<ol>
<li>Download and unzip the latest version of the Playrec source and examples, available from the <a href="download.html">download section</a>.</li>
<li>Download and unzip the latest PortAudio v19 stable release files, available from the <a href="http://www.portaudio.com/download.html">download section</a> of the <a href="http://www.portaudio.com/">PortAudio</a> website. This can be unzipped anywhere, although unzipping into the 'playrec/lib' directory (created in step 1) should simplify compilation later.</li>
<li>If ASIO support is required and can be used on the target platform then the ASIO SDK needs to be downloaded and unzipped, available from the <a href="http://www.steinberg.net/en/company/developers.html">3rd Party Developer</a> section of the <a href="http://www.steinberg.net">Steinberg</a> website. This can be unzipped anywhere, although unzipping into the 'playrec/lib' directory (created in step 1) should simplify compilation later.</li>
<li>The steps now differ slightly for each platform: <a href="#windows">Windows</a>, <a href="#mac">Mac</a>, <a href="#linux">Linux</a>.</li>
</ol>
<h4 id="windows">Windows</h4>
The following steps are specific to compiling Playrec on Windows in either Matlab or Octave and continue on from the general steps above:
<ol>
<li value="5">To compile Playrec an external compiler with C++ support is required. This is easiest by installing the latest <a href="http://www.microsoft.com/en-us/download/details.aspx?id=8279">Microsoft Windows SDK</a> listed on the Matlab <a href="http://uk.mathworks.com/support/compilers/R2015a/index.html">Supported and Compatible Compilers</a> pages. It is not necessary to install the entire SDK, but the following options must be selected during the SDK installation process: 'Windows Headers and Libraries', 'Visual C++ Compilers' and '.NET Development'.<br />
<br />Matlab will need to be configured to use the external compiler, using the command <span class="code">mex -setup</span>. If this does not correctly detect the compiler then it can be configured manually by modifying the configuration file mexopts.bat. The base version of this file is in the preference directory (use <span class="code">prefdir</span> in Matlab to find where this is). Alternatively this base version can be overriden by placing a file with the same name in the current directory. An example of this file that seems to work with a number of Microsoft Visual C++ compilers and versions of Matlab can be downloaded from the <a href="download.html">download section</a>.<br />
<br />Octave may need to be configured to use the external compiler, depending on how the compiler was initially installed. The script <span class="code">configure_octave_mex</span> may be useful in doing this by supplying as arguments the path to the compiler install directory (eg 'C:\Program Files\Microsoft Visual Studio 8\VC') followed by the path to the Platform SDK (see later).</li>
<li>If DirectSound support is required then the DirectX SDK is required. This used to be a separate download from the <a href="http://msdn.microsoft.com/">Microsoft MSDN</a> website, but is now included in the Windows SDK described above. When specifying the Direct Sound directory as part of the Playrec compilation process (see below), you will need to specify the installation path for the SDK (eg 'C:\Program Files\Microsoft SDKs\Windows\v7.1').</li>
<li>If WASAPI support is required then this will also require the Microsoft Windows SDK installed, as described above.</li>
<li>Open Matlab or Octave and set the current directory to that of the playrec directory created in step 1.</li>
<li>Run <span class="code">compile_playrec</span> and select the required APIs to use. In Octave the default value is given in square brackets. Where possible the required paths will have been automatically completed with paths to the relevant files (eg the PortAudio path to the path where the PortAudio files were unzipped). Where this has not happened the paths need to be completed manually. Depending on the configuration in mexopts.bat there may not be a need to specify a Platform SDK path so initially try without. If it is required then it will need to be something like 'C:\Program Files\Microsoft SDKs\Windows\v6.0' or 'C:\Program Files\Microsoft Visual Studio 8\VC\PlatformSDK'.</li>
<li>In Matlab click Compile to start compilation, in Octave compilation will start after the final prompt has been answered. If verbose was selected then the output from the compiler will be displayed in the Command Window.<br />
<br />If all is successful then there should be a file called playrec.dll, playrec.mexw32, playrec.mexw64 or playrec.mex in the current directory - this is the MEX file for the utility. As with '.m' files, this must be either in the current directory or a directory in the path list to be able to use it. To check the file has been compiled correctly type <span class="code">playrec('about')</span> to view information on the utility, or run test_playrec (available as part of the <a href="download.html#playrec_scripts">playrec scripts</a> download) to try outputting sound. If either works then everything should have built correctly. Please <a href="contact.html">contact me</a> if you are having any problems.</li>
</ol>
<h4 id="mac">Mac</h4>
The following steps are specific to compiling Playrec on Macs and continue on from the general steps above. Playrec has not been tested using Octave on Macs, so please <a href="contact.html">let me know</a> if you have tried this.
<ol>
<li value="5">Open Matlab and set the current directory to that of the playrec directory created in step 1.</li>
<li>To compile Playrec an external compiler with C++ support is required. Using the command <span class="code">mex -setup</span> select the gcc compiler, installed as part of Apple's developer tools.</li>
<li>Run <span class="code">compile_playrec</span> and select the required APIs to use. Where possible the text boxes will have been automatically completed with paths to the relevant files (eg the PortAudio text box to the path where the PortAudio files were unzipped). Where this has not happened the paths need to be completed manually.</li>
<li>Choose the required options using the checkboxes and then click compile. If verbose was selected then the output from the compiler will be displayed in the Matlab Command Window.<br />
<br />If all is successful then there should be a file called playrec.mexmac or playrec.mexmaci in the current directory - this is the MEX file for the utility. As with '.m' files, this must be either in the current directory or a directory in the path list to be able to use it. To check the file has been compiled correctly type <span class="code">playrec('about')</span> to view information on the utility, or run test_playrec (available as part of the <a href="download.html#playrec_scripts">playrec scripts</a> download) to try outputting sound. If either works then everything should have built correctly. Please <a href="contact.html">contact me</a> if you are having any problems.</li>
</ol>
<h4 id="linux">Linux</h4>
At the moment Playrec has only had limited testing on Linux, although it has successfully been used in both Matlab and Octave by following similar steps to those for <a href="#mac">Macs</a>. Using Octave on Ubuntu:
<ol>
<li value="5">To be able to compile Playrec in Octave on Ubuntu will require the liboctave-dev package to be installed. This is not installed by default when installing the octave package.</li>
<li>Each of the APIs that you want to use requires other packages to also be installed. For example, to use ALSA then the package libasound2-dev will also need to be installed.</li>
<li>Open Octave and set the current directory to that of the playrec directory created in step 1.</li>
<li>Run <span class="code">compile_playrec</span> and select the required APIs to use. Selecting just the ALSA API, having already installed the required package as described above, should provide suitable access to all sound cards.<br />
<br />If all is successful then there should be a file called playrec.mex in the current directory - this is the MEX file for the utility. As with '.m' files, this must be either in the current directory or a directory in the path list to be able to use it. To check the file has been compiled correctly type <span class="code">playrec('about')</span> to view information on the utility, or run test_playrec (available as part of the <a href="download.html#playrec_scripts">playrec scripts</a> download) to try outputting sound. If either works then everything should have built correctly. Please <a href="contact.html">contact me</a> if you are having any problems.</li>
</ol>
</div><div id="footer"><div id="copy">© 2008-2015 Robert Humphrey</div><a href="license.html">Software License</a></div></div>
<script src="javascripts/scale.fix.js"></script>
<script type="text/javascript">
var gaJsHost = (("https:" == document.location.protocol) ? "https://ssl." : "http://www.");
document.write(unescape("%3Cscript src='" + gaJsHost + "google-analytics.com/ga.js' type='text/javascript'%3E%3C/script%3E"));
</script>
<script type="text/javascript">
try {
var pageTracker = _gat._getTracker("UA-3319302-1");
pageTracker._trackPageview();
} catch(err) {}
</script>
</body></html>