-
Notifications
You must be signed in to change notification settings - Fork 0
/
Copy pathaudiofile_simpleprocessor_8cpp-example.html
121 lines (119 loc) · 8.46 KB
/
audiofile_simpleprocessor_8cpp-example.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
87
88
89
90
91
92
93
94
95
96
97
98
99
100
101
102
103
104
105
106
107
108
109
110
111
112
113
114
115
116
117
118
119
120
121
<!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.0 Transitional//EN" "https://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/xhtml;charset=UTF-8"/>
<meta http-equiv="X-UA-Compatible" content="IE=11"/>
<meta name="generator" content="Doxygen 1.9.4"/>
<meta name="viewport" content="width=device-width, initial-scale=1"/>
<title>Audio Processing Framework (APF): audiofile_simpleprocessor.cpp</title>
<link href="tabs.css" rel="stylesheet" type="text/css"/>
<script type="text/javascript" src="jquery.js"></script>
<script type="text/javascript" src="dynsections.js"></script>
<link href="search/search.css" rel="stylesheet" type="text/css"/>
<script type="text/javascript" src="search/searchdata.js"></script>
<script type="text/javascript" src="search/search.js"></script>
<link href="doxygen.css" rel="stylesheet" type="text/css" />
</head>
<body>
<div id="top"><!-- do not remove this div, it is closed by doxygen! -->
<div id="titlearea">
<table cellspacing="0" cellpadding="0">
<tbody>
<tr id="projectrow">
<td id="projectalign">
<div id="projectname">Audio Processing Framework (APF)<span id="projectnumber"> version 0.5.0</span>
</div>
</td>
</tr>
</tbody>
</table>
</div>
<!-- end header part -->
<!-- Generated by Doxygen 1.9.4 -->
<script type="text/javascript">
/* @license magnet:?xt=urn:btih:d3d9a9a6595521f9666a5e94cc830dab83b65699&dn=expat.txt MIT */
var searchBox = new SearchBox("searchBox", "search",'Search','.html');
/* @license-end */
</script>
<script type="text/javascript" src="menudata.js"></script>
<script type="text/javascript" src="menu.js"></script>
<script type="text/javascript">
/* @license magnet:?xt=urn:btih:d3d9a9a6595521f9666a5e94cc830dab83b65699&dn=expat.txt MIT */
$(function() {
initMenu('',true,false,'search.php','Search');
$(document).ready(function() { init_search(); });
});
/* @license-end */
</script>
<div id="main-nav"></div>
</div><!-- top -->
<!-- window showing the filter options -->
<div id="MSearchSelectWindow"
onmouseover="return searchBox.OnSearchSelectShow()"
onmouseout="return searchBox.OnSearchSelectHide()"
onkeydown="return searchBox.OnSearchSelectKey(event)">
</div>
<!-- iframe showing the search results (closed by default) -->
<div id="MSearchResultsWindow">
<iframe src="javascript:void(0)" frameborder="0"
name="MSearchResults" id="MSearchResults">
</iframe>
</div>
<div class="header">
<div class="headertitle"><div class="title">audiofile_simpleprocessor.cpp</div></div>
</div><!--header-->
<div class="contents">
<div class="fragment"><div class="line"><span class="comment">// Usage example for the MimoProcessor reading from and writing to multichannel</span></div>
<div class="line"><span class="comment">// audio files.</span></div>
<div class="line"> </div>
<div class="line"><span class="preprocessor">#include "<a class="code" href="mimoprocessor__file__io_8h.html">apf/mimoprocessor_file_io.h</a>"</span></div>
<div class="line"> </div>
<div class="line"><span class="comment">// First the policy ...</span></div>
<div class="line"><span class="preprocessor">#include "<a class="code" href="pointer__policy_8h.html">apf/pointer_policy.h</a>"</span></div>
<div class="line"><span class="comment">// ... then the SimpleProcessor.</span></div>
<div class="line"><span class="preprocessor">#include "simpleprocessor.h"</span></div>
<div class="line"> </div>
<div class="line"><span class="keywordtype">int</span> main(<span class="keywordtype">int</span> argc, <span class="keywordtype">char</span> *argv[])</div>
<div class="line">{</div>
<div class="line"> <span class="keyword">const</span> <span class="keywordtype">size_t</span> blocksize = 65536;</div>
<div class="line"> </div>
<div class="line"> <span class="keywordflow">if</span> (argc < 4)</div>
<div class="line"> {</div>
<div class="line"> std::cerr << <span class="stringliteral">"Error: too few arguments!"</span> << std::endl;</div>
<div class="line"> std::cout << <span class="stringliteral">"Usage: "</span> << argv[0]</div>
<div class="line"> << <span class="stringliteral">" infilename outfilename outchannels [threads]"</span> << std::endl;</div>
<div class="line"> <span class="keywordflow">return</span> 42;</div>
<div class="line"> }</div>
<div class="line"> </div>
<div class="line"> std::string infilename = argv[1];</div>
<div class="line"> std::string outfilename = argv[2];</div>
<div class="line"> </div>
<div class="line"> <a id="_a0" name="_a0"></a><a class="code hl_struct" href="structapf_1_1parameter__map.html">apf::parameter_map</a> e;</div>
<div class="line"> <span class="keywordflow">if</span> (argc >= 5)</div>
<div class="line"> {</div>
<div class="line"> e.<a id="a1" name="a1"></a><a class="code hl_function" href="structapf_1_1parameter__map.html#ac39bab798ea261960ff55f4923035dee">set</a>(<span class="stringliteral">"threads"</span>, argv[4]);</div>
<div class="line"> }</div>
<div class="line"> </div>
<div class="line"> SndfileHandle in(infilename, SFM_READ);</div>
<div class="line"> e.<a class="code hl_function" href="structapf_1_1parameter__map.html#ac39bab798ea261960ff55f4923035dee">set</a>(<span class="stringliteral">"in_channels"</span>, in.channels());</div>
<div class="line"> e.<a class="code hl_function" href="structapf_1_1parameter__map.html#ac39bab798ea261960ff55f4923035dee">set</a>(<span class="stringliteral">"out_channels"</span>, apf::str::S2RV<int>(argv[3]));</div>
<div class="line"> </div>
<div class="line"> e.<a class="code hl_function" href="structapf_1_1parameter__map.html#ac39bab798ea261960ff55f4923035dee">set</a>(<span class="stringliteral">"block_size"</span>, blocksize);</div>
<div class="line"> e.<a class="code hl_function" href="structapf_1_1parameter__map.html#ac39bab798ea261960ff55f4923035dee">set</a>(<span class="stringliteral">"sample_rate"</span>, in.samplerate());</div>
<div class="line"> </div>
<div class="line"> SimpleProcessor engine(e);</div>
<div class="line"> </div>
<div class="line"> <span class="keywordflow">return</span> <a id="a2" name="a2"></a><a class="code hl_function" href="namespaceapf.html#aabb316c28fb7a641220e9f060f31c9ea">mimoprocessor_file_io</a>(engine, infilename , outfilename);</div>
<div class="line">}</div>
<div class="ttc" id="amimoprocessor__file__io_8h_html"><div class="ttname"><a href="mimoprocessor__file__io_8h.html">mimoprocessor_file_io.h</a></div><div class="ttdoc">Helper function for multichannel soundfile reading/writing.</div></div>
<div class="ttc" id="anamespaceapf_html_aabb316c28fb7a641220e9f060f31c9ea"><div class="ttname"><a href="namespaceapf.html#aabb316c28fb7a641220e9f060f31c9ea">apf::mimoprocessor_file_io</a></div><div class="ttdeci">int mimoprocessor_file_io(Processor &processor, const std::string &infilename, const std::string &outfilename)</div><div class="ttdoc">Use MimoProcessor-based object with multichannel audio file input and output.</div><div class="ttdef"><b>Definition:</b> <a href="mimoprocessor__file__io_8h_source.html#l00044">mimoprocessor_file_io.h:44</a></div></div>
<div class="ttc" id="apointer__policy_8h_html"><div class="ttname"><a href="pointer__policy_8h.html">pointer_policy.h</a></div><div class="ttdoc">C policy (= pointer based) for MimoProcessor's audio_interface.</div></div>
<div class="ttc" id="astructapf_1_1parameter__map_html"><div class="ttname"><a href="structapf_1_1parameter__map.html">apf::parameter_map</a></div><div class="ttdoc">A "dictionary" for parameters.</div><div class="ttdef"><b>Definition:</b> <a href="parameter__map_8h_source.html#l00067">parameter_map.h:68</a></div></div>
<div class="ttc" id="astructapf_1_1parameter__map_html_ac39bab798ea261960ff55f4923035dee"><div class="ttname"><a href="structapf_1_1parameter__map.html#ac39bab798ea261960ff55f4923035dee">apf::parameter_map::set</a></div><div class="ttdeci">const std::string & set(const std::string &k, const T &v)</div><div class="ttdoc">Set value.</div><div class="ttdef"><b>Definition:</b> <a href="parameter__map_8h_source.html#l00209">parameter_map.h:209</a></div></div>
</div><!-- fragment --> </div><!-- contents -->
<!-- start footer part -->
<hr class="footer"/><address class="footer"><small>
Generated by <a href="https://www.doxygen.org/index.html"><img class="footer" src="doxygen.svg" width="104" height="31" alt="doxygen"/></a> 1.9.4
</small></address>
</body>
</html>