Open skrowten-hermit opened 4 years ago
stereoPool.value<vector<StereoSample>>("audio")
gives you a vector
object and, as the error is telling you,
left()
is not a member method of the vector
class. You can apply left()
to the StereoSample
objects contained in the vector. For instance, if you want to print the left channel of the first sample you could do stereoPool.value<vector<StereoSample>>("audio")[0].left()
.
However, if you want to get the channels as independent arrays I'd rather use a couple of MonoMixer connected to the AudioLoader
to do so.
Thanks @pabloEntropia for the inputs, I was able to extract the channel data separately as follows:
cout << "-------- Start Audio Data --------" << endl;
//vector<Real> audioBuffer = stereoPool.value<vector<StereoSample>>("audio");
if (noofchannels == 2)
{
cout << "Channel 0 :" << endl;
for(int i = 0; i < stereoPool.value<vector<StereoSample>>("audio").size(); ++i)
{
cout << stereoPool.value<vector<StereoSample>>("audio")[i].left() << ", ";
}
cout << endl << "Channel 1 :" << endl;
for(int i = 0; i < stereoPool.value<vector<StereoSample>>("audio").size(); ++i)
{
cout << stereoPool.value<vector<StereoSample>>("audio")[i].right() << ", ";
}
cout << endl;
}
else
{
cout << "Audio Data (Only 1 channel --> Left) :" << endl;
for(int i = 0; i < stereoPool.value<vector<StereoSample>>("audio").size(); ++i)
{
cout << stereoPool.value<vector<StereoSample>>("audio")[i].left() << ", ";
}
cout << endl;
}
But when I tried MonoMixer
as below:
standard::Algorithm* mono = standard::AlgorithmFactory::create("MonoMixer",
"type", "left");
mono->input(stereoPool.value<vector<StereoSample>>("audio")).set(monoPool);
mono->compute();
mono->output("audio") >> PC(monoPool, "monoaudio");
cout << "Mono Audio Data:\n" << monoPool.value<vector<Real>>("monoaudio") << endl;
I get the errors:
streamingstereoloader.cpp: In function ‘int main(int, char**)’:
streamingstereoloader.cpp:89:22: warning: comparison between signed and unsigned integer expressions [-Wsign-compare]
for(int i = 0; i < stereoPool.value<vector<StereoSample>>("audio").size(); ++i)
~~^~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
streamingstereoloader.cpp:95:22: warning: comparison between signed and unsigned integer expressions [-Wsign-compare]
for(int i = 0; i < stereoPool.value<vector<StereoSample>>("audio").size(); ++i)
~~^~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
streamingstereoloader.cpp:104:22: warning: comparison between signed and unsigned integer expressions [-Wsign-compare]
for(int i = 0; i < stereoPool.value<vector<StereoSample>>("audio").size(); ++i)
~~^~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
streamingstereoloader.cpp:121:62: error: no matching function for call to ‘essentia::standard::Algorithm::input(const std::vector<essentia::Tuple2<float> >&)’
mono->input(stereoPool.value<vector<StereoSample>>("audio")).set(monoPool);
^
In file included from /usr/local/include/essentia/algorithmfactory.h:261:0,
from streamingstereoloader.cpp:24:
/usr/local/include/essentia/algorithm.h:55:14: note: candidate: essentia::standard::InputBase& essentia::standard::Algorithm::input(const string&)
InputBase& input(const std::string& name);
^~~~~
/usr/local/include/essentia/algorithm.h:55:14: note: no known conversion for argument 1 from ‘const std::vector<essentia::Tuple2<float> >’ to ‘const string& {aka const std::__cxx11::basic_string<char>&}’
streamingstereoloader.cpp:123:25: error: no match for ‘operator>>’ (operand types are ‘essentia::standard::OutputBase’ and ‘essentia::streaming::PoolConnector’)
mono->output("audio") >> PC(monoPool, "monoaudio");
~~~~~~~~~~~~~~~~~~~~~~^~~~~~~~~~~~~~~~~~~~~~~~~~~~
In file included from /usr/local/include/essentia/algorithmfactory.h:262:0,
from streamingstereoloader.cpp:24:
/usr/local/include/essentia/streaming/streamingalgorithm.h:48:13: note: candidate: void essentia::streaming::operator>>(essentia::streaming::SourceBase&, essentia::streaming::SinkBase&)
inline void operator>>(SourceBase& source, SinkBase& sink) {
^~~~~~~~
/usr/local/include/essentia/streaming/streamingalgorithm.h:48:13: note: no known conversion for argument 1 from ‘essentia::standard::OutputBase’ to ‘essentia::streaming::SourceBase&’
In file included from /usr/local/include/essentia/streaming/sink.h:24:0,
from /usr/local/include/essentia/streaming/streamingalgorithm.h:272,
from /usr/local/include/essentia/algorithmfactory.h:262,
from streamingstereoloader.cpp:24:
/usr/local/include/essentia/streaming/sinkproxy.h:253:13: note: candidate: void essentia::streaming::operator>>(essentia::streaming::SinkProxyBase&, essentia::streaming::SinkBase&)
inline void operator>>(SinkProxyBase& proxy, SinkBase& innerSink) {
^~~~~~~~
/usr/local/include/essentia/streaming/sinkproxy.h:253:13: note: no known conversion for argument 1 from ‘essentia::standard::OutputBase’ to ‘essentia::streaming::SinkProxyBase&’
In file included from /usr/local/include/essentia/streaming/streamingalgorithm.h:276:0,
from /usr/local/include/essentia/algorithmfactory.h:262,
from streamingstereoloader.cpp:24:
/usr/local/include/essentia/streaming/algorithms/devnull.h:81:13: note: candidate: void essentia::streaming::operator>>(essentia::streaming::SourceBase&, essentia::streaming::DevNullConnector)
inline void operator>>(SourceBase& source, DevNullConnector devnull) {
^~~~~~~~
/usr/local/include/essentia/streaming/algorithms/devnull.h:81:13: note: no known conversion for argument 1 from ‘essentia::standard::OutputBase’ to ‘essentia::streaming::SourceBase&’
In file included from streamingstereoloader.cpp:25:0:
/usr/local/include/essentia/streaming/algorithms/poolstorage.h:168:13: note: candidate: void essentia::streaming::operator>>(essentia::streaming::SourceBase&, const essentia::streaming::PoolConnector&)
inline void operator>>(SourceBase& source, const PoolConnector& pc) {
^~~~~~~~
/usr/local/include/essentia/streaming/algorithms/poolstorage.h:168:13: note: no known conversion for argument 1 from ‘essentia::standard::OutputBase’ to ‘essentia::streaming::SourceBase&’
In file included from /usr/include/c++/7/random:51:0,
from /usr/include/eigen3/unsupported/Eigen/CXX11/Tensor:62,
from /usr/local/include/essentia/types.h:33,
from /usr/local/include/essentia/algorithmfactory.h:26,
from streamingstereoloader.cpp:24:
/usr/include/c++/7/bits/random.tcc:3192:5: note: candidate: template<class _RealType, class _CharT, class _Traits> std::basic_istream<_CharT, _Traits>& std::operator>>(std::basic_istream<_CharT, _Traits>&, std::piecewise_linear_distribution<_RealType>&)
operator>>(std::basic_istream<_CharT, _Traits>& __is,
^~~~~~~~
/usr/include/c++/7/bits/random.tcc:3192:5: note: template argument deduction/substitution failed:
streamingstereoloader.cpp:123:52: note: ‘essentia::standard::OutputBase’ is not derived from ‘std::basic_istream<_CharT, _Traits>’
mono->output("audio") >> PC(monoPool, "monoaudio");
^
In file included from /usr/include/c++/7/random:51:0,
from /usr/include/eigen3/unsupported/Eigen/CXX11/Tensor:62,
from /usr/local/include/essentia/types.h:33,
from /usr/local/include/essentia/algorithmfactory.h:26,
from streamingstereoloader.cpp:24:
/usr/include/c++/7/bits/random.tcc:2976:5: note: candidate: template<class _RealType, class _CharT, class _Traits> std::basic_istream<_CharT, _Traits>& std::operator>>(std::basic_istream<_CharT, _Traits>&, std::piecewise_constant_distribution<_RealType>&)
operator>>(std::basic_istream<_CharT, _Traits>& __is,
^~~~~~~~
/usr/include/c++/7/bits/random.tcc:2976:5: note: template argument deduction/substitution failed:
streamingstereoloader.cpp:123:52: note: ‘essentia::standard::OutputBase’ is not derived from ‘std::basic_istream<_CharT, _Traits>’
mono->output("audio") >> PC(monoPool, "monoaudio");
^
In file included from /usr/include/c++/7/random:51:0,
from /usr/include/eigen3/unsupported/Eigen/CXX11/Tensor:62,
from /usr/local/include/essentia/types.h:33,
from /usr/local/include/essentia/algorithmfactory.h:26,
from streamingstereoloader.cpp:24:
/usr/include/c++/7/bits/random.tcc:2761:5: note: candidate: template<class _IntType, class _CharT, class _Traits> std::basic_istream<_CharT, _Traits>& std::operator>>(std::basic_istream<_CharT, _Traits>&, std::discrete_distribution<_IntType>&)
operator>>(std::basic_istream<_CharT, _Traits>& __is,
^~~~~~~~
/usr/include/c++/7/bits/random.tcc:2761:5: note: template argument deduction/substitution failed:
streamingstereoloader.cpp:123:52: note: ‘essentia::standard::OutputBase’ is not derived from ‘std::basic_istream<_CharT, _Traits>’
mono->output("audio") >> PC(monoPool, "monoaudio");
^
In file included from /usr/include/c++/7/random:51:0,
from /usr/include/eigen3/unsupported/Eigen/CXX11/Tensor:62,
from /usr/local/include/essentia/types.h:33,
from /usr/local/include/essentia/algorithmfactory.h:26,
from streamingstereoloader.cpp:24:
/usr/include/c++/7/bits/random.tcc:2299:5: note: candidate: template<class _RealType, class _CharT, class _Traits> std::basic_istream<_CharT, _Traits>& std::operator>>(std::basic_istream<_CharT, _Traits>&, std::student_t_distribution<_RealType>&)
operator>>(std::basic_istream<_CharT, _Traits>& __is,
^~~~~~~~
/usr/include/c++/7/bits/random.tcc:2299:5: note: template argument deduction/substitution failed:
streamingstereoloader.cpp:123:52: note: ‘essentia::standard::OutputBase’ is not derived from ‘std::basic_istream<_CharT, _Traits>’
mono->output("audio") >> PC(monoPool, "monoaudio");
^
In file included from /usr/include/c++/7/random:51:0,
from /usr/include/eigen3/unsupported/Eigen/CXX11/Tensor:62,
from /usr/local/include/essentia/types.h:33,
from /usr/local/include/essentia/algorithmfactory.h:26,
from streamingstereoloader.cpp:24:
/usr/include/c++/7/bits/random.tcc:2225:5: note: candidate: template<class _RealType, class _CharT, class _Traits> std::basic_istream<_CharT, _Traits>& std::operator>>(std::basic_istream<_CharT, _Traits>&, std::fisher_f_distribution<_RealType>&)
operator>>(std::basic_istream<_CharT, _Traits>& __is,
^~~~~~~~
/usr/include/c++/7/bits/random.tcc:2225:5: note: template argument deduction/substitution failed:
streamingstereoloader.cpp:123:52: note: ‘essentia::standard::OutputBase’ is not derived from ‘std::basic_istream<_CharT, _Traits>’
mono->output("audio") >> PC(monoPool, "monoaudio");
^
In file included from /usr/include/c++/7/random:51:0,
from /usr/include/eigen3/unsupported/Eigen/CXX11/Tensor:62,
from /usr/local/include/essentia/types.h:33,
from /usr/local/include/essentia/algorithmfactory.h:26,
from streamingstereoloader.cpp:24:
/usr/include/c++/7/bits/random.tcc:2060:5: note: candidate: template<class _RealType, class _CharT, class _Traits> std::basic_istream<_CharT, _Traits>& std::operator>>(std::basic_istream<_CharT, _Traits>&, std::chi_squared_distribution<_RealType>&)
operator>>(std::basic_istream<_CharT, _Traits>& __is,
^~~~~~~~
/usr/include/c++/7/bits/random.tcc:2060:5: note: template argument deduction/substitution failed:
streamingstereoloader.cpp:123:52: note: ‘essentia::standard::OutputBase’ is not derived from ‘std::basic_istream<_CharT, _Traits>’
mono->output("audio") >> PC(monoPool, "monoaudio");
^
In file included from /usr/include/c++/7/random:51:0,
from /usr/include/eigen3/unsupported/Eigen/CXX11/Tensor:62,
from /usr/local/include/essentia/types.h:33,
from /usr/local/include/essentia/algorithmfactory.h:26,
from streamingstereoloader.cpp:24:
/usr/include/c++/7/bits/random.tcc:1988:5: note: candidate: template<class _RealType, class _CharT, class _Traits> std::basic_istream<_CharT, _Traits>& std::operator>>(std::basic_istream<_CharT, _Traits>&, std::lognormal_distribution<_RealType>&)
operator>>(std::basic_istream<_CharT, _Traits>& __is,
^~~~~~~~
/usr/include/c++/7/bits/random.tcc:1988:5: note: template argument deduction/substitution failed:
streamingstereoloader.cpp:123:52: note: ‘essentia::standard::OutputBase’ is not derived from ‘std::basic_istream<_CharT, _Traits>’
mono->output("audio") >> PC(monoPool, "monoaudio");
^
In file included from /usr/include/c++/7/random:51:0,
from /usr/include/eigen3/unsupported/Eigen/CXX11/Tensor:62,
from /usr/local/include/essentia/types.h:33,
from /usr/local/include/essentia/algorithmfactory.h:26,
from streamingstereoloader.cpp:24:
/usr/include/c++/7/bits/random.tcc:1693:5: note: candidate: template<class _IntType, class _CharT, class _Traits> std::basic_istream<_CharT, _Traits>& std::operator>>(std::basic_istream<_CharT, _Traits>&, std::binomial_distribution<_IntType>&)
operator>>(std::basic_istream<_CharT, _Traits>& __is,
^~~~~~~~
/usr/include/c++/7/bits/random.tcc:1693:5: note: template argument deduction/substitution failed:
streamingstereoloader.cpp:123:52: note: ‘essentia::standard::OutputBase’ is not derived from ‘std::basic_istream<_CharT, _Traits>’
mono->output("audio") >> PC(monoPool, "monoaudio");
^
In file included from /usr/include/c++/7/random:51:0,
from /usr/include/eigen3/unsupported/Eigen/CXX11/Tensor:62,
from /usr/local/include/essentia/types.h:33,
from /usr/local/include/essentia/algorithmfactory.h:26,
from streamingstereoloader.cpp:24:
/usr/include/c++/7/bits/random.tcc:1425:5: note: candidate: template<class _IntType, class _CharT, class _Traits> std::basic_istream<_CharT, _Traits>& std::operator>>(std::basic_istream<_CharT, _Traits>&, std::poisson_distribution<_IntType>&)
operator>>(std::basic_istream<_CharT, _Traits>& __is,
^~~~~~~~
/usr/include/c++/7/bits/random.tcc:1425:5: note: template argument deduction/substitution failed:
streamingstereoloader.cpp:123:52: note: ‘essentia::standard::OutputBase’ is not derived from ‘std::basic_istream<_CharT, _Traits>’
mono->output("audio") >> PC(monoPool, "monoaudio");
^
In file included from /usr/include/c++/7/random:51:0,
from /usr/include/eigen3/unsupported/Eigen/CXX11/Tensor:62,
from /usr/local/include/essentia/types.h:33,
from /usr/local/include/essentia/algorithmfactory.h:26,
from streamingstereoloader.cpp:24:
/usr/include/c++/7/bits/random.tcc:1220:5: note: candidate: template<class _IntType, class _CharT, class _Traits> std::basic_istream<_CharT, _Traits>& std::operator>>(std::basic_istream<_CharT, _Traits>&, std::negative_binomial_distribution<_IntType>&)
operator>>(std::basic_istream<_CharT, _Traits>& __is,
^~~~~~~~
/usr/include/c++/7/bits/random.tcc:1220:5: note: template argument deduction/substitution failed:
streamingstereoloader.cpp:123:52: note: ‘essentia::standard::OutputBase’ is not derived from ‘std::basic_istream<_CharT, _Traits>’
mono->output("audio") >> PC(monoPool, "monoaudio");
^
In file included from /usr/include/c++/7/random:51:0,
from /usr/include/eigen3/unsupported/Eigen/CXX11/Tensor:62,
from /usr/local/include/essentia/types.h:33,
from /usr/local/include/essentia/algorithmfactory.h:26,
from streamingstereoloader.cpp:24:
/usr/include/c++/7/bits/random.tcc:856:5: note: candidate: template<class _RandomNumberEngine, long unsigned int __k, class _CharT, class _Traits> std::basic_istream<_CharT, _Traits>& std::operator>>(std::basic_istream<_CharT, _Traits>&, std::shuffle_order_engine<_RandomNumberEngine, __k>&)
operator>>(std::basic_istream<_CharT, _Traits>& __is,
^~~~~~~~
/usr/include/c++/7/bits/random.tcc:856:5: note: template argument deduction/substitution failed:
streamingstereoloader.cpp:123:52: note: ‘essentia::standard::OutputBase’ is not derived from ‘std::basic_istream<_CharT, _Traits>’
mono->output("audio") >> PC(monoPool, "monoaudio");
^
In file included from /usr/include/c++/7/random:51:0,
from /usr/include/eigen3/unsupported/Eigen/CXX11/Tensor:62,
from /usr/local/include/essentia/types.h:33,
from /usr/local/include/essentia/algorithmfactory.h:26,
from streamingstereoloader.cpp:24:
/usr/include/c++/7/bits/random.tcc:725:5: note: candidate: template<class _RandomNumberEngine, long unsigned int __p, long unsigned int __r, class _CharT, class _Traits> std::basic_istream<_CharT, _Traits>& std::operator>>(std::basic_istream<_CharT, _Traits>&, std::discard_block_engine<_RandomNumberEngine, __p, __r>&)
operator>>(std::basic_istream<_CharT, _Traits>& __is,
^~~~~~~~
/usr/include/c++/7/bits/random.tcc:725:5: note: template argument deduction/substitution failed:
streamingstereoloader.cpp:123:52: note: ‘essentia::standard::OutputBase’ is not derived from ‘std::basic_istream<_CharT, _Traits>’
mono->output("audio") >> PC(monoPool, "monoaudio");
^
In file included from /usr/include/c++/7/random:51:0,
from /usr/include/eigen3/unsupported/Eigen/CXX11/Tensor:62,
from /usr/local/include/essentia/types.h:33,
from /usr/local/include/essentia/algorithmfactory.h:26,
from streamingstereoloader.cpp:24:
/usr/include/c++/7/bits/random.tcc:657:5: note: candidate: template<class _UIntType, long unsigned int __w, long unsigned int __s, long unsigned int __r, class _CharT, class _Traits> std::basic_istream<_CharT, _Traits>& std::operator>>(std::basic_istream<_CharT, _Traits>&, std::subtract_with_carry_engine<_UIntType, __w, __s, __r>&)
operator>>(std::basic_istream<_CharT, _Traits>& __is,
^~~~~~~~
/usr/include/c++/7/bits/random.tcc:657:5: note: template argument deduction/substitution failed:
streamingstereoloader.cpp:123:52: note: ‘essentia::standard::OutputBase’ is not derived from ‘std::basic_istream<_CharT, _Traits>’
mono->output("audio") >> PC(monoPool, "monoaudio");
^
In file included from /usr/include/c++/7/random:51:0,
from /usr/include/eigen3/unsupported/Eigen/CXX11/Tensor:62,
from /usr/local/include/essentia/types.h:33,
from /usr/local/include/essentia/algorithmfactory.h:26,
from streamingstereoloader.cpp:24:
/usr/include/c++/7/bits/random.tcc:178:5: note: candidate: template<class _UIntType, _UIntType __a, _UIntType __c, _UIntType __m, class _CharT, class _Traits> std::basic_istream<_CharT, _Traits>& std::operator>>(std::basic_istream<_CharT, _Traits>&, std::linear_congruential_engine<_UIntType, __a, __c, __m>&)
operator>>(std::basic_istream<_CharT, _Traits>& __is,
^~~~~~~~
/usr/include/c++/7/bits/random.tcc:178:5: note: template argument deduction/substitution failed:
streamingstereoloader.cpp:123:52: note: ‘essentia::standard::OutputBase’ is not derived from ‘std::basic_istream<_CharT, _Traits>’
mono->output("audio") >> PC(monoPool, "monoaudio");
^
In file included from /usr/include/c++/7/random:51:0,
from /usr/include/eigen3/unsupported/Eigen/CXX11/Tensor:62,
from /usr/local/include/essentia/types.h:33,
from /usr/local/include/essentia/algorithmfactory.h:26,
from streamingstereoloader.cpp:24:
/usr/include/c++/7/bits/random.tcc:2622:5: note: candidate: template<class _RealType, class _CharT, class _Traits> std::basic_istream<_CharT, _Traits>& std::operator>>(std::basic_istream<_CharT, _Traits>&, std::extreme_value_distribution<_RealType>&)
operator>>(std::basic_istream<_CharT, _Traits>& __is,
^~~~~~~~
/usr/include/c++/7/bits/random.tcc:2622:5: note: template argument deduction/substitution failed:
streamingstereoloader.cpp:123:52: note: ‘essentia::standard::OutputBase’ is not derived from ‘std::basic_istream<_CharT, _Traits>’
mono->output("audio") >> PC(monoPool, "monoaudio");
^
In file included from /usr/include/c++/7/random:51:0,
from /usr/include/eigen3/unsupported/Eigen/CXX11/Tensor:62,
from /usr/local/include/essentia/types.h:33,
from /usr/local/include/essentia/algorithmfactory.h:26,
from streamingstereoloader.cpp:24:
/usr/include/c++/7/bits/random.tcc:2546:5: note: candidate: template<class _RealType, class _CharT, class _Traits> std::basic_istream<_CharT, _Traits>& std::operator>>(std::basic_istream<_CharT, _Traits>&, std::weibull_distribution<_RealType>&)
operator>>(std::basic_istream<_CharT, _Traits>& __is,
^~~~~~~~
/usr/include/c++/7/bits/random.tcc:2546:5: note: template argument deduction/substitution failed:
streamingstereoloader.cpp:123:52: note: ‘essentia::standard::OutputBase’ is not derived from ‘std::basic_istream<_CharT, _Traits>’
mono->output("audio") >> PC(monoPool, "monoaudio");
^
In file included from /usr/include/c++/7/random:51:0,
from /usr/include/eigen3/unsupported/Eigen/CXX11/Tensor:62,
from /usr/local/include/essentia/types.h:33,
from /usr/local/include/essentia/algorithmfactory.h:26,
from streamingstereoloader.cpp:24:
/usr/include/c++/7/bits/random.tcc:1754:5: note: candidate: template<class _RealType, class _CharT, class _Traits> std::basic_istream<_CharT, _Traits>& std::operator>>(std::basic_istream<_CharT, _Traits>&, std::exponential_distribution<_RealType>&)
operator>>(std::basic_istream<_CharT, _Traits>& __is,
^~~~~~~~
/usr/include/c++/7/bits/random.tcc:1754:5: note: template argument deduction/substitution failed:
streamingstereoloader.cpp:123:52: note: ‘essentia::standard::OutputBase’ is not derived from ‘std::basic_istream<_CharT, _Traits>’
mono->output("audio") >> PC(monoPool, "monoaudio");
^
In file included from /usr/include/c++/7/random:51:0,
from /usr/include/eigen3/unsupported/Eigen/CXX11/Tensor:62,
from /usr/local/include/essentia/types.h:33,
from /usr/local/include/essentia/algorithmfactory.h:26,
from streamingstereoloader.cpp:24:
/usr/include/c++/7/bits/random.tcc:2469:5: note: candidate: template<class _RealType1, class _CharT, class _Traits> std::basic_istream<_CharT, _Traits>& std::operator>>(std::basic_istream<_CharT, _Traits>&, std::gamma_distribution<_RealType>&)
operator>>(std::basic_istream<_CharT, _Traits>& __is,
^~~~~~~~
/usr/include/c++/7/bits/random.tcc:2469:5: note: template argument deduction/substitution failed:
streamingstereoloader.cpp:123:52: note: ‘essentia::standard::OutputBase’ is not derived from ‘std::basic_istream<_CharT, _Traits>’
mono->output("audio") >> PC(monoPool, "monoaudio");
^
In file included from /usr/include/c++/7/random:51:0,
from /usr/include/eigen3/unsupported/Eigen/CXX11/Tensor:62,
from /usr/local/include/essentia/types.h:33,
from /usr/local/include/essentia/algorithmfactory.h:26,
from streamingstereoloader.cpp:24:
/usr/include/c++/7/bits/random.tcc:1104:5: note: candidate: template<class _IntType, class _CharT, class _Traits> std::basic_istream<_CharT, _Traits>& std::operator>>(std::basic_istream<_CharT, _Traits>&, std::geometric_distribution<_IntType>&)
operator>>(std::basic_istream<_CharT, _Traits>& __is,
^~~~~~~~
/usr/include/c++/7/bits/random.tcc:1104:5: note: template argument deduction/substitution failed:
streamingstereoloader.cpp:123:52: note: ‘essentia::standard::OutputBase’ is not derived from ‘std::basic_istream<_CharT, _Traits>’
mono->output("audio") >> PC(monoPool, "monoaudio");
^
In file included from /usr/include/c++/7/random:51:0,
from /usr/include/eigen3/unsupported/Eigen/CXX11/Tensor:62,
from /usr/local/include/essentia/types.h:33,
from /usr/local/include/essentia/algorithmfactory.h:26,
from streamingstereoloader.cpp:24:
/usr/include/c++/7/bits/random.tcc:1925:5: note: candidate: template<class _RealType1, class _CharT, class _Traits> std::basic_istream<_CharT, _Traits>& std::operator>>(std::basic_istream<_CharT, _Traits>&, std::normal_distribution<_RealType>&)
operator>>(std::basic_istream<_CharT, _Traits>& __is,
^~~~~~~~
/usr/include/c++/7/bits/random.tcc:1925:5: note: template argument deduction/substitution failed:
streamingstereoloader.cpp:123:52: note: ‘essentia::standard::OutputBase’ is not derived from ‘std::basic_istream<_CharT, _Traits>’
mono->output("audio") >> PC(monoPool, "monoaudio");
^
In file included from /usr/include/c++/7/random:49:0,
from /usr/include/eigen3/unsupported/Eigen/CXX11/Tensor:62,
from /usr/local/include/essentia/types.h:33,
from /usr/local/include/essentia/algorithmfactory.h:26,
from streamingstereoloader.cpp:24:
/usr/include/c++/7/bits/random.h:3644:5: note: candidate: template<class _CharT, class _Traits> std::basic_istream<_CharT, _Traits>& std::operator>>(std::basic_istream<_CharT, _Traits>&, std::bernoulli_distribution&)
operator>>(std::basic_istream<_CharT, _Traits>& __is,
^~~~~~~~
/usr/include/c++/7/bits/random.h:3644:5: note: template argument deduction/substitution failed:
streamingstereoloader.cpp:123:52: note: ‘essentia::standard::OutputBase’ is not derived from ‘std::basic_istream<_CharT, _Traits>’
mono->output("audio") >> PC(monoPool, "monoaudio");
^
In file included from /usr/include/c++/7/random:51:0,
from /usr/include/eigen3/unsupported/Eigen/CXX11/Tensor:62,
from /usr/local/include/essentia/types.h:33,
from /usr/local/include/essentia/algorithmfactory.h:26,
from streamingstereoloader.cpp:24:
/usr/include/c++/7/bits/random.tcc:2147:5: note: candidate: template<class _RealType, class _CharT, class _Traits> std::basic_istream<_CharT, _Traits>& std::operator>>(std::basic_istream<_CharT, _Traits>&, std::cauchy_distribution<_RealType>&)
operator>>(std::basic_istream<_CharT, _Traits>& __is,
^~~~~~~~
/usr/include/c++/7/bits/random.tcc:2147:5: note: template argument deduction/substitution failed:
streamingstereoloader.cpp:123:52: note: ‘essentia::standard::OutputBase’ is not derived from ‘std::basic_istream<_CharT, _Traits>’
mono->output("audio") >> PC(monoPool, "monoaudio");
^
In file included from /usr/include/c++/7/random:51:0,
from /usr/include/eigen3/unsupported/Eigen/CXX11/Tensor:62,
from /usr/local/include/essentia/types.h:33,
from /usr/local/include/essentia/algorithmfactory.h:26,
from streamingstereoloader.cpp:24:
/usr/include/c++/7/bits/random.tcc:960:5: note: candidate: template<class _RealType, class _CharT, class _Traits> std::basic_istream<_CharT, _Traits>& std::operator>>(std::basic_istream<_CharT, _Traits>&, std::uniform_real_distribution<_IntType>&)
operator>>(std::basic_istream<_CharT, _Traits>& __is,
^~~~~~~~
/usr/include/c++/7/bits/random.tcc:960:5: note: template argument deduction/substitution failed:
streamingstereoloader.cpp:123:52: note: ‘essentia::standard::OutputBase’ is not derived from ‘std::basic_istream<_CharT, _Traits>’
mono->output("audio") >> PC(monoPool, "monoaudio");
^
In file included from /usr/include/c++/7/random:51:0,
from /usr/include/eigen3/unsupported/Eigen/CXX11/Tensor:62,
from /usr/local/include/essentia/types.h:33,
from /usr/local/include/essentia/algorithmfactory.h:26,
from streamingstereoloader.cpp:24:
/usr/include/c++/7/bits/random.tcc:898:5: note: candidate: template<class _IntType, class _CharT, class _Traits> std::basic_istream<_CharT, _Traits>& std::operator>>(std::basic_istream<_CharT, _Traits>&, std::uniform_int_distribution<_IntType>&)
operator>>(std::basic_istream<_CharT, _Traits>& __is,
^~~~~~~~
/usr/include/c++/7/bits/random.tcc:898:5: note: template argument deduction/substitution failed:
streamingstereoloader.cpp:123:52: note: ‘essentia::standard::OutputBase’ is not derived from ‘std::basic_istream<_CharT, _Traits>’
mono->output("audio") >> PC(monoPool, "monoaudio");
^
In file included from /usr/include/c++/7/random:51:0,
from /usr/include/eigen3/unsupported/Eigen/CXX11/Tensor:62,
from /usr/local/include/essentia/types.h:33,
from /usr/local/include/essentia/algorithmfactory.h:26,
from streamingstereoloader.cpp:24:
/usr/include/c++/7/bits/random.tcc:505:5: note: candidate: template<class _UIntType1, long unsigned int __w1, long unsigned int __n1, long unsigned int __m1, long unsigned int __r1, _UIntType1 __a1, long unsigned int __u1, _UIntType1 __d1, long unsigned int __s1, _UIntType1 __b1, long unsigned int __t1, _UIntType1 __c1, long unsigned int __l1, _UIntType1 __f1, class _CharT, class _Traits> std::basic_istream<_CharT, _Traits>& std::operator>>(std::basic_istream<_CharT, _Traits>&, std::mersenne_twister_engine<_UIntType, __w, __n, __m, __r, __a, __u, __d, __s, __b, __t, __c, __l, __f>&)
operator>>(std::basic_istream<_CharT, _Traits>& __is,
^~~~~~~~
/usr/include/c++/7/bits/random.tcc:505:5: note: template argument deduction/substitution failed:
streamingstereoloader.cpp:123:52: note: ‘essentia::standard::OutputBase’ is not derived from ‘std::basic_istream<_CharT, _Traits>’
mono->output("audio") >> PC(monoPool, "monoaudio");
^
In file included from /usr/local/include/essentia/streamutil.h:25:0,
from /usr/local/include/essentia/debugging.h:28,
from /usr/local/include/essentia/types.h:31,
from /usr/local/include/essentia/algorithmfactory.h:26,
from streamingstereoloader.cpp:24:
/usr/include/c++/7/complex:493:5: note: candidate: template<class _Tp, class _CharT, class _Traits> std::basic_istream<_CharT, _Traits>& std::operator>>(std::basic_istream<_CharT, _Traits>&, std::complex<_Tp>&)
operator>>(basic_istream<_CharT, _Traits>& __is, complex<_Tp>& __x)
^~~~~~~~
/usr/include/c++/7/complex:493:5: note: template argument deduction/substitution failed:
streamingstereoloader.cpp:123:52: note: ‘essentia::standard::OutputBase’ is not derived from ‘std::basic_istream<_CharT, _Traits>’
mono->output("audio") >> PC(monoPool, "monoaudio");
^
In file included from /usr/include/c++/7/iostream:40:0,
from streamingstereoloader.cpp:20:
/usr/include/c++/7/istream:980:5: note: candidate: template<class _Istream, class _Tp> typename std::enable_if<std::__and_<std::__not_<std::is_lvalue_reference<_Tp> >, std::__is_convertible_to_basic_istream<_Istream>, std::__is_extractable<typename std::__is_convertible_to_basic_istream<_Tp>::__istream_type, _Tp&&, void> >::value, typename std::__is_convertible_to_basic_istream<_Tp>::__istream_type>::type std::operator>>(_Istream&&, _Tp&&)
operator>>(_Istream&& __is, _Tp&& __x)
^~~~~~~~
/usr/include/c++/7/istream:980:5: note: template argument deduction/substitution failed:
/usr/include/c++/7/istream: In substitution of ‘template<class _Istream, class _Tp> typename std::enable_if<std::__and_<std::__not_<std::is_lvalue_reference<_Tp> >, std::__is_convertible_to_basic_istream<_Istream>, std::__is_extractable<typename std::__is_convertible_to_basic_istream<_Tp>::__istream_type, _Tp&&, void> >::value, typename std::__is_convertible_to_basic_istream<_Tp>::__istream_type>::type std::operator>>(_Istream&&, _Tp&&) [with _Istream = essentia::standard::OutputBase&; _Tp = essentia::streaming::PoolConnector]’:
streamingstereoloader.cpp:123:52: required from here
/usr/include/c++/7/istream:980:5: error: no type named ‘type’ in ‘struct std::enable_if<false, void>’
/usr/include/c++/7/istream:808:5: note: candidate: template<class _Traits> std::basic_istream<char, _Traits>& std::operator>>(std::basic_istream<char, _Traits>&, signed char*)
operator>>(basic_istream<char, _Traits>& __in, signed char* __s)
^~~~~~~~
/usr/include/c++/7/istream:808:5: note: template argument deduction/substitution failed:
streamingstereoloader.cpp:123:52: note: ‘essentia::standard::OutputBase’ is not derived from ‘std::basic_istream<char, _Traits>’
mono->output("audio") >> PC(monoPool, "monoaudio");
^
In file included from /usr/include/c++/7/iostream:40:0,
from streamingstereoloader.cpp:20:
/usr/include/c++/7/istream:803:5: note: candidate: template<class _Traits> std::basic_istream<char, _Traits>& std::operator>>(std::basic_istream<char, _Traits>&, unsigned char*)
operator>>(basic_istream<char, _Traits>& __in, unsigned char* __s)
^~~~~~~~
/usr/include/c++/7/istream:803:5: note: template argument deduction/substitution failed:
streamingstereoloader.cpp:123:52: note: ‘essentia::standard::OutputBase’ is not derived from ‘std::basic_istream<char, _Traits>’
mono->output("audio") >> PC(monoPool, "monoaudio");
^
In file included from /usr/include/c++/7/iostream:40:0,
from streamingstereoloader.cpp:20:
/usr/include/c++/7/istream:761:5: note: candidate: template<class _Traits> std::basic_istream<char, _Traits>& std::operator>>(std::basic_istream<char, _Traits>&, signed char&)
operator>>(basic_istream<char, _Traits>& __in, signed char& __c)
^~~~~~~~
/usr/include/c++/7/istream:761:5: note: template argument deduction/substitution failed:
streamingstereoloader.cpp:123:52: note: ‘essentia::standard::OutputBase’ is not derived from ‘std::basic_istream<char, _Traits>’
mono->output("audio") >> PC(monoPool, "monoaudio");
^
In file included from /usr/include/c++/7/iostream:40:0,
from streamingstereoloader.cpp:20:
/usr/include/c++/7/istream:756:5: note: candidate: template<class _Traits> std::basic_istream<char, _Traits>& std::operator>>(std::basic_istream<char, _Traits>&, unsigned char&)
operator>>(basic_istream<char, _Traits>& __in, unsigned char& __c)
^~~~~~~~
/usr/include/c++/7/istream:756:5: note: template argument deduction/substitution failed:
streamingstereoloader.cpp:123:52: note: ‘essentia::standard::OutputBase’ is not derived from ‘std::basic_istream<char, _Traits>’
mono->output("audio") >> PC(monoPool, "monoaudio");
^
In file included from /usr/include/c++/7/istream:991:0,
from /usr/include/c++/7/iostream:40,
from streamingstereoloader.cpp:20:
/usr/include/c++/7/bits/istream.tcc:931:5: note: candidate: template<class _CharT, class _Traits> std::basic_istream<_CharT, _Traits>& std::operator>>(std::basic_istream<_CharT, _Traits>&, _CharT&)
operator>>(basic_istream<_CharT, _Traits>& __in, _CharT& __c)
^~~~~~~~
/usr/include/c++/7/bits/istream.tcc:931:5: note: template argument deduction/substitution failed:
streamingstereoloader.cpp:123:52: note: ‘essentia::standard::OutputBase’ is not derived from ‘std::basic_istream<_CharT, _Traits>’
mono->output("audio") >> PC(monoPool, "monoaudio");
^
In file included from /usr/include/c++/7/istream:991:0,
from /usr/include/c++/7/iostream:40,
from streamingstereoloader.cpp:20:
/usr/include/c++/7/bits/istream.tcc:963:5: note: candidate: template<class _CharT2, class _Traits2> std::basic_istream<_CharT, _Traits>& std::operator>>(std::basic_istream<_CharT, _Traits>&, _CharT2*)
operator>>(basic_istream<_CharT, _Traits>& __in, _CharT* __s)
^~~~~~~~
/usr/include/c++/7/bits/istream.tcc:963:5: note: template argument deduction/substitution failed:
streamingstereoloader.cpp:123:52: note: ‘essentia::standard::OutputBase’ is not derived from ‘std::basic_istream<_CharT, _Traits>’
mono->output("audio") >> PC(monoPool, "monoaudio");
^
In file included from /usr/include/c++/7/string:53:0,
from /usr/include/c++/7/bits/locale_classes.h:40,
from /usr/include/c++/7/bits/ios_base.h:41,
from /usr/include/c++/7/ios:42,
from /usr/include/c++/7/ostream:38,
from /usr/include/c++/7/iostream:39,
from streamingstereoloader.cpp:20:
/usr/include/c++/7/bits/basic_string.tcc:1465:5: note: candidate: template<class _CharT, class _Traits, class _Alloc> std::basic_istream<_CharT, _Traits>& std::operator>>(std::basic_istream<_CharT, _Traits>&, std::__cxx11::basic_string<_CharT, _Traits, _Alloc>&)
operator>>(basic_istream<_CharT, _Traits>& __in,
^~~~~~~~
/usr/include/c++/7/bits/basic_string.tcc:1465:5: note: template argument deduction/substitution failed:
streamingstereoloader.cpp:123:52: note: ‘essentia::standard::OutputBase’ is not derived from ‘std::basic_istream<_CharT, _Traits>’
mono->output("audio") >> PC(monoPool, "monoaudio");
^
And with streaming
as:
Algorithm* mono = AlgorithmFactory::create("MonoMixer",
"type", "left");
mono->input(stereoPool.value<vector<StereoSample>>("audio")).set(monoPool);
mono->process();
mono->output("audio") >> PC(monoPool, "monoaudio");
cout << "Mono Audio Data:\n" << monoPool.value<vector<Real>>("monoaudio") << endl;
I get the error:
streamingstereoloader.cpp: In function ‘int main(int, char**)’:
streamingstereoloader.cpp:89:22: warning: comparison between signed and unsigned integer expressions [-Wsign-compare]
for(int i = 0; i < stereoPool.value<vector<StereoSample>>("audio").size(); ++i)
~~^~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
streamingstereoloader.cpp:95:22: warning: comparison between signed and unsigned integer expressions [-Wsign-compare]
for(int i = 0; i < stereoPool.value<vector<StereoSample>>("audio").size(); ++i)
~~^~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
streamingstereoloader.cpp:104:22: warning: comparison between signed and unsigned integer expressions [-Wsign-compare]
for(int i = 0; i < stereoPool.value<vector<StereoSample>>("audio").size(); ++i)
~~^~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
streamingstereoloader.cpp:127:62: error: no matching function for call to ‘essentia::streaming::Algorithm::input(const std::vector<essentia::Tuple2<float> >&)’
mono->input(stereoPool.value<vector<StereoSample>>("audio")).set(monoPool);
^
In file included from /usr/local/include/essentia/algorithmfactory.h:262:0,
from streamingstereoloader.cpp:24:
/usr/local/include/essentia/streaming/streamingalgorithm.h:166:13: note: candidate: essentia::streaming::SinkBase& essentia::streaming::Algorithm::input(const string&)
SinkBase& input(const std::string& name);
^~~~~
/usr/local/include/essentia/streaming/streamingalgorithm.h:166:13: note: no known conversion for argument 1 from ‘const std::vector<essentia::Tuple2<float> >’ to ‘const string& {aka const std::__cxx11::basic_string<char>&}’
/usr/local/include/essentia/streaming/streamingalgorithm.h:169:13: note: candidate: essentia::streaming::SinkBase& essentia::streaming::Algorithm::input(int)
SinkBase& input(int idx);
^~~~~
/usr/local/include/essentia/streaming/streamingalgorithm.h:169:13: note: no known conversion for argument 1 from ‘const std::vector<essentia::Tuple2<float> >’ to ‘int’
@pabloEntropia How do I get the data as I intend? It would be helpful if you could give some pointers.
I'm trying to extract the left and right channels audio data from a
.wav
file using the following program:When I try to compile this, I get the following error:
But the file
types.h
clearly shows that:What am I doing wrong here? Its probably something minor (or silly)?