Giter VIP home page Giter VIP logo

ni-media's Introduction

NI MEDIA ni-media CI codecov

NI Media is a library for reading from / writing to audio streams developed at Native Instruments.

Motivation

The goal is to have a modern C++ library for dealing with audio streams in an idiomatic C++ style.

Modern:

  • a clear separation of concerns (modular instead of fat classes)
  • support for ranges and iterators

Idiomatic:

  • based on std.streams.
  • integrates well with STL algorithms and boost

The following example demonstrates how to stream an entire audio file into a vector:

#include <ni/media/audio/ifstream.h>
#include <vector>

int main()
{
    auto stream = audio::ifstream("hello.wav");
    auto samples = std::vector<float>(stream.info().num_samples());
    stream >> samples;
    // use samples
}

Components

  • audiostream: the main library for reading from / writing to audio streams.
  • pcm: a small library to convert pcm data from / to arithmetic types.

Dependencies

  • boost ( algorithm, endian, filesystem, format, icl, iostream, local, math, program-option, regex, system)
  • flac & ogg, for flac support (CMake option NIMEDIA_ENABLE_FLAC_DECODING)
  • vorbis & ogg, for ogg vorbis support (CMake option NIMEDIA_ENABLE_OGG_DECODING)
  • googletest for building the tests (CMake option NIMEDIA_TESTS)

Platforms

ni-media requires a c++14 compliant compiler and is currently supported and tested on these platforms:

  • Windows ( requires Visual Studio 2015 Update 3 or higher )
  • Mac OS X ( requires Xcode / Clang 7.3 or higher )
  • iOS ( requires Xcode / Clang 7.3 or higher )
  • Linux ( requires GCC 5.0 or higher, Clang 7.3 or higher should also work )

Building

First, build and install boost filesystem, iostream, system and program-option to path/to/dependencies. Optionally install any codecs that you want to use, for example flac and ogg-vorbis. Now configure ni-media with CMake (version 3.16.0 or higher is required)

cmake -G YOUR-PROJECT-GENERATOR -DCMAKE_PREFIX_PATH=path/to/dependencies/ path/to/ni-media

Specific codecs can be enabled / disabled by passing additional CMake options.

We can now build ni-media:

cmake --build . 

Testing

googletest is required for testing and needs to be installed to path/to/dependencies. The unit tests can be enabled with CMake option NIMEDIA_TESTS.

cmake -G YOUR-PROJECT-GENERATOR -DCMAKE_PREFIX_PATH=path/to/dependencies/ -DNIMEDIA_TESTS=ON path/to/ni-media

Before running the tests some reference test files need to be downloaded using git-lfs:

git lfs pull -X ""

To execute the tests run:

cmake --build . --target test

Contributions

We very much appreciate your contribution! If you want to contribute please get in touch with the maintainers:

Please run clang-format with the provided .clang-format file and if possible add some tests when opening a pull request.

ni-media's People

Contributors

andre-bergner avatar benvenutti avatar falconpdx avatar lmdsp avatar marcrambo avatar mpoullet avatar ni-abendrien avatar ni-mheppner avatar ni-nkozlowski avatar ni-swastl avatar stk-ableton avatar timblechmann avatar wro-ableton avatar

Stargazers

 avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar

Watchers

 avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar

ni-media's Issues

Supported File Formats

I just used libsndfile for a library, but this looks like a great contender.

Is there documentation on what formats are supported? I could find wav and aiff subfolders, and now I am guessing those are the supported file formats?

Compiler warning in positioning.h

/home/wolfv/Programs/ni-media/audiostream/src/ni/media/iostreams/positioning.h:35:14: warning: enumeration value '_S_ios_seekdir_end' not handled in switch [-Wswitch]

As it's the only warning and seems easy to solve, would be nice! :)

Getting the exact number of frames from a stream

Hi There !

We're investigating how to handle loading wav files whose size - as declared in the RIFF header - is incorrect and a lot larger than the data actually contained in the file.

In such cases, we would like to crop the sound to the actual data and ideally, be able to determine the exact size without having to read the whole file upfront.

As expected, ifstream::num_frames will return the value read in the header.

However, the documentation states:

num_frames may differ from the actual number of frames in the stream
as this information relies on the codec. The only way to obtain the exact
number of frames is by seeking to the end of stream and retrieving the frame position.

So, we're trying to use ifstream::frame_tellg but it seems to return the same value as num_frame.

Here's an example code that evaluates the number of frame using num_frames, frame_seekg and by reading the data,.

  // Build a ifstream
  const auto filePath = makeTestFilePath("BB3_100_drum_break_paprika.wav");
  auto stream = audio::ifstream{filePath.string()};

  // Get the number of frames reported
  const auto reportedFrameNum = stream.info().num_frames();

  // Position the stream at the end
  stream.frame_seekg(0, std::ios_base::end);
  const auto seekedNumFrame = size_t(stream.frame_tellg());

  // Read the data until exhaustion to get the actual data contained in the file
  const auto dataFrameNum = [&]() {

    stream.frame_seekg(0, std::ios_base::beg);
    size_t frameCount{0};

    constexpr std::size_t kNiMediaReadChunkSize = 4096 / sizeof(float);
    const auto samplesPerChunk =
      std::min<std::size_t>(kNiMediaReadChunkSize, reportedFrameNum);
    std::vector<float> data(samplesPerChunk * stream.info().num_channels(), 0.0f);

    while (stream.read((char*)data.data(), std::streamsize(samplesPerChunk)))
    {
      frameCount += stream.frame_gcount();
    }

    return frameCount;
  }();

  std::cout << "Number of frames returning by num_frames " << reportedFrameNum
            << std::endl;
  std::cout << "Number of frames in the file " << dataFrameNum << std::endl;
  std::cout << "Number of frames from seeking " << seekedNumFrame << std::endl;

  CHECK(seekedNumFrame == dataFrameNum);

The output will be

Number of frames returning by num_frames 423360
Number of frames in the file 98090
Number of frames from seeking 423360

our expectation would be that seeking would also return 98090.

Is this the api we're supposed to use ? is there another way ?

Cheers.

PS: Here's the file this test was ran with BB3_100_drum_break_paprika.zip

Unable to sample_seekg to the last sample in an AIFF file

Using an AIFF file as input, I am unable to sample_seekg to the last sample in the file. If, however, I read the file sequentially using the extraction operator, I can read all samples in the file (including the last one). I tested this on 7e2de4b.

The following example shows the issue:

    auto in = audio::ifstream{getSamplePath("sample.aif")};
    const auto inputSampleCount =
      static_cast<int>(in.seekg(0, std::ios::end).sample_tellg());

    float value;
    if (in.sample_seekg(inputSampleCount - 1) >> value)
    {
        // this code is never executed
    }

My expectation would have been to be able to sample_seekg to all samples in the file, understanding its argument as an index from zero to inputSampleCount - 1.

Consider the following code, using the same input as above:

    auto in = audio::ifstream{getSamplePath("sample.aif")};
    const auto inputSampleCount =
      static_cast<int>(in.seekg(0, std::ios::end).sample_tellg());

    auto readCount = 0;
    float value;
    in.seekg(0, std::ios::beg);
    while (in >> value)
    {
      ++readCount;
    }

At the end of the execution, readCount == inputSampleCount (as expected).

Furthermore, consider the following example in which each sample is sample_seekg to individually:

    auto in = audio::ifstream{getSamplePath("sample.aif")};
    const auto inputSampleCount =
      static_cast<int>(in.seekg(0, std::ios::end).sample_tellg());

    auto readCount = 0;
    float value;
    in.seekg(0, std::ios::beg);
    while (in.sample_seekg(readCount) >> value)
    {
      ++readCount;
      if (readCount == inputSampleCount)
      {
        break;
      }
    }

At the end of the execution, readCount == inputSampleCount - 1, which is not what I expected (I expected readCount == inputSampleCount).

Am I understanding the API incorrectly here?

Parsing large wav files may end up in infinite loop

See #63.

We've noticed that the bitmask 0xfffffe used to pad chunks while reading wave files could cause the seek position to be corrupted when seeking to positions larger than the bitmask. In the worst case, as encountered by us, this may end up in an infinite loop as the parser would start interpreting random parts of the file as chunk id and size and would move randomly through the file, possibly never leaving the loop.

We think this is a rather critical issue.

Tests are not building on windows with LINK : fatal error LNK1104: cannot open file 'libboost_filesystem-vc142-mt-x64-1_74.lib'

Can not build tests in following setup:

  • Windows 10
  • cmake: 3.17.3
  • Visual Studio 2019
  • boost 1.74.0 (also tried with boost 1.73.0)
  • gtest 1.10.0

