MTG / essentia

C++ library for audio and music analysis, description and synthesis, including Python bindings
http://essentia.upf.edu
GNU Affero General Public License v3.0
2.84k stars 530 forks source link

Essentia iOS - How to load audio? #430

Closed tiennth closed 8 years ago

tiennth commented 8 years ago

Hello,

I have just compiled essentia for iOS and now I'm trying to create an iOS example follow this tutorial: http://essentia.upf.edu/documentation/howto_standard_extractor.html

The problem is when I run my project, it said that MonoLoader is not available. It seem that no audio loader is available in my essentia binary.

Here is the log of Xcode: libc++abi.dylib: terminating with uncaught exception of type essentia::EssentiaException: Identifier 'MonoLoader' not found in registry...

Available algorithms: AfterMaxToBeforeMaxEnergyRatio AllPass AudioOnsetsMarker AutoCorrelation BPF BandPass BandReject BarkBands BeatTrackerDegara BeatTrackerMultiFeature Beatogram BeatsLoudness BinaryOperator BinaryOperatorStream BpmHistogramDescriptors BpmRubato CartesianToPolar CentralMoments Centroid ChordsDescriptors ChordsDetection ChordsDetectionBeats Clipper Crest CrossCorrelation CubicSpline DCRemoval DCT Danceability Decrease Derivative DerivativeSFX Dissonance DistributionShape Duration DynamicComplexity ERBBands EffectiveDuration Energy EnergyBand EnergyBandRatio Entropy Envelope EqualLoudness Extractor FFT FadeDetection Flatness FlatnessDB FlatnessSFX Flux FrameCutter FrameToReal FrequencyBands GFCC GeometricMean HFC HPCP HarmonicBpm HarmonicMask HarmonicModelAnal HarmonicPeaks HighPass HighResolutionFeatures HprModelAnal HpsModelAnal IFFT IIR Inharmonicity InstantPower Intensity Key KeyExtractor LPC Larm Leq LevelExtractor LogAttackTime Loudness LoudnessEBUR128 LoudnessVickers LowLevelSpectralEqloudExtractor LowLevelSpectralExtractor LowPass MFCC Magnitude MaxFilter MaxMagFreq MaxToTotal Mean Median MelBands Meter MinToTotal MonoMixer MovingAverage MultiPitchKlapuri MultiPitchMelodia Multiplexer NoiseAdder NoveltyCurve NoveltyCurveFixedBpmEstimator OddToEvenHarmonicEnergyRatio OnsetDetection OnsetDetectionGlobal OnsetRate Onsets OverlapAdd PCA Panning PeakDetection PitchContourSegmentation PitchContours PitchContoursMelody PitchContoursMonoMelody PitchContoursMultiMelody PitchFilter PitchMelodia PitchSalience PitchSalienceFunction PitchSalienceFunctionPeaks PitchYin PitchYinFFT PolarToCartesian PoolAggregator PowerMean PowerSpectrum PredominantPitchMelodia RMS RawMoments ReplayGain ResampleFFT RhythmDescriptors RhythmExtractor RhythmExtractor2013 RhythmTransform RollOff SBic Scale SilenceRate SineModelAnal SineModelSynth SineSubtraction SingleBeatLoudness SingleGaussian Slicer SpectralCentroidTime SpectralComplexity SpectralContrast SpectralPeaks SpectralWhitening Spectrum Spline SprModelAnal SprModelSynth SpsModelAnal SpsModelSynth StartStopSilence StereoDemuxer StochasticModelAnal StochasticModelSynth StrongDecay StrongPeak SuperFluxExtractor SuperFluxNovelty SuperFluxPeaks TCToTotal TempoScaleBands TempoTap TempoTapDegara TempoTapMaxAgreement TempoTapTicks TonalExtractor TonicIndianArtMusic TriangularBands Trimmer Tristimulus TuningFrequency TuningFrequencyExtractor UnaryOperator UnaryOperatorStream Variance Vibrato WarpedAutoCorrelation Windowing ZeroCrossingRate

Here is output in console when i was compiling essentia:

→ Building in release mode → Cross-compiling for iOS (ARMv7 and ARM64) Checking for 'g++' (c++ compiler) : /usr/bin/g++ Checking for 'gcc' (c compiler) : /usr/bin/gcc

=======================Lightweight Mode : Ignoring ALL libraries except [''] =======================