Build log looks like:

Build log with not able to find boost library
C:\tmp\ni-media\build>cmake --build . --config Release
Microsoft (R) Build Engine version 16.6.0+5ff7b0c9e for .NET Framework
Copyright (C) Microsoft Corporation. All rights reserved.
  Checking Build System
  Building Custom Rule C:/tmp/ni-media/audiostream/CMakeLists.txt
  iotools.cpp
  stream_info.cpp
  istream.cpp
  ostream.cpp
  ivectorstream.cpp
  ifstream.cpp
  ofstream.cpp
  ifvectorstream.cpp
  fstream_info.cpp
  ifstream_info.cpp
  ofstream_info.cpp
  aiff_ofstream.cpp
  wav_ofstream.cpp
  Generating Code...
  audiostream.vcxproj -> C:\tmp\ni-media\build\audiostream\Release\audiostream.lib
  Building Custom Rule C:/tmp/ni-media/audiostream/test/CMakeLists.txt
  gtest_main.cpp
  test_helper.cpp
  source_test.cpp
  stream_buffer.test.cpp
  istream_read_signed_integer.test.cpp
  istream_read_unsigned_integer.test.cpp
  istream_read_floating_point.test.cpp
  ifstream.test.cpp
  ifstream_robustness.test.cpp
  ifvectorstream.test.cpp
  ivectorstream.test.cpp
  ofstream.test.cpp
  aiff_ifstream_info.test.cpp
  aiff_source.test.cpp
  aiff_sink.test.cpp
  wav_ifstream_info.test.cpp
  wav_source.test.cpp
  wav_ofstream_info.test.cpp
  wav_sink.test.cpp
  Generating Code...
LINK : fatal error LNK1104: cannot open file 'libboost_filesystem-vc142-mt-x64-1_74.lib' [C:\tmp\ni-media\build\audiostream\test\audiostre
am_test.vcxproj]
  Building Custom Rule C:/tmp/ni-media/audiostream/test/CMakeLists.txt
  generator.cpp
LINK : fatal error LNK1104: cannot open file 'libboost_program_options-vc142-mt-x64-1_74.lib' [C:\tmp\ni-media\build\audiostream\test\gene
rator.vcxproj]
  Building Custom Rule C:/tmp/ni-media/pcm/test/CMakeLists.txt

When I explicitly add that lib to link paths I get:

Build log with extra link path
C:\tmp\ni-media\build>cmake --build . --config Release
Microsoft (R) Build Engine version 16.6.0+5ff7b0c9e for .NET Framework
Copyright (C) Microsoft Corporation. All rights reserved.
  Checking Build System
  Building Custom Rule C:/tmp/ni-media/audiostream/CMakeLists.txt
  iotools.cpp
  stream_info.cpp
  istream.cpp
  ostream.cpp
  ivectorstream.cpp
  ifstream.cpp
  ofstream.cpp
  ifvectorstream.cpp
  fstream_info.cpp
  ifstream_info.cpp
  ofstream_info.cpp
  aiff_ofstream.cpp
  wav_ofstream.cpp
  Generating Code...
  audiostream.vcxproj -> C:\tmp\ni-media\build\audiostream\Release\audiostream.lib
  Building Custom Rule C:/tmp/ni-media/audiostream/test/CMakeLists.txt
  gtest_main.cpp
  test_helper.cpp
  source_test.cpp
  stream_buffer.test.cpp
  istream_read_signed_integer.test.cpp
  istream_read_unsigned_integer.test.cpp
  istream_read_floating_point.test.cpp
  ifstream.test.cpp
  ifstream_robustness.test.cpp
  ifvectorstream.test.cpp
  ivectorstream.test.cpp
  ofstream.test.cpp
  aiff_ifstream_info.test.cpp
  aiff_source.test.cpp
  aiff_sink.test.cpp
  wav_ifstream_info.test.cpp
  wav_source.test.cpp
  wav_ofstream_info.test.cpp
  wav_sink.test.cpp
  Generating Code...
  audiostream_test.vcxproj -> C:\tmp\ni-media\build\audiostream\test\Release\audiostream_test.exe
  Building Custom Rule C:/tmp/ni-media/audiostream/test/CMakeLists.txt
  generator.cpp
libboost_program_options-vc142-mt-x64-1_74.lib(value_semantic.obj) : error LNK2005: "public: __cdecl boost::program_options::error_with_op
tion_name::error_with_option_name(class std::basic_string<char,struct std::char_traits<char>,class std::allocator<char> > const &,class st
d::basic_string<char,struct std::char_traits<char>,class std::allocator<char> > const &,class std::basic_string<char,struct std::char_trai
ts<char>,class std::allocator<char> > const &,int)" (??0error_with_option_name@program_options@boost@@QEAA@AEBV?$basic_string@DU?$char_tra
its@D@std@@V?$allocator@D@2@@std@@00H@Z) already defined in boost_program_options-vc142-mt-x64-1_74.lib(boost_program_options-vc142-mt-x64
-1_74.dll) [C:\tmp\ni-media\build\audiostream\test\generator.vcxproj]
libboost_program_options-vc142-mt-x64-1_74.lib(value_semantic.obj) : error LNK2005: "public: __cdecl boost::program_options::invalid_optio
n_value::invalid_option_value(class std::basic_string<char,struct std::char_traits<char>,class std::allocator<char> > const &)" (??0invali
d_option_value@program_options@boost@@QEAA@AEBV?$basic_string@DU?$char_traits@D@std@@V?$allocator@D@2@@std@@@Z) already defined in boost_p
rogram_options-vc142-mt-x64-1_74.lib(boost_program_options-vc142-mt-x64-1_74.dll) [C:\tmp\ni-media\build\audiostream\test\generator.vcxpro
j]
libboost_program_options-vc142-mt-x64-1_74.lib(value_semantic.obj) : error LNK2005: "void __cdecl boost::program_options::validators::chec
k_first_occurrence(class boost::any const &)" (?check_first_occurrence@validators@program_options@boost@@YAXAEBVany@3@@Z) already defined
in boost_program_options-vc142-mt-x64-1_74.lib(boost_program_options-vc142-mt-x64-1_74.dll) [C:\tmp\ni-media\build\audiostream\test\genera
tor.vcxproj]
libboost_program_options-vc142-mt-x64-1_74.lib(value_semantic.obj) : error LNK2005: "protected: class std::basic_string<char,struct std::c
har_traits<char>,class std::allocator<char> > __cdecl boost::program_options::validation_error::get_template(enum boost::program_options::
validation_error::kind_t)" (?get_template@validation_error@program_options@boost@@IEAA?AV?$basic_string@DU?$char_traits@D@std@@V?$allocato
r@D@2@@std@@W4kind_t@123@@Z) already defined in boost_program_options-vc142-mt-x64-1_74.lib(boost_program_options-vc142-mt-x64-1_74.dll) [
C:\tmp\ni-media\build\audiostream\test\generator.vcxproj]
libboost_program_options-vc142-mt-x64-1_74.lib(value_semantic.obj) : error LNK2005: "private: virtual void __cdecl boost::program_options:
:value_semantic_codecvt_helper<char>::parse(class boost::any &,class std::vector<class std::basic_string<char,struct std::char_traits<char
>,class std::allocator<char> >,class std::allocator<class std::basic_string<char,struct std::char_traits<char>,class std::allocator<char>
> > > const &,bool)const " (?parse@?$value_semantic_codecvt_helper@D@program_options@boost@@EEBAXAEAVany@3@AEBV?$vector@V?$basic_string@DU
?$char_traits@D@std@@V?$allocator@D@2@@std@@V?$allocator@V?$basic_string@DU?$char_traits@D@std@@V?$allocator@D@2@@std@@@2@@std@@_N@Z) alre
ady defined in boost_program_options-vc142-mt-x64-1_74.lib(boost_program_options-vc142-mt-x64-1_74.dll) [C:\tmp\ni-media\build\audiostream
\test\generator.vcxproj]
libboost_program_options-vc142-mt-x64-1_74.lib(value_semantic.obj) : error LNK2005: "protected: virtual void __cdecl boost::program_option
s::error_with_option_name::substitute_placeholders(class std::basic_string<char,struct std::char_traits<char>,class std::allocator<char> >
 const &)const " (?substitute_placeholders@error_with_option_name@program_options@boost@@MEBAXAEBV?$basic_string@DU?$char_traits@D@std@@V?
$allocator@D@2@@std@@@Z) already defined in boost_program_options-vc142-mt-x64-1_74.lib(boost_program_options-vc142-mt-x64-1_74.dll) [C:\t
mp\ni-media\build\audiostream\test\generator.vcxproj]
libboost_program_options-vc142-mt-x64-1_74.lib(value_semantic.obj) : error LNK2005: "void __cdecl boost::program_options::validate(class b
oost::any &,class std::vector<class std::basic_string<char,struct std::char_traits<char>,class std::allocator<char> >,class std::allocator
<class std::basic_string<char,struct std::char_traits<char>,class std::allocator<char> > > > const &,class std::basic_string<char,struct s
td::char_traits<char>,class std::allocator<char> > *,int)" (?validate@program_options@boost@@YAXAEAVany@2@AEBV?$vector@V?$basic_string@DU?
$char_traits@D@std@@V?$allocator@D@2@@std@@V?$allocator@V?$basic_string@DU?$char_traits@D@std@@V?$allocator@D@2@@std@@@2@@std@@PEAV?$basic
_string@DU?$char_traits@D@std@@V?$allocator@D@2@@5@H@Z) already defined in boost_program_options-vc142-mt-x64-1_74.lib(boost_program_optio
ns-vc142-mt-x64-1_74.dll) [C:\tmp\ni-media\build\audiostream\test\generator.vcxproj]
libboost_program_options-vc142-mt-x64-1_74.lib(value_semantic.obj) : error LNK2005: "public: virtual char const * __cdecl boost::program_o
ptions::error_with_option_name::what(void)const " (?what@error_with_option_name@program_options@boost@@UEBAPEBDXZ) already defined in boos
t_program_options-vc142-mt-x64-1_74.lib(boost_program_options-vc142-mt-x64-1_74.dll) [C:\tmp\ni-media\build\audiostream\test\generator.vcx
proj]
libboost_program_options-vc142-mt-x64-1_74.lib(options_description.obj) : error LNK2005: "public: __cdecl boost::program_options::options_
description::options_description(class std::basic_string<char,struct std::char_traits<char>,class std::allocator<char> > const &,unsigned
int,unsigned int)" (??0options_description@program_options@boost@@QEAA@AEBV?$basic_string@DU?$char_traits@D@std@@V?$allocator@D@2@@std@@II
@Z) already defined in boost_program_options-vc142-mt-x64-1_74.lib(boost_program_options-vc142-mt-x64-1_74.dll) [C:\tmp\ni-media\build\aud
iostream\test\generator.vcxproj]
libboost_program_options-vc142-mt-x64-1_74.lib(options_description.obj) : error LNK2005: "class std::basic_ostream<char,struct std::char_t
raits<char> > & __cdecl boost::program_options::operator<<(class std::basic_ostream<char,struct std::char_traits<char> > &,class boost::pr
ogram_options::options_description const &)" (??6program_options@boost@@YAAEAV?$basic_ostream@DU?$char_traits@D@std@@@std@@AEAV23@AEBVopti
ons_description@01@@Z) already defined in boost_program_options-vc142-mt-x64-1_74.lib(boost_program_options-vc142-mt-x64-1_74.dll) [C:\tmp
\ni-media\build\audiostream\test\generator.vcxproj]
libboost_program_options-vc142-mt-x64-1_74.lib(options_description.obj) : error LNK2005: "public: class boost::program_options::options_de
scription_easy_init & __cdecl boost::program_options::options_description_easy_init::operator()(char const *,char const *)" (??Roptions_de
scription_easy_init@program_options@boost@@QEAAAEAV012@PEBD0@Z) already defined in boost_program_options-vc142-mt-x64-1_74.lib(boost_progr
am_options-vc142-mt-x64-1_74.dll) [C:\tmp\ni-media\build\audiostream\test\generator.vcxproj]
libboost_program_options-vc142-mt-x64-1_74.lib(options_description.obj) : error LNK2005: "public: class boost::program_options::options_de
scription_easy_init & __cdecl boost::program_options::options_description_easy_init::operator()(char const *,class boost::program_options:
:value_semantic const *,char const *)" (??Roptions_description_easy_init@program_options@boost@@QEAAAEAV012@PEBDPEBVvalue_semantic@12@0@Z)
 already defined in boost_program_options-vc142-mt-x64-1_74.lib(boost_program_options-vc142-mt-x64-1_74.dll) [C:\tmp\ni-media\build\audios
tream\test\generator.vcxproj]
libboost_program_options-vc142-mt-x64-1_74.lib(options_description.obj) : error LNK2005: "public: class boost::program_options::options_de
scription_easy_init __cdecl boost::program_options::options_description::add_options(void)" (?add_options@options_description@program_opti
ons@boost@@QEAA?AVoptions_description_easy_init@23@XZ) already defined in boost_program_options-vc142-mt-x64-1_74.lib(boost_program_option
s-vc142-mt-x64-1_74.dll) [C:\tmp\ni-media\build\audiostream\test\generator.vcxproj]
libboost_program_options-vc142-mt-x64-1_74.lib(convert.obj) : error LNK2005: "class std::basic_string<char,struct std::char_traits<char>,c
lass std::allocator<char> > __cdecl boost::program_options::to_internal(class std::basic_string<char,struct std::char_traits<char>,class s
td::allocator<char> > const &)" (?to_internal@program_options@boost@@YA?AV?$basic_string@DU?$char_traits@D@std@@V?$allocator@D@2@@std@@AEB
V34@@Z) already defined in boost_program_options-vc142-mt-x64-1_74.lib(boost_program_options-vc142-mt-x64-1_74.dll) [C:\tmp\ni-media\build
\audiostream\test\generator.vcxproj]
C:\tmp\ni-media\build\audiostream\test\Release\generator.exe : fatal error LNK1169: one or more multiply defined symbols found [C:\tmp\ni-
media\build\audiostream\test\generator.vcxproj]
  Building Custom Rule C:/tmp/ni-media/pcm/test/CMakeLists.txt

Am I doing something wrong here?

P.S.: I also tried to add all dependencies through conan, that ensures that all libraries are being linked but got same result.

AAC Encoding?

Long time no see :)

Wondering if you gang have looked at supporting encoding, and is it realistic to support encoding AAC? Not sure the state of OS support, but could make bandwidth to work on this topic if its viable

Cheers

boost ERROR?

boost-1.69/boost/integer_traits.hpp:83:46: error: 'CHAR_MIN' was not declared in this scope
boost-1.69/boost/integer_traits.hpp:83:46: note: suggested alternative: '_SC_CHAR_MIN'

Converting OGG to WAV

Hello! Is it possible to decode OGG to WAV file using ni-media? If yes, could you provide some examples?

Compilation issues

I've tried to build it (Ubuntu 16.04 / x64) with Clang 5.0 and GCC 7.0 with no luck.

Maybe could someone help me understand what the problem is:

mpoullet@ub-mpoullet:~/Documents/AV/ni-media (master u=)$ mkdir build
mpoullet@ub-mpoullet:~/Documents/AV/ni-media (master u=)$ cd build/
mpoullet@ub-mpoullet:~/Documents/AV/ni-media/build (master u=)$ CC=gcc-7 CXX=g++-7 cmake ..
-- The C compiler identification is GNU 7.2.0
-- The CXX compiler identification is GNU 7.2.0
-- Check for working C compiler: /usr/bin/gcc-7
-- Check for working C compiler: /usr/bin/gcc-7 -- works
-- Detecting C compiler ABI info
-- Detecting C compiler ABI info - done
-- Detecting C compile features
-- Detecting C compile features - done
-- Check for working CXX compiler: /usr/bin/g++-7
-- Check for working CXX compiler: /usr/bin/g++-7 -- works
-- Detecting CXX compiler ABI info
-- Detecting CXX compiler ABI info - done
-- Detecting CXX compile features
-- Detecting CXX compile features - done
-- Found GTest: /usr/lib/libgtest.a  
-- Looking for pthread.h
-- Looking for pthread.h - found
-- Looking for pthread_create
-- Looking for pthread_create - not found
-- Looking for pthread_create in pthreads
-- Looking for pthread_create in pthreads - not found
-- Looking for pthread_create in pthread
-- Looking for pthread_create in pthread - found
-- Found Threads: TRUE  
-- Boost version: 1.58.0
-- Boost version: 1.58.0
-- Found the following Boost libraries:
--   iostreams
--   filesystem
--   system
--   regex
-- Found Ogg: /usr/include  
-- Found FLAC: /usr/include  
-- Found Vorbis: /usr/include  
-- Configuring done
-- Generating done
-- Build files have been written to: /home/mpoullet/Documents/AV/ni-media/build
mpoullet@ub-mpoullet:~/Documents/AV/ni-media/build (master u=)$ make
Scanning dependencies of target pcm
[  1%] Building CXX object pcm/CMakeFiles/pcm.dir/src/ni/media/pcm/dummy.cpp.o
[  3%] Linking CXX static library libpcm.a
[  3%] Built target pcm
Scanning dependencies of target pcm_test
[  5%] Building CXX object pcm/test/CMakeFiles/pcm_test.dir/main.cpp.o
[  7%] Building CXX object pcm/test/CMakeFiles/pcm_test.dir/ni/media/pcm/format.test.cpp.o
[  9%] Building CXX object pcm/test/CMakeFiles/pcm_test.dir/ni/media/pcm/converter.test.cpp.o
[ 11%] Building CXX object pcm/test/CMakeFiles/pcm_test.dir/ni/media/pcm/dispatch.test.cpp.o
[ 13%] Building CXX object pcm/test/CMakeFiles/pcm_test.dir/ni/media/pcm/limits.test.cpp.o
[ 15%] Building CXX object pcm/test/CMakeFiles/pcm_test.dir/ni/media/pcm/iterator.test.cpp.o
[ 17%] Building CXX object pcm/test/CMakeFiles/pcm_test.dir/ni/media/pcm/iterator_copy_unsigned_integer.test.cpp.o
[ 19%] Building CXX object pcm/test/CMakeFiles/pcm_test.dir/ni/media/pcm/iterator_copy_signed_integer.test.cpp.o
[ 21%] Building CXX object pcm/test/CMakeFiles/pcm_test.dir/ni/media/pcm/iterator_copy_floating_point.test.cpp.o
[ 23%] Building CXX object pcm/test/CMakeFiles/pcm_test.dir/ni/media/pcm/detail/tuple_find.test.cpp.o
[ 25%] Building CXX object pcm/test/CMakeFiles/pcm_test.dir/ni/media/pcm/detail/tuple_to_array.test.cpp.o
[ 27%] Linking CXX executable pcm_test
[ 27%] Built target pcm_test
Scanning dependencies of target audiostream
[ 29%] Building CXX object audiostream/CMakeFiles/audiostream.dir/src/ni/media/audio/iotools.cpp.o
[ 31%] Building CXX object audiostream/CMakeFiles/audiostream.dir/src/ni/media/audio/stream_info.cpp.o
[ 33%] Building CXX object audiostream/CMakeFiles/audiostream.dir/src/ni/media/audio/istream.cpp.o
[ 35%] Building CXX object audiostream/CMakeFiles/audiostream.dir/src/ni/media/audio/istream_info.cpp.o
[ 37%] Building CXX object audiostream/CMakeFiles/audiostream.dir/src/ni/media/audio/ostream.cpp.o
[ 39%] Building CXX object audiostream/CMakeFiles/audiostream.dir/src/ni/media/audio/ivectorstream.cpp.o
[ 41%] Building CXX object audiostream/CMakeFiles/audiostream.dir/src/ni/media/audio/ifstream.cpp.o
[ 43%] Building CXX object audiostream/CMakeFiles/audiostream.dir/src/ni/media/audio/ofstream.cpp.o
[ 45%] Building CXX object audiostream/CMakeFiles/audiostream.dir/src/ni/media/audio/ifvectorstream.cpp.o
[ 47%] Building CXX object audiostream/CMakeFiles/audiostream.dir/src/ni/media/audio/fstream_info.cpp.o
[ 49%] Building CXX object audiostream/CMakeFiles/audiostream.dir/src/ni/media/audio/ifstream_info.cpp.o
[ 50%] Building CXX object audiostream/CMakeFiles/audiostream.dir/src/ni/media/audio/ofstream_info.cpp.o
[ 52%] Building CXX object audiostream/CMakeFiles/audiostream.dir/src/ni/media/audio/wav/wav_ofstream.cpp.o
[ 54%] Building CXX object audiostream/CMakeFiles/audiostream.dir/src/ni/media/audio/source/flac_file_source.cpp.o
[ 56%] Building CXX object audiostream/CMakeFiles/audiostream.dir/src/ni/media/audio/source/ogg_file_source.cpp.o
[ 58%] Linking CXX static library libaudiostream.a
[ 58%] Built target audiostream
Scanning dependencies of target audiostream_test
[ 60%] Building CXX object audiostream/test/CMakeFiles/audiostream_test.dir/main.cpp.o
[ 62%] Building CXX object audiostream/test/CMakeFiles/audiostream_test.dir/ni/media/test_helper.cpp.o
In file included from /usr/include/boost/range/algorithm/find_if.hpp:12:0,
                 from /home/mpoullet/Documents/AV/ni-media/pcm/inc/ni/media/pcm/runtime_format.h:30,
                 from /home/mpoullet/Documents/AV/ni-media/pcm/inc/ni/media/pcm/format.h:27,
                 from /home/mpoullet/Documents/AV/ni-media/audiostream/inc/ni/media/audio/stream_info.h:25,
                 from /home/mpoullet/Documents/AV/ni-media/audiostream/inc/ni/media/audio/istream_info.h:25,
                 from /home/mpoullet/Documents/AV/ni-media/audiostream/inc/ni/media/audio/ifstream_info.h:26,
                 from /home/mpoullet/Documents/AV/ni-media/audiostream/test/../src/ni/media/audio/iotools.h:25,
                 from /home/mpoullet/Documents/AV/ni-media/audiostream/test/ni/media/test_helper.cpp:23:
/usr/include/boost/concept_check.hpp: In instantiation of ‘boost::Convertible<X, Y>::~Convertible() [with X = boost::iterators::single_pass_traversal_tag; Y = boost::iterators::forward_traversal_tag]’:
/usr/include/boost/concept/detail/general.hpp:38:28:   required from ‘static void boost::concepts::requirement<boost::concepts::failed************ Model::************>::failed() [with Model = boost::Convertible<boost::iterators::single_pass_traversal_tag, boost::iterators::forward_traversal_tag>]’
/usr/include/boost/range/concepts.hpp:189:13:   required from ‘struct boost::range_detail::ForwardIteratorConcept<boost::iterators::transform_iterator<boost::range_detail::default_constructible_unary_fn_wrapper<{anonymous}::supported_files(const boost::filesystem::path&, boost::optional<audio::ifstream_info::container_type>)::<lambda(const boost::filesystem::path&)>, std::__cxx11::basic_string<char> >, boost::filesystem::recursive_directory_iterator, boost::iterators::use_default, boost::iterators::use_default> >’
/usr/include/boost/concept/detail/has_constraints.hpp:32:62:   required by substitution of ‘template<class Model> boost::concepts::detail::yes boost::concepts::detail::has_constraints_(Model*, boost::concepts::detail::wrap_constraints<Model, (& Model:: constraints)>*) [with Model = boost::range_detail::ForwardIteratorConcept<boost::iterators::transform_iterator<boost::range_detail::default_constructible_unary_fn_wrapper<{anonymous}::supported_files(const boost::filesystem::path&, boost::optional<audio::ifstream_info::container_type>)::<lambda(const boost::filesystem::path&)>, std::__cxx11::basic_string<char> >, boost::filesystem::recursive_directory_iterator, boost::iterators::use_default, boost::iterators::use_default> >]’
/usr/include/boost/concept/detail/has_constraints.hpp:42:5:   required from ‘const bool boost::concepts::not_satisfied<boost::range_detail::ForwardIteratorConcept<boost::iterators::transform_iterator<boost::range_detail::default_constructible_unary_fn_wrapper<{anonymous}::supported_files(const boost::filesystem::path&, boost::optional<audio::ifstream_info::container_type>)::<lambda(const boost::filesystem::path&)>, std::__cxx11::basic_string<char> >, boost::filesystem::recursive_directory_iterator, boost::iterators::use_default, boost::iterators::use_default> > >::value’
/usr/include/boost/concept/detail/has_constraints.hpp:45:31:   required from ‘struct boost::concepts::not_satisfied<boost::range_detail::ForwardIteratorConcept<boost::iterators::transform_iterator<boost::range_detail::default_constructible_unary_fn_wrapper<{anonymous}::supported_files(const boost::filesystem::path&, boost::optional<audio::ifstream_info::container_type>)::<lambda(const boost::filesystem::path&)>, std::__cxx11::basic_string<char> >, boost::filesystem::recursive_directory_iterator, boost::iterators::use_default, boost::iterators::use_default> > >’
/usr/include/boost/mpl/if.hpp:63:11:   [ skipping 4 instantiation contexts, use -ftemplate-backtrace-limit=0 to disable ]
/usr/include/boost/concept/detail/has_constraints.hpp:42:5:   required from ‘const bool boost::concepts::not_satisfied<boost::ForwardRangeConcept<const boost::range_detail::transformed_range<{anonymous}::supported_files(const boost::filesystem::path&, boost::optional<audio::ifstream_info::container_type>)::<lambda(const boost::filesystem::path&)>, const boost::iterator_range<boost::filesystem::recursive_directory_iterator> > > >::value’
/usr/include/boost/concept/detail/has_constraints.hpp:45:31:   required from ‘struct boost::concepts::not_satisfied<boost::ForwardRangeConcept<const boost::range_detail::transformed_range<{anonymous}::supported_files(const boost::filesystem::path&, boost::optional<audio::ifstream_info::container_type>)::<lambda(const boost::filesystem::path&)>, const boost::iterator_range<boost::filesystem::recursive_directory_iterator> > > >’
/usr/include/boost/mpl/if.hpp:63:11:   required from ‘struct boost::mpl::if_<boost::concepts::not_satisfied<boost::ForwardRangeConcept<const boost::range_detail::transformed_range<{anonymous}::supported_files(const boost::filesystem::path&, boost::optional<audio::ifstream_info::container_type>)::<lambda(const boost::filesystem::path&)>, const boost::iterator_range<boost::filesystem::recursive_directory_iterator> > > >, boost::concepts::constraint<boost::ForwardRangeConcept<const boost::range_detail::transformed_range<{anonymous}::supported_files(const boost::filesystem::path&, boost::optional<audio::ifstream_info::container_type>)::<lambda(const boost::filesystem::path&)>, const boost::iterator_range<boost::filesystem::recursive_directory_iterator> > > >, boost::concepts::requirement<boost::concepts::failed************ boost::ForwardRangeConcept<const boost::range_detail::transformed_range<{anonymous}::supported_files(const boost::filesystem::path&, boost::optional<audio::ifstream_info::container_type>)::<lambda(const boost::filesystem::path&)>, const boost::iterator_range<boost::filesystem::recursive_directory_iterator> > >::************> >’
/usr/include/boost/concept/detail/general.hpp:50:8:   required from ‘struct boost::concepts::requirement_<void (*)(boost::ForwardRangeConcept<const boost::range_detail::transformed_range<{anonymous}::supported_files(const boost::filesystem::path&, boost::optional<audio::ifstream_info::container_type>)::<lambda(const boost::filesystem::path&)>, const boost::iterator_range<boost::filesystem::recursive_directory_iterator> > >)>’
/usr/include/boost/range/adaptor/filtered.hpp:73:13:   required from ‘boost::range_detail::filtered_range<Predicate, const ForwardRange> boost::range_detail::operator|(const ForwardRange&, const boost::range_detail::filter_holder<Predicate>&) [with ForwardRange = boost::range_detail::transformed_range<{anonymous}::supported_files(const boost::filesystem::path&, boost::optional<audio::ifstream_info::container_type>)::<lambda(const boost::filesystem::path&)>, const boost::iterator_range<boost::filesystem::recursive_directory_iterator> >; Predicate = {anonymous}::supported_files(const boost::filesystem::path&, boost::optional<audio::ifstream_info::container_type>)::<lambda(const auto:2&)>]’
/home/mpoullet/Documents/AV/ni-media/audiostream/test/ni/media/test_helper.cpp:64:38:   required from here
/usr/include/boost/concept_check.hpp:210:13: error: conversion from ‘boost::iterators::single_pass_traversal_tag’ to non-scalar type ‘boost::iterators::forward_traversal_tag’ requested
       Y y = x;
             ^
In file included from /usr/include/boost/range/algorithm/find_if.hpp:15:0,
                 from /home/mpoullet/Documents/AV/ni-media/pcm/inc/ni/media/pcm/runtime_format.h:30,
                 from /home/mpoullet/Documents/AV/ni-media/pcm/inc/ni/media/pcm/format.h:27,
                 from /home/mpoullet/Documents/AV/ni-media/audiostream/inc/ni/media/audio/stream_info.h:25,
                 from /home/mpoullet/Documents/AV/ni-media/audiostream/inc/ni/media/audio/istream_info.h:25,
                 from /home/mpoullet/Documents/AV/ni-media/audiostream/inc/ni/media/audio/ifstream_info.h:26,
                 from /home/mpoullet/Documents/AV/ni-media/audiostream/test/../src/ni/media/audio/iotools.h:25,
                 from /home/mpoullet/Documents/AV/ni-media/audiostream/test/ni/media/test_helper.cpp:23:
/usr/include/boost/range/concepts.hpp: In instantiation of ‘boost::range_detail::ForwardIteratorConcept<Iterator>::~ForwardIteratorConcept() [with Iterator = boost::iterators::transform_iterator<boost::range_detail::default_constructible_unary_fn_wrapper<{anonymous}::supported_files(const boost::filesystem::path&, boost::optional<audio::ifstream_info::container_type>)::<lambda(const boost::filesystem::path&)>, std::__cxx11::basic_string<char> >, boost::filesystem::recursive_directory_iterator, boost::iterators::use_default, boost::iterators::use_default>]’:
/usr/include/boost/concept/detail/general.hpp:38:28:   required from ‘static void boost::concepts::requirement<boost::concepts::failed************ Model::************>::failed() [with Model = boost::range_detail::ForwardIteratorConcept<boost::iterators::transform_iterator<boost::range_detail::default_constructible_unary_fn_wrapper<{anonymous}::supported_files(const boost::filesystem::path&, boost::optional<audio::ifstream_info::container_type>)::<lambda(const boost::filesystem::path&)>, std::__cxx11::basic_string<char> >, boost::filesystem::recursive_directory_iterator, boost::iterators::use_default, boost::iterators::use_default> >]’
/usr/include/boost/range/concepts.hpp:319:9:   required from ‘struct boost::ForwardRangeConcept<const boost::range_detail::transformed_range<{anonymous}::supported_files(const boost::filesystem::path&, boost::optional<audio::ifstream_info::container_type>)::<lambda(const boost::filesystem::path&)>, const boost::iterator_range<boost::filesystem::recursive_directory_iterator> > >’
/usr/include/boost/concept/detail/has_constraints.hpp:32:62:   required by substitution of ‘template<class Model> boost::concepts::detail::yes boost::concepts::detail::has_constraints_(Model*, boost::concepts::detail::wrap_constraints<Model, (& Model:: constraints)>*) [with Model = boost::ForwardRangeConcept<const boost::range_detail::transformed_range<{anonymous}::supported_files(const boost::filesystem::path&, boost::optional<audio::ifstream_info::container_type>)::<lambda(const boost::filesystem::path&)>, const boost::iterator_range<boost::filesystem::recursive_directory_iterator> > >]’
/usr/include/boost/concept/detail/has_constraints.hpp:42:5:   required from ‘const bool boost::concepts::not_satisfied<boost::ForwardRangeConcept<const boost::range_detail::transformed_range<{anonymous}::supported_files(const boost::filesystem::path&, boost::optional<audio::ifstream_info::container_type>)::<lambda(const boost::filesystem::path&)>, const boost::iterator_range<boost::filesystem::recursive_directory_iterator> > > >::value’
/usr/include/boost/concept/detail/has_constraints.hpp:45:31:   required from ‘struct boost::concepts::not_satisfied<boost::ForwardRangeConcept<const boost::range_detail::transformed_range<{anonymous}::supported_files(const boost::filesystem::path&, boost::optional<audio::ifstream_info::container_type>)::<lambda(const boost::filesystem::path&)>, const boost::iterator_range<boost::filesystem::recursive_directory_iterator> > > >’
/usr/include/boost/mpl/if.hpp:63:11:   required from ‘struct boost::mpl::if_<boost::concepts::not_satisfied<boost::ForwardRangeConcept<const boost::range_detail::transformed_range<{anonymous}::supported_files(const boost::filesystem::path&, boost::optional<audio::ifstream_info::container_type>)::<lambda(const boost::filesystem::path&)>, const boost::iterator_range<boost::filesystem::recursive_directory_iterator> > > >, boost::concepts::constraint<boost::ForwardRangeConcept<const boost::range_detail::transformed_range<{anonymous}::supported_files(const boost::filesystem::path&, boost::optional<audio::ifstream_info::container_type>)::<lambda(const boost::filesystem::path&)>, const boost::iterator_range<boost::filesystem::recursive_directory_iterator> > > >, boost::concepts::requirement<boost::concepts::failed************ boost::ForwardRangeConcept<const boost::range_detail::transformed_range<{anonymous}::supported_files(const boost::filesystem::path&, boost::optional<audio::ifstream_info::container_type>)::<lambda(const boost::filesystem::path&)>, const boost::iterator_range<boost::filesystem::recursive_directory_iterator> > >::************> >’
/usr/include/boost/concept/detail/general.hpp:50:8:   required from ‘struct boost::concepts::requirement_<void (*)(boost::ForwardRangeConcept<const boost::range_detail::transformed_range<{anonymous}::supported_files(const boost::filesystem::path&, boost::optional<audio::ifstream_info::container_type>)::<lambda(const boost::filesystem::path&)>, const boost::iterator_range<boost::filesystem::recursive_directory_iterator> > >)>’
/usr/include/boost/range/adaptor/filtered.hpp:73:13:   required from ‘boost::range_detail::filtered_range<Predicate, const ForwardRange> boost::range_detail::operator|(const ForwardRange&, const boost::range_detail::filter_holder<Predicate>&) [with ForwardRange = boost::range_detail::transformed_range<{anonymous}::supported_files(const boost::filesystem::path&, boost::optional<audio::ifstream_info::container_type>)::<lambda(const boost::filesystem::path&)>, const boost::iterator_range<boost::filesystem::recursive_directory_iterator> >; Predicate = {anonymous}::supported_files(const boost::filesystem::path&, boost::optional<audio::ifstream_info::container_type>)::<lambda(const auto:2&)>]’
/home/mpoullet/Documents/AV/ni-media/audiostream/test/ni/media/test_helper.cpp:64:38:   required from here
/usr/include/boost/range/concepts.hpp:201:26: error: no matching function for call to ‘boost::iterators::transform_iterator<boost::range_detail::default_constructible_unary_fn_wrapper<{anonymous}::supported_files(const boost::filesystem::path&, boost::optional<audio::ifstream_info::container_type>)::<lambda(const boost::filesystem::path&)>, std::__cxx11::basic_string<char> >, boost::filesystem::recursive_directory_iterator, boost::iterators::use_default, boost::iterators::use_default>::transform_iterator(boost::mpl::eval_if<boost::mpl::and_<boost::is_convertible<std::__cxx11::basic_string<char>, const std::__cxx11::basic_string<char>&>, boost::mpl::not_<boost::is_convertible<boost::iterators::single_pass_traversal_tag, boost::iterators::forward_traversal_tag> >, mpl_::bool_<true>, mpl_::bool_<true>, mpl_::bool_<true> >, boost::mpl::if_<boost::iterators::detail::is_non_proxy_reference<std::__cxx11::basic_string<char>, std::__cxx11::basic_string<char> >, boost::iterators::detail::postfix_increment_proxy<boost::iterators::transform_iterator<boost::range_detail::default_constructible_unary_fn_wrapper<{anonymous}::supported_files(const boost::filesystem::path&, boost::optional<audio::ifstream_info::container_type>)::<lambda(const boost::filesystem::path&)>, std::__cxx11::basic_string<char> >, boost::filesystem::recursive_directory_iterator, boost::iterators::use_default, boost::iterators::use_default> >, boost::iterators::detail::writable_postfix_increment_proxy<boost::iterators::transform_iterator<boost::range_detail::default_constructible_unary_fn_wrapper<{anonymous}::supported_files(const boost::filesystem::path&, boost::optional<audio::ifstream_info::container_type>)::<lambda(const boost::filesystem::path&)>, std::__cxx11::basic_string<char> >, boost::filesystem::recursive_directory_iterator, boost::iterators::use_default, boost::iterators::use_default> > >, boost::mpl::identity<boost::iterators::transform_iterator<boost::range_detail::default_constructible_unary_fn_wrapper<{anonymous}::supported_files(const boost::filesystem::path&, boost::optional<audio::ifstream_info::container_type>)::<lambda(const boost::filesystem::path&)>, std::__cxx11::basic_string<char> >, boost::filesystem::recursive_directory_iterator, boost::iterators::use_default, boost::iterators::use_default> > >::type)’
                 Iterator i2(i++);
                          ^~
In file included from /usr/include/boost/range/adaptor/transformed.hpp:18:0,
                 from /home/mpoullet/Documents/AV/ni-media/audiostream/test/ni/media/test_helper.cpp:29:
/usr/include/boost/iterator/transform_iterator.hpp:107:5: note: candidate: template<class OtherUnaryFunction, class OtherIterator, class OtherReference, class OtherValue> boost::iterators::transform_iterator<UnaryFunction, Iterator, Reference, Value>::transform_iterator(const boost::iterators::transform_iterator<OtherUnaryFunction, OtherIterator, OtherReference, OtherValue>&, typename boost::iterators::enable_if_convertible<OtherIterator, Iterator>::type*, typename boost::iterators::enable_if_convertible<OtherIterator, Iterator>::type*)
     transform_iterator(
     ^~~~~~~~~~~~~~~~~~
/usr/include/boost/iterator/transform_iterator.hpp:107:5: note:   template argument deduction/substitution failed:
In file included from /usr/include/boost/range/algorithm/find_if.hpp:15:0,
                 from /home/mpoullet/Documents/AV/ni-media/pcm/inc/ni/media/pcm/runtime_format.h:30,
                 from /home/mpoullet/Documents/AV/ni-media/pcm/inc/ni/media/pcm/format.h:27,
                 from /home/mpoullet/Documents/AV/ni-media/audiostream/inc/ni/media/audio/stream_info.h:25,
                 from /home/mpoullet/Documents/AV/ni-media/audiostream/inc/ni/media/audio/istream_info.h:25,
                 from /home/mpoullet/Documents/AV/ni-media/audiostream/inc/ni/media/audio/ifstream_info.h:26,
                 from /home/mpoullet/Documents/AV/ni-media/audiostream/test/../src/ni/media/audio/iotools.h:25,
                 from /home/mpoullet/Documents/AV/ni-media/audiostream/test/ni/media/test_helper.cpp:23:
/usr/include/boost/range/concepts.hpp:201:26: note:   ‘boost::mpl::eval_if<boost::mpl::and_<boost::is_convertible<std::__cxx11::basic_string<char>, const std::__cxx11::basic_string<char>&>, boost::mpl::not_<boost::is_convertible<boost::iterators::single_pass_traversal_tag, boost::iterators::forward_traversal_tag> >, mpl_::bool_<true>, mpl_::bool_<true>, mpl_::bool_<true> >, boost::mpl::if_<boost::iterators::detail::is_non_proxy_reference<std::__cxx11::basic_string<char>, std::__cxx11::basic_string<char> >, boost::iterators::detail::postfix_increment_proxy<boost::iterators::transform_iterator<boost::range_detail::default_constructible_unary_fn_wrapper<{anonymous}::supported_files(const boost::filesystem::path&, boost::optional<audio::ifstream_info::container_type>)::<lambda(const boost::filesystem::path&)>, std::__cxx11::basic_string<char> >, boost::filesystem::recursive_directory_iterator, boost::iterators::use_default, boost::iterators::use_default> >, boost::iterators::detail::writable_postfix_increment_proxy<boost::iterators::transform_iterator<boost::range_detail::default_constructible_unary_fn_wrapper<{anonymous}::supported_files(const boost::filesystem::path&, boost::optional<audio::ifstream_info::container_type>)::<lambda(const boost::filesystem::path&)>, std::__cxx11::basic_string<char> >, boost::filesystem::recursive_directory_iterator, boost::iterators::use_default, boost::iterators::use_default> > >, boost::mpl::identity<boost::iterators::transform_iterator<boost::range_detail::default_constructible_unary_fn_wrapper<{anonymous}::supported_files(const boost::filesystem::path&, boost::optional<audio::ifstream_info::container_type>)::<lambda(const boost::filesystem::path&)>, std::__cxx11::basic_string<char> >, boost::filesystem::recursive_directory_iterator, boost::iterators::use_default, boost::iterators::use_default> > >::type {aka boost::iterators::detail::postfix_increment_proxy<boost::iterators::transform_iterator<boost::range_detail::default_constructible_unary_fn_wrapper<{anonymous}::supported_files(const boost::filesystem::path&, boost::optional<audio::ifstream_info::container_type>)::<lambda(const boost::filesystem::path&)>, std::__cxx11::basic_string<char> >, boost::filesystem::recursive_directory_iterator, boost::iterators::use_default, boost::iterators::use_default> >}’ is not derived from ‘const boost::iterators::transform_iterator<UnaryFunc, Iterator, Reference, Value>’
                 Iterator i2(i++);
                          ^~
In file included from /usr/include/boost/range/adaptor/transformed.hpp:18:0,
                 from /home/mpoullet/Documents/AV/ni-media/audiostream/test/ni/media/test_helper.cpp:29:
/usr/include/boost/iterator/transform_iterator.hpp:90:14: note: candidate: boost::iterators::transform_iterator<UnaryFunction, Iterator, Reference, Value>::transform_iterator(const Iterator&) [with UnaryFunc = boost::range_detail::default_constructible_unary_fn_wrapper<{anonymous}::supported_files(const boost::filesystem::path&, boost::optional<audio::ifstream_info::container_type>)::<lambda(const boost::filesystem::path&)>, std::__cxx11::basic_string<char> >; Iterator = boost::filesystem::recursive_directory_iterator; Reference = boost::iterators::use_default; Value = boost::iterators::use_default]
     explicit transform_iterator(Iterator const& x)
              ^~~~~~~~~~~~~~~~~~
/usr/include/boost/iterator/transform_iterator.hpp:90:14: note:   no known conversion for argument 1 from ‘boost::mpl::eval_if<boost::mpl::and_<boost::is_convertible<std::__cxx11::basic_string<char>, const std::__cxx11::basic_string<char>&>, boost::mpl::not_<boost::is_convertible<boost::iterators::single_pass_traversal_tag, boost::iterators::forward_traversal_tag> >, mpl_::bool_<true>, mpl_::bool_<true>, mpl_::bool_<true> >, boost::mpl::if_<boost::iterators::detail::is_non_proxy_reference<std::__cxx11::basic_string<char>, std::__cxx11::basic_string<char> >, boost::iterators::detail::postfix_increment_proxy<boost::iterators::transform_iterator<boost::range_detail::default_constructible_unary_fn_wrapper<{anonymous}::supported_files(const boost::filesystem::path&, boost::optional<audio::ifstream_info::container_type>)::<lambda(const boost::filesystem::path&)>, std::__cxx11::basic_string<char> >, boost::filesystem::recursive_directory_iterator, boost::iterators::use_default, boost::iterators::use_default> >, boost::iterators::detail::writable_postfix_increment_proxy<boost::iterators::transform_iterator<boost::range_detail::default_constructible_unary_fn_wrapper<{anonymous}::supported_files(const boost::filesystem::path&, boost::optional<audio::ifstream_info::container_type>)::<lambda(const boost::filesystem::path&)>, std::__cxx11::basic_string<char> >, boost::filesystem::recursive_directory_iterator, boost::iterators::use_default, boost::iterators::use_default> > >, boost::mpl::identity<boost::iterators::transform_iterator<boost::range_detail::default_constructible_unary_fn_wrapper<{anonymous}::supported_files(const boost::filesystem::path&, boost::optional<audio::ifstream_info::container_type>)::<lambda(const boost::filesystem::path&)>, std::__cxx11::basic_string<char> >, boost::filesystem::recursive_directory_iterator, boost::iterators::use_default, boost::iterators::use_default> > >::type {aka boost::iterators::detail::postfix_increment_proxy<boost::iterators::transform_iterator<boost::range_detail::default_constructible_unary_fn_wrapper<{anonymous}::supported_files(const boost::filesystem::path&, boost::optional<audio::ifstream_info::container_type>)::<lambda(const boost::filesystem::path&)>, std::__cxx11::basic_string<char> >, boost::filesystem::recursive_directory_iterator, boost::iterators::use_default, boost::iterators::use_default> >}’ to ‘const boost::filesystem::recursive_directory_iterator&’
/usr/include/boost/iterator/transform_iterator.hpp:87:5: note: candidate: boost::iterators::transform_iterator<UnaryFunction, Iterator, Reference, Value>::transform_iterator(const Iterator&, UnaryFunc) [with UnaryFunc = boost::range_detail::default_constructible_unary_fn_wrapper<{anonymous}::supported_files(const boost::filesystem::path&, boost::optional<audio::ifstream_info::container_type>)::<lambda(const boost::filesystem::path&)>, std::__cxx11::basic_string<char> >; Iterator = boost::filesystem::recursive_directory_iterator; Reference = boost::iterators::use_default; Value = boost::iterators::use_default]
     transform_iterator(Iterator const& x, UnaryFunc f)
     ^~~~~~~~~~~~~~~~~~
/usr/include/boost/iterator/transform_iterator.hpp:87:5: note:   candidate expects 2 arguments, 1 provided
/usr/include/boost/iterator/transform_iterator.hpp:85:5: note: candidate: boost::iterators::transform_iterator<UnaryFunction, Iterator, Reference, Value>::transform_iterator() [with UnaryFunc = boost::range_detail::default_constructible_unary_fn_wrapper<{anonymous}::supported_files(const boost::filesystem::path&, boost::optional<audio::ifstream_info::container_type>)::<lambda(const boost::filesystem::path&)>, std::__cxx11::basic_string<char> >; Iterator = boost::filesystem::recursive_directory_iterator; Reference = boost::iterators::use_default; Value = boost::iterators::use_default]
     transform_iterator() { }
     ^~~~~~~~~~~~~~~~~~
/usr/include/boost/iterator/transform_iterator.hpp:85:5: note:   candidate expects 0 arguments, 1 provided
/usr/include/boost/iterator/transform_iterator.hpp:75:9: note: candidate: boost::iterators::transform_iterator<boost::range_detail::default_constructible_unary_fn_wrapper<{anonymous}::supported_files(const boost::filesystem::path&, boost::optional<audio::ifstream_info::container_type>)::<lambda(const boost::filesystem::path&)>, std::__cxx11::basic_string<char> >, boost::filesystem::recursive_directory_iterator, boost::iterators::use_default, boost::iterators::use_default>::transform_iterator(const boost::iterators::transform_iterator<boost::range_detail::default_constructible_unary_fn_wrapper<{anonymous}::supported_files(const boost::filesystem::path&, boost::optional<audio::ifstream_info::container_type>)::<lambda(const boost::filesystem::path&)>, std::__cxx11::basic_string<char> >, boost::filesystem::recursive_directory_iterator, boost::iterators::use_default, boost::iterators::use_default>&)
   class transform_iterator
         ^~~~~~~~~~~~~~~~~~
/usr/include/boost/iterator/transform_iterator.hpp:75:9: note:   no known conversion for argument 1 from ‘boost::mpl::eval_if<boost::mpl::and_<boost::is_convertible<std::__cxx11::basic_string<char>, const std::__cxx11::basic_string<char>&>, boost::mpl::not_<boost::is_convertible<boost::iterators::single_pass_traversal_tag, boost::iterators::forward_traversal_tag> >, mpl_::bool_<true>, mpl_::bool_<true>, mpl_::bool_<true> >, boost::mpl::if_<boost::iterators::detail::is_non_proxy_reference<std::__cxx11::basic_string<char>, std::__cxx11::basic_string<char> >, boost::iterators::detail::postfix_increment_proxy<boost::iterators::transform_iterator<boost::range_detail::default_constructible_unary_fn_wrapper<{anonymous}::supported_files(const boost::filesystem::path&, boost::optional<audio::ifstream_info::container_type>)::<lambda(const boost::filesystem::path&)>, std::__cxx11::basic_string<char> >, boost::filesystem::recursive_directory_iterator, boost::iterators::use_default, boost::iterators::use_default> >, boost::iterators::detail::writable_postfix_increment_proxy<boost::iterators::transform_iterator<boost::range_detail::default_constructible_unary_fn_wrapper<{anonymous}::supported_files(const boost::filesystem::path&, boost::optional<audio::ifstream_info::container_type>)::<lambda(const boost::filesystem::path&)>, std::__cxx11::basic_string<char> >, boost::filesystem::recursive_directory_iterator, boost::iterators::use_default, boost::iterators::use_default> > >, boost::mpl::identity<boost::iterators::transform_iterator<boost::range_detail::default_constructible_unary_fn_wrapper<{anonymous}::supported_files(const boost::filesystem::path&, boost::optional<audio::ifstream_info::container_type>)::<lambda(const boost::filesystem::path&)>, std::__cxx11::basic_string<char> >, boost::filesystem::recursive_directory_iterator, boost::iterators::use_default, boost::iterators::use_default> > >::type {aka boost::iterators::detail::postfix_increment_proxy<boost::iterators::transform_iterator<boost::range_detail::default_constructible_unary_fn_wrapper<{anonymous}::supported_files(const boost::filesystem::path&, boost::optional<audio::ifstream_info::container_type>)::<lambda(const boost::filesystem::path&)>, std::__cxx11::basic_string<char> >, boost::filesystem::recursive_directory_iterator, boost::iterators::use_default, boost::iterators::use_default> >}’ to ‘const boost::iterators::transform_iterator<boost::range_detail::default_constructible_unary_fn_wrapper<{anonymous}::supported_files(const boost::filesystem::path&, boost::optional<audio::ifstream_info::container_type>)::<lambda(const boost::filesystem::path&)>, std::__cxx11::basic_string<char> >, boost::filesystem::recursive_directory_iterator, boost::iterators::use_default, boost::iterators::use_default>&’
/usr/include/boost/iterator/transform_iterator.hpp:75:9: note: candidate: boost::iterators::transform_iterator<boost::range_detail::default_constructible_unary_fn_wrapper<{anonymous}::supported_files(const boost::filesystem::path&, boost::optional<audio::ifstream_info::container_type>)::<lambda(const boost::filesystem::path&)>, std::__cxx11::basic_string<char> >, boost::filesystem::recursive_directory_iterator, boost::iterators::use_default, boost::iterators::use_default>::transform_iterator(boost::iterators::transform_iterator<boost::range_detail::default_constructible_unary_fn_wrapper<{anonymous}::supported_files(const boost::filesystem::path&, boost::optional<audio::ifstream_info::container_type>)::<lambda(const boost::filesystem::path&)>, std::__cxx11::basic_string<char> >, boost::filesystem::recursive_directory_iterator, boost::iterators::use_default, boost::iterators::use_default>&&)
/usr/include/boost/iterator/transform_iterator.hpp:75:9: note:   no known conversion for argument 1 from ‘boost::mpl::eval_if<boost::mpl::and_<boost::is_convertible<std::__cxx11::basic_string<char>, const std::__cxx11::basic_string<char>&>, boost::mpl::not_<boost::is_convertible<boost::iterators::single_pass_traversal_tag, boost::iterators::forward_traversal_tag> >, mpl_::bool_<true>, mpl_::bool_<true>, mpl_::bool_<true> >, boost::mpl::if_<boost::iterators::detail::is_non_proxy_reference<std::__cxx11::basic_string<char>, std::__cxx11::basic_string<char> >, boost::iterators::detail::postfix_increment_proxy<boost::iterators::transform_iterator<boost::range_detail::default_constructible_unary_fn_wrapper<{anonymous}::supported_files(const boost::filesystem::path&, boost::optional<audio::ifstream_info::container_type>)::<lambda(const boost::filesystem::path&)>, std::__cxx11::basic_string<char> >, boost::filesystem::recursive_directory_iterator, boost::iterators::use_default, boost::iterators::use_default> >, boost::iterators::detail::writable_postfix_increment_proxy<boost::iterators::transform_iterator<boost::range_detail::default_constructible_unary_fn_wrapper<{anonymous}::supported_files(const boost::filesystem::path&, boost::optional<audio::ifstream_info::container_type>)::<lambda(const boost::filesystem::path&)>, std::__cxx11::basic_string<char> >, boost::filesystem::recursive_directory_iterator, boost::iterators::use_default, boost::iterators::use_default> > >, boost::mpl::identity<boost::iterators::transform_iterator<boost::range_detail::default_constructible_unary_fn_wrapper<{anonymous}::supported_files(const boost::filesystem::path&, boost::optional<audio::ifstream_info::container_type>)::<lambda(const boost::filesystem::path&)>, std::__cxx11::basic_string<char> >, boost::filesystem::recursive_directory_iterator, boost::iterators::use_default, boost::iterators::use_default> > >::type {aka boost::iterators::detail::postfix_increment_proxy<boost::iterators::transform_iterator<boost::range_detail::default_constructible_unary_fn_wrapper<{anonymous}::supported_files(const boost::filesystem::path&, boost::optional<audio::ifstream_info::container_type>)::<lambda(const boost::filesystem::path&)>, std::__cxx11::basic_string<char> >, boost::filesystem::recursive_directory_iterator, boost::iterators::use_default, boost::iterators::use_default> >}’ to ‘boost::iterators::transform_iterator<boost::range_detail::default_constructible_unary_fn_wrapper<{anonymous}::supported_files(const boost::filesystem::path&, boost::optional<audio::ifstream_info::container_type>)::<lambda(const boost::filesystem::path&)>, std::__cxx11::basic_string<char> >, boost::filesystem::recursive_directory_iterator, boost::iterators::use_default, boost::iterators::use_default>&&’
audiostream/test/CMakeFiles/audiostream_test.dir/build.make:86: recipe for target 'audiostream/test/CMakeFiles/audiostream_test.dir/ni/media/test_helper.cpp.o' failed
make[2]: *** [audiostream/test/CMakeFiles/audiostream_test.dir/ni/media/test_helper.cpp.o] Error 1
CMakeFiles/Makefile2:243: recipe for target 'audiostream/test/CMakeFiles/audiostream_test.dir/all' failed
make[1]: *** [audiostream/test/CMakeFiles/audiostream_test.dir/all] Error 2
Makefile:94: recipe for target 'all' failed
make: *** [all] Error 2

MP3 File Reading may Freeze

We seem to have found an issue trying to load the following file. (Zipped so it can be attached) TestMp3.zip

From what I can tell, there seems to be a bug in the code responsible for reading the MP3 file in media_foundation_helper.h L89.

        try
        {
            *read = static_cast<ULONG>( m_source.read( reinterpret_cast<char*>( buffer ), toRead ) );
            return S_OK;
        }

While we're working with template arguments here, m_source in practice is implemented using boost::iostreams::file_descriptor. On windows, this class implements read like this:

    DWORD result;
    if (!::ReadFile(handle_, s, static_cast<DWORD>(n), &result, NULL))
    {
        // report EOF if the write-side of a pipe has been closed
        if (GetLastError() == ERROR_BROKEN_PIPE)
        {
            result = 0;
        }
        else
            throw_system_failure("failed reading");
    }
    return result == 0 ? -1 : static_cast<std::streamsize>(result);

The issue comes from returning -1 in case no bytes were read. SyncronousByteStream::Read casts this to unsigned long and returns 4294967295.

The calling code sadly I can't debug but my assumption would be that it calls Read() until no more bytes are read. Since this cast would cause the number of bytes read to never reach 0, it will continue to read indefinitely or we reach some undefined behaviour.

One solution would be re-interprete -1 (EOF) to 0 (no bytes read), which, from what I can tell, fixes the endless loop and allows ni-media to successfully parse the file.

Why this issue doesn't affect other (most?) mp3 files I don't know. Sadly the documentation on the calling (Windows Media Foundation) code is somewhat limited. :)