================================ CONFIGURATION SUMMARY ================================

  • using Accelerate Framework for FFT
  • FFmpeg (or LibAv on debian/ubuntu) seems to be missing. The following algorithms will be ignored: ['AudioLoader', 'MonoLoader', 'EqloudLoader', 'EasyLoader', 'MonoWriter', 'AudioWriter']
  • libsamplerate seems to be missing. The following algorithms will be ignored: ['Resample', 'MonoLoader', 'EqloudLoader', 'EasyLoader']

    Examples requiring FFmpeg / libav and libsamplerate will be ignored

  • TagLib seems to be missing. The following algorithms will be ignored: ['MetadataReader']
  • libyaml seems to be missing. The following algorithms will be ignored: ['YamlInput', 'YamlOutput']
  • Essentia is configured without Gaia2. The following algorithms will be ignored: ['GaiaTransform'] Examples requiring Gaia2 will be ignored

Building all the algorithms Ignoring the following algorithms: Resample, GaiaTransform, YamlInput, MonoLoader, IFFTW, AudioWriter, FFTW, AudioLoader, EqloudLoader, EasyLoader, MonoWriter, MetadataReader, FFTK, IFFTK, YamlOutput

Created algorithms registration file

'configure' finished successfully (0.332s)

carthach commented 8 years ago

You haven't compiled Monoloader for Essentia.... (see the last line). You'll need to compile FFmpeg especially for iOS if you want to use it.

tiennth commented 8 years ago

Hi @carthach ,

Thank you for letting me know that. From this line in the console log:

- FFmpeg (or LibAv on debian/ubuntu) seems to be missing.
  The following algorithms will be ignored: ['AudioLoader', 'MonoLoader', 'EqloudLoader', 'EasyLoader', 'MonoWriter', 'AudioWriter']

I understand that no audio loader will be available if i compile essentia without ffmpeg. Is it correct? If ffmpeg is required, so why the document here said that ffmpeg is optional?

Thank you, Tien.

carthach commented 8 years ago

"libavcodec/libavformat/libavutil/libavresample (from the FFmpeg/LibAv project): for loading/saving any type of audio files (optional)".

It's optional but as the documentation says if you don't use it you won't be able to do any loading/saving of audio files. Some of us use Essentia with frameworks like JUCE and openFrameworks, in which case we use their own audio I/O features and compile a reduced version of Essentia without FFmpeg.

tiennth commented 8 years ago

I got it. It means I have to compile essentia with ffmpeg in order to use essentia in iOS. Thank you much, @carthach

carthach commented 8 years ago

@dbogdanov Dmitry you can close this!

dbogdanov commented 8 years ago

Note that if are not obliged to use ffmpeg. You can load audio using native iOS methods and then do analysis in Essentia.

logic1988 commented 8 years ago

I had build the ios library successfully by the recommended command. But I needed MonoLoader for read audio file, so I remove the --lightweight in recommended command, and I run it as follow in macOS: ./waf configure --cross-compile-ios --fft=ACCELERATE --build-static The output is:

LogicdeMacBook-Pro:essentia logic$ ./waf configure --cross-compile-ios --fft=ACCELERATE --build-static
Setting top to                           : /Users/logic/Desktop/essentia 
Setting out to                           : /Users/logic/Desktop/essentia/build 
→ configuring the project in /Users/logic/Desktop/essentia
→ Building in release mode
→ Cross-compiling for iOS (ARMv7 and ARM64)
Checking for 'g++' (c++ compiler)        : /usr/bin/g++ 
Checking for 'gcc' (c compiler)          : /usr/bin/gcc 
Checking for program pkg-config          : /usr/local/bin/pkg-config 
Checking for 'libavcodec' >= 55.34.1     : yes 
Checking for 'libavformat'               : yes 
Checking for 'libavutil'                 : yes 
Checking for 'libavresample'             : yes 
Checking for 'samplerate'                : yes 
Checking for 'taglib' >= 1.9             : yes 
Checking for 'yaml-0.1'                  : yes 
/usr/local/Cellar/libyaml/0.1.6_1/include
Checking for 'fftw3f'                    : yes 

================================ CONFIGURATION SUMMARY ================================
- using Accelerate Framework for FFT

- FFmpeg / libav detected!
- libsamplerate (SRC) detected!
  The following algorithms will be included: ['MonoLoader', 'Resample', 'AudioWriter', 'EasyLoader', 'MonoWriter', 'EqloudLoader', 'AudioLoader']

- TagLib detected!
  The following algorithms will be included: ['MetadataReader']

- libyaml detected!
  The following algorithms will be included: ['YamlInput', 'YamlOutput']

- Essentia is configured without Gaia2.
  The following algorithms will be ignored: ['GaiaTransform']
  Examples requiring Gaia2 will be ignored