Cheers!

Benchmarks

Hey Folks

On first glance this looks really great, so thanks for putting it out there!
I was wondering: have you done any benchmarking on different platforms or against other libraries?
If so publishing any results on the readme or pushing the benchmarks themselves would be amazing.

Cheers!

ALAC support on Windows

Hey,

Hope you are doing well.

I built a script to create Traktor stems called Stemgen. It is based on ni-stem and it creates MP4 audio files using ALAC or AAC. But Traktor can't read ALAC stems on Windows. And it really is a shame to be forced to encode lossy audio files to be able to use stems on Windows.

I haven't been able to test this hypothesis yet but I think that this issue is coming from this library.

More context in the forum and on GitHub.

Can you confirm this hypothesis? Happy to help and send a PR if that's the case :)

Recommend Projects

  • React photo React

    A declarative, efficient, and flexible JavaScript library for building user interfaces.

  • Vue.js photo Vue.js

    🖖 Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.

  • Typescript photo Typescript

    TypeScript is a superset of JavaScript that compiles to clean JavaScript output.

  • TensorFlow photo TensorFlow

    An Open Source Machine Learning Framework for Everyone

  • Django photo Django

    The Web framework for perfectionists with deadlines.

  • D3 photo D3

    Bring data to life with SVG, Canvas and HTML. 📊📈🎉

Recommend Topics

  • javascript

    JavaScript (JS) is a lightweight interpreted programming language with first-class functions.

  • web

    Some thing interesting about web. New door for the world.

  • server

    A server is a program made to process requests and deliver data to clients.

  • Machine learning

    Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.

  • Game

    Some thing interesting about game, make everyone happy.

Recommend Org

  • Facebook photo Facebook

    We are working to build community through open source technology. NB: members must have two-factor auth.

  • Microsoft photo Microsoft

    Open source projects and samples from Microsoft.

  • Google photo Google

    Google ❤️ Open Source for everyone.

  • D3 photo D3

    Data-Driven Documents codes.