Building all the algorithms
Ignoring the following algorithms: GaiaTransform, IFFTW, FFTW, FFTK, Chromagram, IFFTK, ConstantQ, FFTWComplex
Created algorithms registration file
=======================================================================================
'configure' finished successfully (0.278s)

It created static lib successfully, but some errors occurred in xcode when I used it:

Undefined symbols for architecture arm64: "_yaml_parser_set_input_string", referenced from: essentia::parseYaml(sFILE_, std::__1::basic_string<char, std::1::char_traits, std::1::allocator > const&) in libessentia.a(yamlast.cpp.1.o) "_yaml_parser_delete", referenced from: cleanState(std::_1::stack<essentia::YamlNode, std::1::deque<essentia::YamlNode, std::__1::allocator<essentia::YamlNode> > >_, std::1::stack<essentia::YamlScalarNode, std::1::deque<essentia::YamlScalarNode*, std::1::allocator<essentia::YamlScalarNode*> > >, yaml_parsers, yaml_events) in libessentia.a(yamlast.cpp.1.o) essentia::parseYaml(sFILE_, std::1::basic_string<char, std::__1::char_traits, std::1::allocator > const&) in libessentia.a(yamlast.cpp.1.o) throwParserError(yaml_parsers) in libessentia.a(yamlast.cpp.1.o) "_src_reset", referenced from: essentia::streaming::Resample::reset() in libessentia.a(resample.cpp.1.o) "_src_simple", referenced from: essentia::standard::Resample::compute() in libessentia.a(resample.cpp.1.o) "_src_strerror", referenced from: essentia::standard::Resample::compute() in libessentia.a(resample.cpp.1.o) essentia::streaming::Resample::process() in libessentia.a(resample.cpp.1.o) essentia::streaming::Resample::reset() in libessentia.a(resample.cpp.1.o) "TagLib::String::operator<(TagLib::String const&) const", referenced from: std::1::tree_nodebase<void>_& std::1::tree<std::1::value_type<TagLib::String, TagLib::StringList>, std::1::map_value_compare<TagLib::String, std::1::value_type<TagLib::String, TagLib::StringList>, std::1::lessTagLib::String, true>, std::1::allocator<std::1::value_type<TagLib::String, TagLib::StringList> > >::find_equal<std::1::value_type<TagLib::String, TagLib::StringList> >(std::1::tree_const_iterator<std::1::value_type<TagLib::String, TagLib::StringList>, std::1::tree_node<std::1::valuetype<TagLib::String, TagLib::StringList>, void>_, long>, std::1::tree_nodebase<void>_&, std::1::value_type<TagLib::String, TagLib::StringList> const&) in libessentia.a(metadatareader.cpp.1.o) "TagLib::String::String(TagLib::String const&)", referenced from: TagLib::Map<TagLib::String, TagLib::StringList>::MapPrivate<TagLib::String, TagLib::StringList>::MapPrivate(std::1::map<TagLib::String, TagLib::StringList, std::1::less, std::1::allocator<std::1::pair<TagLib::String const, TagLib::StringList> > > const&) in libessentia.a(metadatareader.cpp.1.o) std::1::tree<std::1::value_type<TagLib::String, TagLib::StringList>, std::1::map_value_compare<TagLib::String, std::1::value_type<TagLib::String, TagLib::StringList>, std::1::lessTagLib::String, true>, std::1::allocator<std::1::value_type<TagLib::String, TagLib::StringList> > >::__construct_node(std::1::value_type<TagLib::String, TagLib::StringList> const&) in libessentia.a(metadatareader.cpp.1.o) "TagLib::StringList::StringList(TagLib::StringList const&)", referenced from: TagLib::Map<TagLib::String, TagLib::StringList>::MapPrivate<TagLib::String, TagLib::StringList>::MapPrivate(std::1::map<TagLib::String, TagLib::StringList, std::1::less, std::1::allocator<std::1::pair<TagLib::String const, TagLib::StringList> > > const&) in libessentia.a(metadatareader.cpp.1.o) std::1::tree<std::1::value_type<TagLib::String, TagLib::StringList>, std::1::map_value_compare<TagLib::String, std::1::value_type<TagLib::String, TagLib::StringList>, std::1::lessTagLib::String, true>, std::1::allocator<std::1::value_type<TagLib::String, TagLib::StringList> > >::construct_node(std::1::value_type<TagLib::String, TagLib::StringList> const&) in libessentia.a(metadatareader.cpp.1.o) "TagLib::StringList::~StringList()", referenced from: TagLib::Map<TagLib::String, TagLib::StringList>::MapPrivate<TagLib::String, TagLib::StringList>::MapPrivate(std::1::map<TagLib::String, TagLib::StringList, std::1::less, std::1::allocator<std::1::pair<TagLib::String const, TagLib::StringList> > > const&) in libessentia.a(metadatareader.cpp.1.o) std::1::tree<std::1::value_type<TagLib::String, TagLib::StringList>, std::1::map_value_compare<TagLib::String, std::1::value_type<TagLib::String, TagLib::StringList>, std::1::lessTagLib::String, true>, std::1::allocator<std::1::value_type<TagLib::String, TagLib::StringList> > >::destroy(std::1::tree_node<std::1::valuetype<TagLib::String, TagLib::StringList>, void>_) in libessentia.a(metadatareader.cpp.1.o) "_src_delete", referenced from: essentia::streaming::Resample::~Resample() in libessentia.a(resample.cpp.1.o) essentia::streaming::Resample::configure() in libessentia.a(resample.cpp.1.o) "TagLib::FileRef::isNull() const", referenced from: essentia::standard::MetadataReader::compute() in libessentia.a(metadatareader.cpp.1.o) essentia::streaming::MetadataReader::process() in libessentia.a(metadatareader.cpp.1.o) "TagLib::PropertyMap::operator[](TagLib::String const&)", referenced from: essentia::standard::MetadataReader::compute() in libessentia.a(metadatareader.cpp.1.o) essentia::streaming::MetadataReader::process() in libessentia.a(metadatareader.cpp.1.o) "TagLib::FileRef::audioProperties() const", referenced from: essentia::standard::MetadataReader::compute() in libessentia.a(metadatareader.cpp.1.o) essentia::streaming::MetadataReader::process() in libessentia.a(metadatareader.cpp.1.o) "TagLib::PropertyMap::~PropertyMap()", referenced from: essentia::standard::MetadataReader::compute() in libessentia.a(metadatareader.cpp.1.o) essentia::streaming::MetadataReader::process() in libessentia.a(metadatareader.cpp.1.o) "TagLib::FileRef::~FileRef()", referenced from: essentia::standard::MetadataReader::compute() in libessentia.a(metadatareader.cpp.1.o) essentia::streaming::MetadataReader::process() in libessentia.a(metadatareader.cpp.1.o) "TagLib::StringList::toString(TagLib::String const&) const", referenced from: formatString(TagLib::StringList const&) in libessentia.a(metadatareader.cpp.1.o) "_yaml_parser_parse", referenced from: essentia::parseYaml(sFILE_, std::__1::basic_string<char, std::1::char_traits, std::1::allocator > const&) in libessentia.a(yamlast.cpp.1.o) "TagLib::String::~String()", referenced from: formatString(TagLib::StringList const&) in libessentia.a(metadatareader.cpp.1.o) essentia::standard::MetadataReader::compute() in libessentia.a(metadatareader.cpp.1.o) essentia::streaming::MetadataReader::process() in libessentia.a(metadatareader.cpp.1.o) TagLib::Map<TagLib::String, TagLib::StringList>::MapPrivate<TagLib::String, TagLib::StringList>::MapPrivate(std::1::map<TagLib::String, TagLib::StringList, std::1::less, std::1::allocator<std::1::pair<TagLib::String const, TagLib::StringList> > > const&) in libessentia.a(metadatareader.cpp.1.o) std::1::tree<std::1::value_type<TagLib::String, TagLib::StringList>, std::1::map_value_compare<TagLib::String, std::1::value_type<TagLib::String, TagLib::StringList>, std::1::lessTagLib::String, true>, std::1::allocator<std::1::value_type<TagLib::String, TagLib::StringList> > >::__construct_node(std::1::value_type<TagLib::String, TagLib::StringList> const&) in libessentia.a(metadatareader.cpp.1.o) std::1::tree<std::1::value_type<TagLib::String, TagLib::StringList>, std::1::map_value_compare<TagLib::String, std::1::value_type<TagLib::String, TagLib::StringList>, std::1::lessTagLib::String, true>, std::1::allocator<std::1::value_type<TagLib::String, TagLib::StringList> > >::destroy(std::1::tree_node<std::1::valuetype<TagLib::String, TagLib::StringList>, void>_) in libessentia.a(metadatareader.cpp.1.o) "_av_frame_unref", referenced from: essentia::streaming::AudioLoader::decode_audioframe(AVCodecContext, float, int, AVPacket_) in libessentia.a(audioloader.cpp.1.o) "_avcodec_decode_audio4", referenced from: essentia::streaming::AudioLoader::decode_audioframe(AVCodecContext, float, int, AVPacket_) in libessentia.a(audioloader.cpp.1.o) "_src_new", referenced from: essentia::streaming::Resample::configure() in libessentia.a(resample.cpp.1.o) "_avformat_open_input", referenced from: essentia::streaming::AudioLoader::openAudioFile(std::__1::basic_string<char, std::1::char_traits, std::1::allocator > const&) in libessentia.a(audioloader.cpp.1.o) "_av_md5_final", referenced from: essentia::streaming::AudioLoader::process() in libessentia.a(audioloader.cpp.1.o) "_avresample_alloc_context", referenced from: essentia::AudioContext::create(std::1::basic_string<char, std::1::char_traits, std::1::allocator > const&, std::1::basic_string<char, std::1::char_traits, std::1::allocator > const&, int, int, int) in libessentia.a(audiocontext.cpp.1.o) essentia::streaming::AudioLoader::openAudioFile(std::1::basic_string<char, std::1::char_traits, std::__1::allocator > const&) in libessentia.a(audioloader.cpp.1.o) "_avresample_close", referenced from: essentia::AudioContext::close() in libessentia.a(audiocontext.cpp.1.o) essentia::streaming::AudioLoader::~AudioLoader() in libessentia.a(audioloader.cpp.1.o) essentia::streaming::AudioLoader::process() in libessentia.a(audioloader.cpp.1.o) essentia::streaming::AudioLoader::reset() in libessentia.a(audioloader.cpp.1.o) "_av_samples_alloc", referenced from: essentia::AudioContext::encodePacket(int) in libessentia.a(audiocontext.cpp.1.o) "_avresample_convert", referenced from: essentia::AudioContext::encodePacket(int) in libessentia.a(audiocontext.cpp.1.o) essentia::streaming::AudioLoader::decode_audioframe(AVCodecContext, float, int, AVPacket_) in libessentia.a(audioloader.cpp.1.o) "_av_frame_free", referenced from: essentia::AudioContext::encodePacket(int) in libessentia.a(audiocontext.cpp.1.o) "_avcodec_encode_audio2", referenced from: essentia::AudioContext::writeEOF() in libessentia.a(audiocontext.cpp.1.o) essentia::AudioContext::encodePacket(int) in libessentia.a(audiocontext.cpp.1.o) "_av_freep", referenced from: essentia::AudioContext::close() in libessentia.a(audiocontext.cpp.1.o) essentia::AudioContext::encodePacket(int) in libessentia.a(audiocontext.cpp.1.o) essentia::streaming::AudioLoader::~AudioLoader() in libessentia.a(audioloader.cpp.1.o) "_av_write_frame", referenced from: essentia::AudioContext::writeEOF() in libessentia.a(audiocontext.cpp.1.o) essentia::AudioContext::encodePacket(int) in libessentia.a(audiocontext.cpp.1.o) "_avio_open", referenced from: essentia::AudioContext::open() in libessentia.a(audiocontext.cpp.1.o) "_avformat_close_input", referenced from: essentia::streaming::AudioLoader::~AudioLoader() in libessentia.a(audioloader.cpp.1.o) essentia::streaming::AudioLoader::openAudioFile(std::1::basic_string<char, std::1::char_traits, std::1::allocator > const&) in libessentia.a(audioloader.cpp.1.o) essentia::streaming::AudioLoader::process() in libessentia.a(audioloader.cpp.1.o) essentia::streaming::AudioLoader::reset() in libessentia.a(audioloader.cpp.1.o) "_avformat_write_header", referenced from: essentia::AudioContext::open() in libessentia.a(audiocontext.cpp.1.o) "_avcodec_find_decoder", referenced from: essentia::streaming::AudioLoader::openAudioFile(std::1::basic_string<char, std::1::char_traits, std::1::allocator > const&) in libessentia.a(audioloader.cpp.1.o) "_av_write_trailer", referenced from: essentia::AudioContext::close() in libessentia.a(audiocontext.cpp.1.o) "_av_guess_format", referenced from: essentia::AudioContext::create(std::1::basic_string<char, std::1::char_traits, std::1::allocator > const&, std::1::basic_string<char, std::1::char_traits, std::1::allocator > const&, int, int, int) in libessentia.a(audiocontext.cpp.1.o) "_av_frame_alloc", referenced from: essentia::AudioContext::encodePacket(int) in libessentia.a(audiocontext.cpp.1.o) essentia::streaming::AudioLoader::openAudioFile(std::__1::basic_string<char, std::1::char_traits, std::1::allocator > const&) in libessentia.a(audioloader.cpp.1.o) "_avcodec_close", referenced from: essentia::AudioContext::close() in libessentia.a(audiocontext.cpp.1.o) essentia::streaming::AudioLoader::~AudioLoader() in libessentia.a(audioloader.cpp.1.o) essentia::streaming::AudioLoader::process() in libessentia.a(audioloader.cpp.1.o) essentia::streaming::AudioLoader::reset() in libessentia.a(audioloader.cpp.1.o) "_avformat_alloc_context", referenced from: essentia::AudioContext::create(std::__1::basic_string<char, std::1::char_traits, std::1::allocator > const&, std::1::basic_string<char, std::1::char_traits, std::1::allocator > const&, int, int, int) in libessentia.a(audiocontext.cpp.1.o) "TagLib::String::isEmpty() const", referenced from: formatString(TagLib::StringList const&) in libessentia.a(metadatareader.cpp.1.o) "_avresamplefree", referenced from: essentia::AudioContext::close() in libessentia.a(audiocontext.cpp.1.o) essentia::streaming::AudioLoader::~AudioLoader() in libessentia.a(audioloader.cpp.1.o) essentia::streaming::AudioLoader::process() in libessentia.a(audioloader.cpp.1.o) essentia::streaming::AudioLoader::reset() in libessentia.a(audioloader.cpp.1.o) "TagLib::String::String(char const, TagLib::String::Type)", referenced from: formatString(TagLib::StringList const&) in libessentia.a(metadatareader.cpp.1.o) essentia::standard::MetadataReader::compute() in libessentia.a(metadatareader.cpp.1.o) essentia::streaming::MetadataReader::process() in libessentia.a(metadatareader.cpp.1.o) "_avformat_new_stream", referenced from: essentia::AudioContext::create(std::1::basic_string<char, std::1::char_traits, std::1::allocator > const&, std::1::basic_string<char, std::1::char_traits, std::__1::allocator > const&, int, int, int) in libessentia.a(audiocontext.cpp.1.o) "_avcodec_find_encoder", referenced from: essentia::AudioContext::create(std::1::basic_string<char, std::1::char_traits, std::1::allocator > const&, std::1::basic_string<char, std::1::char_traits, std::1::allocator > const&, int, int, int) in libessentia.a(audiocontext.cpp.1.o) "_yaml_parser_set_input_file", referenced from: essentia::parseYaml(_sFILE, std::1::basic_string<char, std::1::char_traits, std::1::allocator > const&) in libessentia.a(yamlast.cpp.1.o) "TagLib::String::to8Bit(bool) const", referenced from: formatString(TagLib::StringList const&) in libessentia.a(metadatareader.cpp.1.o) essentia::standard::MetadataReader::compute() in libessentia.a(metadatareader.cpp.1.o) "_av_opt_set_int", referenced from: essentia::AudioContext::create(std::1::basic_string<char, std::1::char_traits, std::1::allocator > const&, std::1::basic_string<char, std::1::char_traits, std::1::allocator > const&, int, int, int) in libessentia.a(audiocontext.cpp.1.o) essentia::streaming::AudioLoader::openAudioFile(std::1::basic_string<char, std::1::char_traits, std::1::allocator > const&) in libessentia.a(audioloader.cpp.1.o) "_av_samples_get_buffer_size", referenced from: essentia::AudioContext::create(std::__1::basic_string<char, std::1::char_traits, std::1::allocator > const&, std::1::basic_string<char, std::1::char_traits, std::__1::allocator > const&, int, int, int) in libessentia.a(audiocontext.cpp.1.o) essentia::AudioContext::encodePacket(int) in libessentia.a(audiocontext.cpp.1.o) essentia::streaming::AudioLoader::decode_audioframe(AVCodecContext, float, int, AVPacket_) in libessentia.a(audioloader.cpp.1.o) "_yaml_event_delete", referenced from: cleanState(std::1::stack<essentia::YamlNode, std::__1::deque<essentia::YamlNode, std::1::allocator<essentia::YamlNode*> > >_, std::_1::stack<essentia::YamlScalarNode, std::1::deque<essentia::YamlScalarNode, std::__1::allocator<essentia::YamlScalarNode> > >_, yaml_parsers, yaml_events) in libessentia.a(yamlast.cpp.1.o) essentia::parseYaml(sFILE_, std::__1::basic_string<char, std::1::char_traits, std::1::allocator > const&) in libessentia.a(yamlast.cpp.1.o) "_avio_close", referenced from: essentia::AudioContext::close() in libessentia.a(audiocontext.cpp.1.o) "TagLib::File::properties() const", referenced from: essentia::standard::MetadataReader::compute() in libessentia.a(metadatareader.cpp.1.o) essentia::streaming::MetadataReader::process() in libessentia.a(metadatareader.cpp.1.o) "_av_malloc", referenced from: essentia::streaming::AudioLoader::AudioLoader() in libessentia.a(essentia_algorithms_reg.cpp.1.o) essentia::AudioContext::create(std::1::basic_string<char, std::1::char_traits, std::1::allocator > const&, std::1::basic_string<char, std::1::char_traits, std::1::allocator > const&, int, int, int) in libessentia.a(audiocontext.cpp.1.o) "_av_get_sample_fmt_name", referenced from: essentia::AudioContext::create(std::__1::basic_string<char, std::1::char_traits, std::1::allocator > const&, std::1::basic_string<char, std::1::char_traits, std::__1::allocator > const&, int, int, int) in libessentia.a(audiocontext.cpp.1.o) essentia::AudioContext::encodePacket(int) in libessentia.a(audiocontext.cpp.1.o) essentia::streaming::AudioLoader::decode_audioframe(AVCodecContext, float, int, AVPacket_) in libessentia.a(audioloader.cpp.1.o) "_yaml_parser_initialize", referenced from: essentia::parseYaml(sFILE_, std::1::basic_string<char, std::__1::char_traits, std::1::allocator > const&) in libessentia.a(yamlast.cpp.1.o) "_av_md5_init", referenced from: essentia::streaming::AudioLoader::openAudioFile(std::1::basic_string<char, std::__1::char_traits, std::1::allocator > const&) in libessentia.a(audioloader.cpp.1.o) "_avcodec_fill_audio_frame", referenced from: essentia::AudioContext::encodePacket(int) in libessentia.a(audiocontext.cpp.1.o) "TagLib::FileRef::file() const", referenced from: essentia::standard::MetadataReader::compute() in libessentia.a(metadatareader.cpp.1.o) essentia::streaming::MetadataReader::process() in libessentia.a(metadatareader.cpp.1.o) "_av_strerror", referenced from: essentia::AudioContext::create(std::1::basic_string<char, std::__1::char_traits, std::1::allocator > const&, std::1::basic_string<char, std::__1::char_traits, std::1::allocator > const&, int, int, int) in libessentia.a(audiocontext.cpp.1.o) essentia::AudioContext::encodePacket(int) in libessentia.a(audiocontext.cpp.1.o) essentia::streaming::AudioLoader::openAudioFile(std::1::basic_string<char, std::__1::char_traits, std::1::allocator > const&) in libessentia.a(audioloader.cpp.1.o) essentia::streaming::AudioLoader::process() in libessentia.a(audioloader.cpp.1.o) essentia::streaming::AudioLoader::flushPacket() in libessentia.a(audioloader.cpp.1.o) essentia::streaming::AudioLoader::decodePacket() in libessentia.a(audioloader.cpp.1.o) "_av_md5_update", referenced from: essentia::streaming::AudioLoader::process() in libessentia.a(audioloader.cpp.1.o) "_av_free_packet", referenced from: essentia::AudioContext::writeEOF() in libessentia.a(audiocontext.cpp.1.o) essentia::AudioContext::encodePacket(int) in libessentia.a(audiocontext.cpp.1.o) essentia::streaming::AudioLoader::~AudioLoader() in libessentia.a(audioloader.cpp.1.o) essentia::streaming::AudioLoader::process() in libessentia.a(audioloader.cpp.1.o) essentia::streaming::AudioLoader::reset() in libessentia.a(audioloader.cpp.1.o) "_avcodec_open2", referenced from: essentia::AudioContext::create(std::1::basic_string<char, std::__1::char_traits, std::1::allocator > const&, std::1::basic_string<char, std::__1::char_traits, std::1::allocator > const&, int, int, int) in libessentia.a(audiocontext.cpp.1.o) essentia::streaming::AudioLoader::openAudioFile(std::1::basic_string<char, std::__1::char_traits, std::1::allocator > const&) in libessentia.a(audioloader.cpp.1.o) "_avformat_find_stream_info", referenced from: essentia::streaming::AudioLoader::openAudioFile(std::1::basic_string<char, std::__1::char_traits, std::1::allocator > const&) in libessentia.a(audioloader.cpp.1.o) "TagLib::FileRef::FileRef(char const_, bool, TagLib::AudioProperties::ReadStyle)", referenced from: essentia::standard::MetadataReader::compute() in libessentia.a(metadatareader.cpp.1.o) essentia::streaming::MetadataReader::process() in libessentia.a(metadatareader.cpp.1.o) "_av_get_bytes_per_sample", referenced from: essentia::AudioContext::AudioContext() in libessentia.a(audiocontext.cpp.1.o) essentia::AudioContext::create(std::1::basic_string<char, std::__1::char_traits, std::1::allocator > const&, std::1::basic_string<char, std::__1::char_traits, std::1::allocator > const&, int, int, int) in libessentia.a(audiocontext.cpp.1.o) essentia::streaming::AudioLoader::copyFFmpegOutput() in libessentia.a(audioloader.cpp.1.o) essentia::streaming::AudioLoader::decode_audioframe(AVCodecContext, float, int, AVPacket_) in libessentia.a(audioloader.cpp.1.o) "_av_log_set_level", referenced from: essentia::AudioContext::AudioContext() in libessentia.a(audiocontext.cpp.1.o) essentia::AudioContext::create(std::1::basic_string<char, std::__1::char_traits, std::1::allocator > const&, std::1::basic_string<char, std::__1::char_traits, std::1::allocator > const&, int, int, int) in libessentia.a(audiocontext.cpp.1.o) essentia::streaming::AudioLoader::configure() in libessentia.a(audioloader.cpp.1.o) "_av_get_default_channel_layout", referenced from: essentia::AudioContext::create(std::1::basic_string<char, std::__1::char_traits, std::1::allocator > const&, std::1::basic_string<char, std::__1::char_traits, std::1::allocator > const&, int, int, int) in libessentia.a(audiocontext.cpp.1.o) essentia::streaming::AudioLoader::openAudioFile(std::1::basic_string<char, std::__1::char_traits, std::1::allocator > const&) in libessentia.a(audioloader.cpp.1.o) "_src_process", referenced from: essentia::streaming::Resample::process() in libessentia.a(resample.cpp.1.o) "TagLib::String::isLatin1() const", referenced from: formatString(TagLib::StringList const&) in libessentia.a(metadatareader.cpp.1.o) "_avresample_open", referenced from: essentia::AudioContext::create(std::1::basic_string<char, std::__1::char_traits, std::1::allocator > const&, std::1::basic_string<char, std::__1::char_traits, std::1::allocator > const&, int, int, int) in libessentia.a(audiocontext.cpp.1.o) essentia::streaming::AudioLoader::openAudioFile(std::1::basic_string<char, std::__1::char_traits, std::1::allocator > const&) in libessentia.a(audioloader.cpp.1.o) "_av_read_frame", referenced from: essentia::streaming::AudioLoader::process() in libessentia.a(audioloader.cpp.1.o) "_av_register_all", referenced from: essentia::streaming::AudioLoader::AudioLoader() in libessentia.a(essentia_algorithms_reg.cpp.1.o) essentia::AudioContext::AudioContext() in libessentia.a(audiocontext.cpp.1.o) "_av_init_packet", referenced from: essentia::AudioContext::writeEOF() in libessentia.a(audiocontext.cpp.1.o) essentia::AudioContext::encodePacket(int) in libessentia.a(audiocontext.cpp.1.o) essentia::streaming::AudioLoader::openAudioFile(std::1::basic_string<char, std::__1::char_traits, std::1::allocator > const&) in libessentia.a(audioloader.cpp.1.o) essentia::streaming::AudioLoader::flushPacket() in libessentia.a(audioloader.cpp.1.o) "_av_md5_alloc", referenced from: essentia::streaming::AudioLoader::AudioLoader() in libessentia.a(essentia_algorithms_reg.cpp.1.o) ld: symbol(s) not found for architecture arm64 clang: error: linker command failed with exit code 1 (use -v to see invocation)

carthach commented 8 years ago

Yes but this will mean that all dependencies will be expected to exist for the essentia compile. Meaning that you will need to compile YAML and TagLib for iOS as well (that's what the error is saying).

In the FAQ there's information about excluding and including specific algorithms so try to compile with just FFMPEG and none of the others...

https://github.com/MTG/essentia/blob/master/FAQ.md

My advice? Build as lightweight as possible, avoid FFMPEG and use your platform's ability to load audio as Dimi suggests above.

logic1988 commented 8 years ago

@carthach Thank you very much. Do you meaning when the dependencies of YAML and TagLib was removed, what I just need to do is that building FFmpeg in arm64 and adding the relative static library files of ffmpeg to xcode project?

I just wanted to reading the audio data from the video files on mobile platforms included both iOS and Android. Could someone provide some examples and tutorial?

carthach commented 8 years ago

So you'll want to do this to if you want to still use ffmpeg (libav). This is explained in the FAQ i previously sent.

./waf configure --lightweight=libav --cross-compile-ios --fft=ACCELERATE --build-static

Tbh I know nothing about iOS programming, I program in JUCE/C++ which takes care of all that for me including the audio I/O. That's why I just modified Essentia to build a bare bones version of the library for iOS platforms.

Here is an example project we did using JUCE and iOS (https://github.com/carthach/eear/tree/master/eear-Mobile).