Giter Club home page Giter Club logo

audiowaveform's Introduction

Audio Waveform Image Generator

Build Status

audiowaveform is a C++ command-line application that generates waveform data from either MP3, WAV, FLAC, Ogg Vorbis, or Opus format audio files. Waveform data can be used to produce a visual rendering of the audio, similar in appearance to audio editing applications.

Example Waveform

Waveform data files are saved in either binary format (.dat) or JSON (.json). Given an input waveform data file, audiowaveform can also render the audio waveform as a PNG image at a given time offset and zoom level.

The waveform data is produced from an input audio signal by first combining the input channels to produce a mono signal. The next stage is to compute the minimum and maximum sample values over groups of N input samples (where N is controlled by the --zoom command-line option), such that each N input samples produces one pair of minimum and maximum points in the output.

Contents

Installation

Ubuntu

Binary packages are available on Ubuntu Launchpad here.

sudo add-apt-repository ppa:chris-needham/ppa
sudo apt-get update
sudo apt-get install audiowaveform

Debian

Binary packages for amd64 and arm64 architectures are available on the Releases page.

Download the correct package file for your Debian version, following the examples below.

Filename Debian version
audiowaveform-1.8.1-1-12.amd64.deb Debian 12 (bookworm)
audiowaveform-1.8.1-1-11.amd64.deb Debian 11 (bullseye)
audiowaveform-1.8.1-1-10.amd64.deb Debian 10 (buster)

Use these commands to install the package and its dependencies. Replace the version number with the latest release version.

sudo apt-get update
sudo dpkg -i audiowaveform-1.8.1-1-12.amd64.deb
sudo apt-get -f install -y

RHEL, CentOS, AlmaLinux etc

Binary packages are available on the Releases page.

Download the correct RPM for your CentOS version and use these commands to install the RPM package, together with all required dependencies. Replace the version number with the latest release version.

sudo yum install -y epel-release
sudo yum localinstall audiowaveform-1.8.1-1.el8.x86_64.rpm

Arch Linux

There is an audiowaveform package available in the AUR.

Mac OSX

You can install audiowaveform using Homebrew:

brew tap bbc/audiowaveform
brew install audiowaveform

Windows

Windows binaries are available on the Releases page, and are built using compile-static-audiowaveform.

Amazon Linux

A binary package for Amazon Linux 2 is available on the Releases page.

Use these commands to install the RPM package, together with all required dependencies. Replace the version with the latest release version.

sudo amazon-linux-extras install epel
sudo yum install \
  https://github.com/bbc/audiowaveform/releases/download/1.5.1/audiowaveform-1.5.1-1.amzn2.x86_64.rpm

Docker

A Docker image based on Alpine Linux is available here, thanks to @realies.

Example usage:

docker pull realies/audiowaveform
alias awf='docker run --rm -v `pwd`:/tmp -w /tmp realies/audiowaveform'
awf -i input.wav -o output.png

Building from source

audiowaveform requires cmake 2.8.7 or later, g++ 4.6.3 or later, and Boost 1.46.0 or later.

The software has been developed on Ubuntu 12.04 and Fedora 18. Due to compiler and library version requirements, the software may not build on earlier operating system releases.

Install package dependencies

Fedora

sudo dnf install git make cmake gcc-c++ libmad-devel \
  libid3tag-devel libsndfile-devel gd-devel boost-devel

CentOS 7

Most packages needed to build audiowaveform are already present in CentOS 7, except libmad/libmad-devel, which must be taken from the EPEL repository.

Install the EPEL repository and the libmad-devel package:

sudo yum install -y https://dl.fedoraproject.org/pub/epel/epel-release-latest-7.noarch.rpm
sudo yum install -y --enablerepo=epel libmad-devel

And then install the other build dependencies (other than libmad-devel):

sudo yum install -y redhat-lsb-core rpm-build wget \
  git make cmake gcc-c++ libid3tag-devel libsndfile-devel gd-devel boost-devel

Ubuntu

sudo apt-get install git make cmake gcc g++ libmad0-dev \
  libid3tag0-dev libsndfile1-dev libgd-dev libboost-filesystem-dev \
  libboost-program-options-dev \
  libboost-regex-dev

Note: for Ubuntu 12.04, replace libgd-dev with libgd2-xpm-dev.

Alpine

apk add git make cmake gcc g++ libmad-dev \
  libid3tag-dev libsndfile-dev gd-dev boost-dev \
  libgd libpng-dev zlib-dev

Note: for a static build you will need to include the following dependencies

apk add zlib-static libpng-static boost-static

A statically linkable build of FLAC is also required. This is not available in Alpine so you must compile it yourself.

apk add autoconf automake libtool gettext
wget https://github.com/xiph/flac/archive/1.3.3.tar.gz
tar xzf 1.3.3.tar.gz
cd flac-1.3.3
./autogen.sh
./configure --enable-shared=no
make
make install

Arch

sudo pacman -S base-devel boost-libs gd \
  libid3tag libmad libsndfile boost cmake git

SUSE

zypper install git cmake gcc-c++ libmad-devel \
  libid3tag-devel libsndfile-devel gd-devel \
  libboost_filesystem1_67_0-devel \
  libboost_program_options1_67_0-devel \
  libboost_regex1_67_0-devel

Note: replace 1_67_0 with the boost version actually available.

Mac OSX

Install XCode and Homebrew, then:

brew install cmake libmad libid3tag libsndfile gd
brew install boost --with-c++11

Obtain the source code

git clone [email protected]:bbc/audiowaveform.git
cd audiowaveform

Install Google Test test framework

audiowaveform uses Google Test for unit testing. Following this advice in the Google Test FAQ, download the source and unzip:

wget https://github.com/google/googletest/archive/release-1.12.1.tar.gz
tar xzf release-1.12.1.tar.gz
ln -s googletest-release-1.12.1 googletest

Build

mkdir build
cd build
cmake ..
make

The default build type is Release. To build in Debug mode add -D CMAKE_BUILD_TYPE=Debug to the cmake command above:

cmake -D CMAKE_BUILD_TYPE=Debug ..

If you don't want to compile the unit tests add -D ENABLE_TESTS=0:

cmake -D ENABLE_TESTS=0 ..

To statically link the library dependencies add -D BUILD_STATIC=1, for example:

cmake -D BUILD_STATIC=1 ..

To compile with clang instead of g++:

cmake -D CMAKE_C_COMPILER=/usr/local/bin/clang -D CMAKE_CXX_COMPILER=/usr/local/bin/clang++ ..

Test

make test

To see detailed test output:

./audiowaveform_tests

Package

Use the following command on Debian-based systems to build a Debian package:

cpack -G DEB

or this command on Red Hat-based systems to build an RPM package:

cpack -G RPM

The packages can be locally installed (e.g., rpm -ivh *.rpm, dpkg -i *.deb) or installed on another system, as long as the runtime dependencies of the package are present (libmad, libsndfile, libid3tag, gd and boost).

Install

sudo make install

By default this installs the audiowaveform program in /usr/local/bin, and man pages in /usr/local/share/man. To change these locations, add a -D CMAKE_INSTALL_PREFIX=... option when invoking cmake above.

Run

audiowaveform --help

Usage

Command line options

audiowaveform accepts the following command-line options:

--help

Show help message.

--version, -v

Show version information.

--quiet, -q

Disable status messages.

--input-filename, -i <filename>

Input filename, which should be a MP3, WAV, FLAC, Ogg Vorbis, or Opus audio file, or a binary or JSON format waveform data file. By default, audiowaveform uses the file extension to decide how to read the input file (either .mp3, .wav, .flac, .ogg, .oga, .opus, .raw, .dat, or .json as appropriate), but this can be overridden by the --input-format option. If the --input-filename option is - or is omitted, audiowaveform reads from standard input, and the --input-format option must be used to specify the data format.

Note that Opus support requires libsndfile 1.0.29 or later, so may not be available on all systems.

--output-filename, -o <filename>

Output filename, which may be either a WAV audio file, a binary or JSON format waveform data file, or a PNG image file. By default, audiowaveform uses the file extension to decide the kind of output to generate (either .wav, .dat, .json, or .png, as appropriate), but this can be overridden by the --output-format option. If the --output-filename option is - or is omitted, audiowaveform writes to standard output, and the --output-format option must be used to specify the data format.

--input-format <format>

Input data format, either wav, mp3, flac, ogg, opus, .raw, dat, or json. This option must be used when reading from standard input. It may also be used to set the input file format, instead of it being determined from the file extension from the --input-filename option.

--output-format <format>

Output data format, either wav, dat, json, or png. This option must be used when writing to standard output. It may also be used to set the output file format, instead of it being determined from the file extension from the --output-filename option.

--zoom, -z <zoom> (default: 256)

When creating a waveform data file or image, specifies the number of input samples to use to generate each output waveform data point. Note: this option cannot be used if either the --pixels-per-second or --end option is specified. When creating a PNG image file, a value of auto scales the waveform automatically to fit the image width.

--pixels-per-second <zoom> (default: 100)

When creating a waveform data file or image, specifies the number of output waveform data points to generate for each second of audio input. Note: this option cannot be used if either the --zoom or --end option is specified.

--bits, -b <bits> (default: 16)

When creating a waveform data file, specifies the number of data bits to use for output waveform data points. Valid values are either 8 or 16.

--split-channels

Output files are multi-channel, not combined into a single waveform.

--start, -s <start> (default: 0)

When creating a waveform image, specifies the start time, in seconds.

--end, -e <end> (default: 0)

When creating a waveform image, specifies the end time, in seconds. Note: this option cannot be used if the --zoom option is specified.

--width, -w <width> (default: 800)

When creating a waveform image, specifies the image width.

--height, -h <height> (default: 250)

When creating a waveform image, specifies the image height.

--colors, -c <colors> (default: audacity)

When creating a waveform image, specifies the color scheme to use. Valid values are either audacity, which generates a blue waveform on a grey background, similar to Audacity, or audition, which generates a green waveform on a dark background, similar to Adobe Audition.

--border-color <rrggbb[aa]>

When creating a waveform image, specifies the border color. If not given, the default color used is controlled by the --colors option.

The color value should include two hexadecimal digits for each of red, green, and blue (00 to FF), and optional alpha transparency (00 to FF).

--background-color <rrggbb[aa]>

When creating a waveform image, specifies the background color. If not given, the default color used is controlled by the --colors option.

--waveform-color <rrggbb[aa]>[, <rrggbb[aa]>, ...]

When creating a waveform image, specifies the waveform color. If not given, the default color used is controlled by the --colors option. This option accepts multiple comma-separated color values, which are used with the --split-channels option to produce a waveform image with multiple channels.

--axis-label-color <rrggbb[aa]>

When creating a waveform image, specifies the axis labels color. If not given, the default color used is controlled by the --colors option.

--with-axis-labels, --no-axis-labels (default: --with-axis-labels)

When creating a waveform image, specifies whether to render axis labels and image border.

--amplitude-scale <scale> (default: 1)

When creating a waveform image or waveform data file, specifies an amplitude scaling (or vertical zoom) to apply to the waveform. Must be either a number or auto, which scales the waveform to the maximum height.

--waveform-style <style> (default: normal)

When creating a waveform image, specifies how waveform is drawn. Valid values are either normal, which draws a normal waveform, or bars, which draws the waveform as vertical bars.

--bar-width <width> (default: 8)

When creating a waveform image with the --waveform-style bars option, specifies the width of each bar, in pixels.

--bar-gap <width> (default: 4)

When creating a waveform image with the --waveform-style bars option, specifies the separation between each bar, in pixels.

--bar-style <style> (default: square)

When creating a waveform image with the --waveform-style bars option, specifies how each bar is drawn. Valid values are either square, which draws the waveform bars with square corners, or rounded, which draws the waveform with rounded corners.

--compression <level> (default: -1)

When creating a waveform image, specifies the PNG compression level. Must be either -1 (default compression) or between 0 (fastest) and 9 (best compression).

--raw-samplerate

When using raw input audio format, this must be set to the appropriate sample rate, in Hz.

--raw-channels

When using raw input audio format, this must be set to the appropriate number of channels.

--raw-format

When using raw input audio format, this must be set to the appropriate sample format. Valid options are s8, u8, s16le, s16be, s24le, s24be, s32le, s32be, f32le, f32be, f64le and f64be.

Examples

In general, you should use audiowaveform to create waveform data files (.dat) from input MP3 or WAV audio files, then create waveform images from the waveform data files.

For example, to create a waveform data file from an MP3 file, at 256 samples per point with 8-bit resolution:

audiowaveform -i test.mp3 -o test.dat -z 256 -b 8

Then, to create a PNG image of a waveform, either specify the zoom level, in samples per pixel. Note that it is not possible to set a zoom level less than that used to create the original waveform data file.

audiowaveform -i test.dat -o test.png -z 512

The following command creates a 1000x200 pixel PNG image from a waveform data file, at 50 pixels per second, starting at 5.0 seconds from the start of the audio:

audiowaveform -i test.dat -o test.png --pixels-per-second 50 -s 5.0 -w 1000 -h 200

This command creates a 1000x200 pixel PNG image from a waveform data file, showing the region from 45.0 seconds to 60.0 seconds from the start of the audio:

audiowaveform -i test.dat -o test.png -s 45.0 -e 60.0 -w 1000 -h 200

The --waveform-style option allows you to produce waveform images drawn as vertical bars. The --bar-width, --bar-gap, and --bar-style options customize the immage:

audiowaveform -i test.mp3 -o test.png -w 1000 -h 200 -z auto \
  --waveform-style bars --bar-width 10 --bar-gap 2 --bar-style rounded

You can use the --split-channels option to create a waveform data file containing multiple channels, rather than combining all channels into a single waveform:

audiowaveform -i test.mp3 -o test.dat -z 256 -b 8 --split-channels

It is also possible to create PNG images directly from either MP3 or WAV files, although if you want to render multiple images from the same audio file, it's generally preferable to first create a waveform data (.dat) file, and create the images from that, as decoding long MP3 files can take significant time.

The following command creates a 1000x200 PNG image directly from a WAV file, at 300 samples per pixel, starting at 60.0 seconds from the start of the audio:

audiowaveform -i test.wav -o test.png -z 300 -s 60.0 -w 1000 -h 200

If you are using audiowaveform to generate waveform data for use in a web application, e.g, using Peaks.js, you can choose whether to use binary or JSON format waveform data.

The following command generates waveform data in JSON format:

audiowaveform -i test.flac -o test.json -z 256 -b 8

The following command converts a waveform data file (.dat) to JSON format:

audiowaveform -i test.dat -o test.json

In addition, audiowaveform can also be used to convert MP3 to WAV format audio:

audiowaveform -i test.mp3 -o test.wav

You can use the --input-format and --output-format options to read from standard input and write to standard output. For example, the following command generates a waveform data file by converting a video file using ffmpeg:

ffmpeg -i test.mp4 -f wav - | audiowaveform --input-format wav --output-format dat -b 8 > test.dat

Note: Piping audio into audiowaveform is currently only supported for MP3 WAV format as well as raw audio, but not FLAC nor Ogg Vorbis.

Data Formats

You can find details of the waveform data file formats produced by audiowaveform here.

Credits

This program contains code from the following open-source projects, used under the terms of these projects' respective licenses:

License

See COPYING for details.

Contributing

If you'd like to contribute to audiowaveform, please take a look at our contributor guidelines.

Authors

This software was written by Chris Needham, chris.needham at bbc.co.uk.

Thank you to all our contributors.

Copyright

Copyright 2013-2024 British Broadcasting Corporation

audiowaveform's People

Contributors

0xflotus avatar alt- avatar bboyle avatar chrisn avatar dbpolito avatar eltociear avatar fabiant7t avatar igormp avatar jperville avatar moustaki avatar nullr0ute avatar oskarpersson avatar pascalhuerst avatar pr0ps avatar thom4parisot avatar tristanmatthias avatar william00179 avatar wincentbalin avatar yannickgagnon 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  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

audiowaveform's Issues

fatal error: 'boost/program_options.hpp' file not found

Hey,

I can't get audiowaveform to build on OSX 10.11. I installed the dependencies as described in the README with brew but get the following error during make:

vpnweb-0349% make
[  1%] Generating doc/audiowaveform.1.gz
[  3%] Generating doc/audiowaveform.5.gz
[  3%] Built target doc
[  4%] Building CXX object CMakeFiles/audiowaveform.dir/src/Main.cpp.o
In file included from /Users/cryptix/audiowaveform/src/Main.cpp:25:
/Users/cryptix/audiowaveform/src/Options.h:31:10: fatal error: 'boost/program_options.hpp' file not found
#include <boost/program_options.hpp>
         ^
1 error generated.
make[2]: *** [CMakeFiles/audiowaveform.dir/src/Main.cpp.o] Error 1
make[1]: *** [CMakeFiles/audiowaveform.dir/all] Error 2
make: *** [all] Error 2

Homebrew formula

As @chrisn mentioned during a conversation this morning, a nice way to ease the OSX install would be to provide a homebrew formula.

Convert to data client side

Hi, this seems like a very interesting project. I am interested in converting mp3 files and user recorded .caf files on a React Native iOS app into data visualizations. From what I gather, this project converts audio files to data through command line tools. Is there a way I could convert the files on the client side with JavaScript? Any suggestions or pointers would be greatly appreciated.

Thanks!

Scaling of the output image

Hello, I am trying to generate an image with 600 (width) and 325 (height), but sometimes if the audio file is very flat (say someone speaking), my output waveform height is too small within my entire image height, I was hoping that the waveform scale is determined automatically, but for some reason, it's not working in these cases... any suggestion would help

Question: 22,050 sample rate

Hey, hope this isn't a stupid question, but I'm generating dat files from a podcast with a 22,050 sample rate. The output of audiowaveform when creating the dat file says 44,100:

Input file: a.mp3
Format: Audio MPEG layer I stream
Bit rate: 25000 kbit/s
CRC: no
Mode: single channel
Emphasis: no
Sample rate: 44100 Hz
Generating waveform data...
Samples per pixel: 256
Input channels: 1

Naturally, when I make a png from the dat file, the waveform only occupies half of the space. Any tips on what I'm doing wrong - or how to set the sample rate explicitly?

Many thanks.

amplitude-scale option support in JSON generation

Hi,
Is there any way for generating a scaled JSON waveform (I need a JSON with values between -1 and 1 or better between 0 and 1)?
I've read about amplitude-scale option but in changelog I read it is suitable only fon PNG genaration.

Is it suitable for JSON generation too?

Thanks,
Laura

Add a "samples per second" option?

Great project, works beautifully.

I'm using it to get a waveform with a accuracy of 1 bar per second. Normally this works fine with a zoom level of 44100 but there are occasional files which have a sample rate different to this.

Seeing as the program already knows the sample rate of the file, could there be an option which inverts the current way, such that if I put "-s 1" then I get 180 points for a 3 minute track, and "-s 20" gives 3600 for the same.

Of course, if there's a quick way to get the sample rate out of mp3s and flacs (my google-fu is lacking on a saturday night) I could do the math myself.

Convert from OGG files?

Hi, is there any extension of this software to convert waveforms from OGG files? It seems this only supports WAV and MP3 right now. Any ideas are appreciated!

Centering of Output Off on Some PNG Generations

Hello!

First of all, this is a great project and I was very happy to find it. Thanks for setting it up well for new users.

I'm using this to generate images for a library of audio files, and occasionally I see an output that does not seem correctly positioned in the PNG that's messing up some formatting elsewhere in my project. For example, I am working with the .dat file below which I generated with the -z 256 -b 8 flags as suggested.

Two different installations on different computers/OSs (Mac & Ubuntu 16.04) then produce the following image when I run:

audiowaveform -i combined.dat -o combined.png -s 0 -e 3368 -w 1400 -h 200 --border-color 00000000 --background-color eeeeee --no-axis-labels --compression 5 --waveform-color 527abd

combined

I am expecting the waveform to be centered vertically. It usually is, but in 3-5% of cases it's drawn too low, as is shown here. 3368 is the native end of the file - I've also tried drawing less and move to see if that has an effect and it did not.

Is there something I am doing wrong here, or should the expected output have the result centered?

Thanks a lot and again, great project :)

Josh

.dat file (provided as .zip, as Github does not allow the .dat)
combined.dat.zip

Installing on AWS Linux?

I'm trying to install it on AWS EC2 Linux, and unfortunately yum shows that libsndfile and libsndfile-dev packages are not available. Is there another way to install these? I tried using brew, and supposedly it's installed, but cmake still fails with the following error:

CMake Error at /usr/share/cmake/Modules/FindPackageHandleStandardArgs.cmake:108 (message):
  Could NOT find LibSndFile (missing: LIBSNDFILE_LIBRARY
  LIBSNDFILE_INCLUDE_DIR)
Call Stack (most recent call first):
  /usr/share/cmake/Modules/FindPackageHandleStandardArgs.cmake:315 (_FPHSA_FAILURE_MESSAGE)
  cmake/modules/FindLibSndFile.cmake:38 (find_package_handle_standard_args)
  CMakeLists.txt:71 (find_package)

Any help would be appreciated.

cannot convert wav or mp3 to png

hi there,

I have the following message : Can't generate "XX.png" from "XX.mp3"
or Can't generate "XX.png" from "XX.wav" when trying to make a png from wav or mp3 file. Limitation or bug?

And I have the limitation : "Can only generate waveform data from stereo input files"
Working with mono files will be very nice :)

Thanks for response and congrats for the software.

Boris

Ubuntu 16.04 build failure

Following ubuntu build instructions below:

git clone https://github.com/bbc/audiowaveform.git
cd audiowaveform
mkdir build
wget https://github.com/google/googletest/archive/release-1.8.0.tar.gz
tar xvzf release-1.8.0.tar.gz
rm release-1.8.0.tar.gz
ln -s googletest-release-1.8.0/googletest googletest
ln -s googletest-release-1.8.0/googlemock googlemock
cd build
cmake ..
make

Excerpt of terminal window output:

CMake Error at /usr/share/cmake-3.5/Modules/FindPackageHandleStandardArgs.cmake:148 (message): Could NOT find LibId3Tag (missing: LIBID3TAG_LIBRARY LIBID3TAG_INCLUDE_DIR) Call Stack (most recent call first): /usr/share/cmake-3.5/Modules/FindPackageHandleStandardArgs.cmake:388 (_FPHSA_FAILURE_MESSAGE) cmake/modules/FindLibId3Tag.cmake:38 (find_package_handle_standard_args) CMakeLists.txt:91 (find_package)

Auto -End parameter

Is there way to have the script autodetect the length to show the entire audio file without setting start/end/zoom?

flac - to - .dat?

Firstly, great work guys! Have successfully built & run demo Peaks.js via index.html and all is working well on OSX 10.9.4

It would be fantastic if we could use the flac support inherent in libsndfile to build directly from a .flac file rather than have to recode to .wav or .mp3.

Hope this is possible. Thanks again.

Test failures on Fedora 25 (32-bit) with g++ 6.3.1

The following test output is generated on Fedora 25 (32-bit) with g++ 6.3.1:

$ ./audiowaveform_tests
[ RUN      ] WaveformBufferTest.shouldReportErrorIfSizeMismatch
unknown file: Failure
C++ exception with description "basic_ios::clear" thrown in the test body.
[  FAILED  ] WaveformBufferTest.shouldReportErrorIfSizeMismatch (0 ms)
[ RUN      ] WaveformBufferTest.shouldReportErrorIfFileNotFound
unknown file: Failure
C++ exception with description "basic_ios::clear" thrown in the test body.
[  FAILED  ] WaveformBufferTest.shouldReportErrorIfFileNotFound (0 ms)
[ RUN      ] WaveformBufferTest.shouldLoadDataFileIfSizeIsZero
unknown file: Failure
C++ exception with description "basic_ios::clear" thrown in the test body.
[  FAILED  ] WaveformBufferTest.shouldLoadDataFileIfSizeIsZero (0 ms)

Running audiowaveform with a non-existent input .dat file causes the program to terminate due to an uncaught exception:

$ ./audiowaveform -i test.dat -o test.png
terminate called after throwing an instance of 'std::ios_base::failure'
  what():  basic_ios::clear
Aborted (core dumped)

The installed g++ and libstdc++ versions are as follows:

$ g++ --version
g++ (GCC) 6.3.1 20161221 (Red Hat 6.3.1-1)

$ dnf list installed libstdc++
Installed Packages
libstdc++.i686        6.3.1-1.fc25        @updates

Unable to make on CentOS 6.8 x86_64

cmake3 version 3.5.2

[~/audiowaveform/build]# make
[ 2%] Built target doc
[ 4%] Building CXX object CMakeFiles/audiowaveform.dir/src/Main.cpp.o
In file included from /root/audiowaveform/src/Main.cpp:25:
In file included from /root/audiowaveform/src/Options.h:31:
In file included from /usr/include/boost148/boost/program_options.hpp:15:
In file included from /usr/include/boost148/boost/program_options/options_description.hpp:13:
In file included from /usr/include/boost148/boost/program_options/value_semantic.hpp:14:
/usr/include/boost148/boost/lexical_cast.hpp:830:60: warning: implicit
conversion loses integer precision: 'unsigned long' to 'unsigned int'
[-Wshorten-64-to-32]
unsigned int last_grouping_pos = grouping_size - 1;
~~~~~~~~~~~~~~~~~ ~~~~~~~~~~~~~~^~~
/root/audiowaveform/src/Main.cpp:33:15: error: static_assert expression is not
an integral constant expression
static_assert(std::numeric_limits::max() >= 2147483647L, "size of int");
^~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
/root/audiowaveform/src/Main.cpp:33:15: note: non-constexpr function 'max'
cannot be used in a constant expression
/usr/bin/../lib/gcc/x86_64-redhat-linux/4.4.7/../../../../include/c++/4.4.7/limits:778:18: note:
declared here
static int max() throw()
^
In file included from /root/audiowaveform/src/Main.cpp:25:
In file included from /root/audiowaveform/src/Options.h:31:
In file included from /usr/include/boost148/boost/program_options.hpp:15:
In file included from /usr/include/boost148/boost/program_options/options_description.hpp:11:
In file included from /usr/include/boost148/boost/program_options/config.hpp:10:
In file included from /usr/include/boost148/boost/config.hpp:40:
In file included from /usr/include/boost148/boost/config/select_stdlib_config.hpp:37:
In file included from /usr/include/boost148/boost/config/no_tr1/utility.hpp:21:
In file included from /usr/bin/../lib/gcc/x86_64-redhat-linux/4.4.7/../../../../include/c++/4.4.7/utility:63:
In file included from /usr/bin/../lib/gcc/x86_64-redhat-linux/4.4.7/../../../../include/c++/4.4.7/bits/stl_pair.h:60:
/usr/bin/../lib/gcc/x86_64-redhat-linux/4.4.7/../../../../include/c++/4.4.7/bits/move.h:57:14: error:
rvalue reference to type 'typename std::remove_reference<placeholder
*&>::type' (aka 'boost::any::placeholder *') cannot bind to lvalue of type
'boost::any::placeholder *'
{ return __t; }
^~~
/usr/bin/../lib/gcc/x86_64-redhat-linux/4.4.7/../../../../include/c++/4.4.7/bits/move.h:81:19: note:
in instantiation of function template specialization
'std::move<boost::any::placeholder *&>' requested here
_Tp __tmp = _GLIBCXX_MOVE(__a);
^
/usr/bin/../lib/gcc/x86_64-redhat-linux/4.4.7/../../../../include/c++/4.4.7/bits/move.h:61:33: note:
expanded from macro '_GLIBCXX_MOVE'

define _GLIBCXX_MOVE(_Tp) std::move(_Tp)

                            ^

/usr/include/boost148/boost/any.hpp:64:18: note: in instantiation of function
template specialization 'std::swap<boost::any::placeholder *>' requested
here
std::swap(content, rhs.content);
^
In file included from /root/audiowaveform/src/Main.cpp:25:
In file included from /root/audiowaveform/src/Options.h:31:
In file included from /usr/include/boost148/boost/program_options.hpp:15:
In file included from /usr/include/boost148/boost/program_options/options_description.hpp:11:
In file included from /usr/include/boost148/boost/program_options/config.hpp:10:
In file included from /usr/include/boost148/boost/config.hpp:40:
In file included from /usr/include/boost148/boost/config/select_stdlib_config.hpp:37:
In file included from /usr/include/boost148/boost/config/no_tr1/utility.hpp:21:
In file included from /usr/bin/../lib/gcc/x86_64-redhat-linux/4.4.7/../../../../include/c++/4.4.7/utility:63:
In file included from /usr/bin/../lib/gcc/x86_64-redhat-linux/4.4.7/../../../../include/c++/4.4.7/bits/stl_pair.h:60:
/usr/bin/../lib/gcc/x86_64-redhat-linux/4.4.7/../../../../include/c++/4.4.7/bits/move.h:57:14: error:
rvalue reference to type 'vector<[2 * ...]>' cannot bind to lvalue of type
'vector<[2 * ...]>'
{ return __t; }
^~~
/usr/bin/../lib/gcc/x86_64-redhat-linux/4.4.7/../../../../include/c++/4.4.7/bits/stl_stack.h:135:16: note:
in instantiation of function template specialization
'std::move<std::vector<boost::filesystem3::directory_iterator,
std::allocatorboost::filesystem3::directory_iterator > &>' requested
here
: c(std::move(__c)) { }
^
/usr/include/boost148/boost/filesystem/v3/operations.hpp:674:7: note: in
instantiation of member function
'std::stack<boost::filesystem3::directory_iterator,
std::vector<boost::filesystem3::directory_iterator,
std::allocatorboost::filesystem3::directory_iterator > >::stack'
requested here
recur_dir_itr_imp() : m_level(0), m_options(symlink_option::none) {}
^
In file included from /root/audiowaveform/src/Main.cpp:25:
In file included from /root/audiowaveform/src/Options.h:31:
In file included from /usr/include/boost148/boost/program_options.hpp:15:
In file included from /usr/include/boost148/boost/program_options/options_description.hpp:12:
In file included from /usr/include/boost148/boost/program_options/errors.hpp:14:
In file included from /usr/bin/../lib/gcc/x86_64-redhat-linux/4.4.7/../../../../include/c++/4.4.7/vector:65:
/usr/bin/../lib/gcc/x86_64-redhat-linux/4.4.7/../../../../include/c++/4.4.7/bits/stl_vector.h:258:15: error:
no matching function for call to 'forward'
: _Base(std::forward<_Base>(__x)) { }
^~~~~~~~~~~~~~~~~~~
/usr/bin/../lib/gcc/x86_64-redhat-linux/4.4.7/../../../../include/c++/4.4.7/bits/stl_stack.h:135:9: note:
in instantiation of member function
'std::vector<boost::filesystem3::directory_iterator,
std::allocatorboost::filesystem3::directory_iterator >::vector'
requested here
: c(std::move(__c)) { }
^
/usr/include/boost148/boost/filesystem/v3/operations.hpp:674:7: note: in
instantiation of member function
'std::stack<boost::filesystem3::directory_iterator,
std::vector<boost::filesystem3::directory_iterator,
std::allocatorboost::filesystem3::directory_iterator > >::stack'
requested here
recur_dir_itr_imp() : m_level(0), m_options(symlink_option::none) {}
^
/usr/bin/../lib/gcc/x86_64-redhat-linux/4.4.7/../../../../include/c++/4.4.7/bits/move.h:51:5: note:
candidate function [with _Tp =
std::_Vector_base<boost::filesystem3::directory_iterator,
std::allocatorboost::filesystem3::directory_iterator >] not viable: no
known conversion from 'std::vector<boost::filesystem3::directory_iterator,
std::allocatorboost::filesystem3::directory_iterator >' to 'typename
std::identity<_Vector_base<directory_iterator,
allocator<directory_iterator> > >::type &&' (aka
'std::_Vector_base<boost::filesystem3::directory_iterator,
std::allocatorboost::filesystem3::directory_iterator > &&') for 1st
argument
forward(typename std::identity<_Tp>::type&& __t)
^
/usr/bin/../lib/gcc/x86_64-redhat-linux/4.4.7/../../../../include/c++/4.4.7/bits/move.h:57:14: error:
rvalue reference to type 'typename
std::remove_reference<directory_iterator &>::type' (aka
'boost::filesystem3::directory_iterator') cannot bind to lvalue of type
'boost::filesystem3::directory_iterator'
{ return __t; }
^~~
/usr/bin/../lib/gcc/x86_64-redhat-linux/4.4.7/../../../../include/c++/4.4.7/bits/stl_stack.h:188:26: note:
in instantiation of function template specialization
'std::move<boost::filesystem3::directory_iterator &>' requested here
{ c.push_back(std::move(__x)); }
^
/usr/include/boost148/boost/filesystem/v3/operations.hpp:697:19: note: in
instantiation of member function
'std::stack<boost::filesystem3::directory_iterator,
std::vector<boost::filesystem3::directory_iterator,
std::allocatorboost::filesystem3::directory_iterator > >::push'
requested here
m_stack.push(directory_iterator(m_stack.top()->path()));
^
In file included from /root/audiowaveform/src/Main.cpp:25:
In file included from /root/audiowaveform/src/Options.h:31:
In file included from /usr/include/boost148/boost/program_options.hpp:15:
In file included from /usr/include/boost148/boost/program_options/options_description.hpp:12:
In file included from /usr/include/boost148/boost/program_options/errors.hpp:14:
In file included from /usr/bin/../lib/gcc/x86_64-redhat-linux/4.4.7/../../../../include/c++/4.4.7/vector:65:
/usr/bin/../lib/gcc/x86_64-redhat-linux/4.4.7/../../../../include/c++/4.4.7/bits/stl_vector.h:747:22: error:
no matching function for call to 'move'
{ emplace_back(std::move(__x)); }
^~~~~~~~~
/usr/bin/../lib/gcc/x86_64-redhat-linux/4.4.7/../../../../include/c++/4.4.7/bits/stl_stack.h:188:11: note:
in instantiation of member function
'std::vector<boost::filesystem3::directory_iterator,
std::allocatorboost::filesystem3::directory_iterator >::push_back'
requested here
{ c.push_back(std::move(__x)); }
^
/usr/include/boost148/boost/filesystem/v3/operations.hpp:697:19: note: in
instantiation of member function
'std::stack<boost::filesystem3::directory_iterator,
std::vector<boost::filesystem3::directory_iterator,
std::allocatorboost::filesystem3::directory_iterator > >::push'
requested here
m_stack.push(directory_iterator(m_stack.top()->path()));
^
/usr/bin/../lib/gcc/x86_64-redhat-linux/4.4.7/../../../../include/c++/4.4.7/bits/move.h:56:5: note:
candidate template ignored: substitution failure [with _Tp =
boost::filesystem3::directory_iterator &]
move(_Tp&& __t)
^
/usr/bin/../lib/gcc/x86_64-redhat-linux/4.4.7/../../../../include/c++/4.4.7/bits/stl_algobase.h:491:5: note:
candidate function template not viable: requires 3 arguments, but 1 was
provided
move(_II __first, _II __last, _OI __result)
^
In file included from /root/audiowaveform/src/Main.cpp:25:
In file included from /root/audiowaveform/src/Options.h:31:
In file included from /usr/include/boost148/boost/program_options.hpp:15:
In file included from /usr/include/boost148/boost/program_options/options_description.hpp:11:
In file included from /usr/include/boost148/boost/program_options/config.hpp:10:
In file included from /usr/include/boost148/boost/config.hpp:40:
In file included from /usr/include/boost148/boost/config/select_stdlib_config.hpp:37:
In file included from /usr/include/boost148/boost/config/no_tr1/utility.hpp:21:
In file included from /usr/bin/../lib/gcc/x86_64-redhat-linux/4.4.7/../../../../include/c++/4.4.7/utility:63:
In file included from /usr/bin/../lib/gcc/x86_64-redhat-linux/4.4.7/../../../../include/c++/4.4.7/bits/stl_pair.h:60:
/usr/bin/../lib/gcc/x86_64-redhat-linux/4.4.7/../../../../include/c++/4.4.7/bits/move.h:57:14: error:
rvalue reference to type 'typename std::remove_reference<recur_dir_itr_imp
*&>::type' (aka 'boost::filesystem3::detail::recur_dir_itr_imp *') cannot
bind to lvalue of type 'boost::filesystem3::detail::recur_dir_itr_imp *'
{ return __t; }
^~~
/usr/bin/../lib/gcc/x86_64-redhat-linux/4.4.7/../../../../include/c++/4.4.7/bits/move.h:81:19: note:
in instantiation of function template specialization
'std::move<boost::filesystem3::detail::recur_dir_itr_imp *&>' requested
here
_Tp __tmp = _GLIBCXX_MOVE(__a);
^
/usr/bin/../lib/gcc/x86_64-redhat-linux/4.4.7/../../../../include/c++/4.4.7/bits/move.h:61:33: note:
expanded from macro '_GLIBCXX_MOVE'

define _GLIBCXX_MOVE(_Tp) std::move(_Tp)

                            ^

/usr/include/boost148/boost/smart_ptr/shared_ptr.hpp:448:14: note: in
instantiation of function template specialization
'std::swap<boost::filesystem3::detail::recur_dir_itr_imp *>' requested
here
std::swap(px, other.px);
^
/usr/include/boost148/boost/smart_ptr/shared_ptr.hpp:392:21: note: in
instantiation of member function
'boost::shared_ptrboost::filesystem3::detail::recur_dir_itr_imp::swap'
requested here
this_type().swap(*this);
^
/usr/include/boost148/boost/filesystem/v3/operations.hpp:756:17: note: in
instantiation of member function
'boost::shared_ptrboost::filesystem3::detail::recur_dir_itr_imp::reset'
requested here
{ m_imp.reset (); }
^
In file included from /root/audiowaveform/src/Main.cpp:25:
In file included from /root/audiowaveform/src/Options.h:31:
In file included from /usr/include/boost148/boost/program_options.hpp:15:
In file included from /usr/include/boost148/boost/program_options/options_description.hpp:11:
In file included from /usr/include/boost148/boost/program_options/config.hpp:10:
In file included from /usr/include/boost148/boost/config.hpp:40:
In file included from /usr/include/boost148/boost/config/select_stdlib_config.hpp:37:
In file included from /usr/include/boost148/boost/config/no_tr1/utility.hpp:21:
In file included from /usr/bin/../lib/gcc/x86_64-redhat-linux/4.4.7/../../../../include/c++/4.4.7/utility:63:
In file included from /usr/bin/../lib/gcc/x86_64-redhat-linux/4.4.7/../../../../include/c++/4.4.7/bits/stl_pair.h:60:
/usr/bin/../lib/gcc/x86_64-redhat-linux/4.4.7/../../../../include/c++/4.4.7/bits/move.h:57:14: error:
rvalue reference to type 'typename std::remove_reference<m_imp *&>::type'
(aka 'boost::filesystem3::filesystem_error::m_imp *') cannot bind to
lvalue of type 'boost::filesystem3::filesystem_error::m_imp *'
{ return __t; }
^~~
/usr/bin/../lib/gcc/x86_64-redhat-linux/4.4.7/../../../../include/c++/4.4.7/bits/move.h:81:19: note:
in instantiation of function template specialization
'std::move<boost::filesystem3::filesystem_error::m_imp *&>' requested here
_Tp __tmp = _GLIBCXX_MOVE(__a);
^
/usr/bin/../lib/gcc/x86_64-redhat-linux/4.4.7/../../../../include/c++/4.4.7/bits/move.h:61:33: note:
expanded from macro '_GLIBCXX_MOVE'

define _GLIBCXX_MOVE(_Tp) std::move(_Tp)

                            ^

/usr/include/boost148/boost/smart_ptr/shared_ptr.hpp:448:14: note: in
instantiation of function template specialization
'std::swap<boost::filesystem3::filesystem_error::m_imp *>' requested here
std::swap(px, other.px);
^
/usr/include/boost148/boost/smart_ptr/shared_ptr.hpp:398:22: note: in
instantiation of member function
'boost::shared_ptrboost::filesystem3::filesystem_error::m_imp::swap'
requested here
this_type(p).swap(this);
^
/usr/include/boost148/boost/filesystem/v3/operations.hpp:897:19: note: in
instantiation of function template specialization
'boost::shared_ptrboost::filesystem3::filesystem_error::m_imp::resetboost::filesystem3::filesystem_error::m_imp'
requested here
m_imp_ptr.reset(new m_imp);
^
1 warning and 8 errors generated.
make[2]: *
* [CMakeFiles/audiowaveform.dir/src/Main.cpp.o] Error 1
make[1]: *** [CMakeFiles/audiowaveform.dir/all] Error 2
make: *** [all] Error 2

Incorrect output from floating point WAV files

When processing WAV files containing floating point sample data, audiowaveform produces PNG images that appear to show a zero amplitude waveform, and waveform data files containing all zeros.

fresh install failed on OSX 10.9.1

Scanning dependencies of target doc
[ 2%] Generating doc/audiowaveform.1.gz
[ 4%] Generating doc/audiowaveform.5.gz
[ 4%] Built target doc
Scanning dependencies of target audiowaveform
[ 6%] Building CXX object CMakeFiles/audiowaveform.dir/src/Main.cpp.o
In file included from /Users/liubing/OpenSource/sound/audiowaveform/src/Main.cpp:29:
In file included from /Users/liubing/OpenSource/sound/audiowaveform/src/Options.h:29:
In file included from /usr/local/include/boost/filesystem.hpp:16:
In file included from /usr/local/include/boost/filesystem/path.hpp:25:
In file included from /usr/local/include/boost/filesystem/path_traits.hpp:23:
In file included from /usr/local/include/boost/system/error_code.hpp:20:
In file included from /Applications/Xcode.app/Contents/Developer/Toolchains/XcodeDefault.xctoolchain/usr/bin/../lib/c++/v1/ostream:130:
In file included from /Applications/Xcode.app/Contents/Developer/Toolchains/XcodeDefault.xctoolchain/usr/bin/../lib/c++/v1/ios:216:
In file included from /Applications/Xcode.app/Contents/Developer/Toolchains/XcodeDefault.xctoolchain/usr/bin/../lib/c++/v1/__locale:18:
In file included from /Applications/Xcode.app/Contents/Developer/Toolchains/XcodeDefault.xctoolchain/usr/bin/../lib/c++/v1/mutex:176:
In file included from /Applications/Xcode.app/Contents/Developer/Toolchains/XcodeDefault.xctoolchain/usr/bin/../lib/c++/v1/__mutex_base:15:
In file included from /Applications/Xcode.app/Contents/Developer/Toolchains/XcodeDefault.xctoolchain/usr/bin/../lib/c++/v1/chrono:266:
/Applications/Xcode.app/Contents/Developer/Toolchains/XcodeDefault.xctoolchain/usr/bin/../lib/c++/v1/ctime:59:9: error:
no member named 'clock' in the global namespace
using ::clock;
~~^
/Applications/Xcode.app/Contents/Developer/Toolchains/XcodeDefault.xctoolchain/usr/bin/../lib/c++/v1/ctime:60:9: error:
no member named 'difftime' in the global namespace
using ::difftime;
~~^
/Applications/Xcode.app/Contents/Developer/Toolchains/XcodeDefault.xctoolchain/usr/bin/../lib/c++/v1/ctime:61:9: error:
no member named 'mktime' in the global namespace
using ::mktime;
~~^
/Applications/Xcode.app/Contents/Developer/Toolchains/XcodeDefault.xctoolchain/usr/bin/../lib/c++/v1/ctime:62:9: error:
no member named 'time' in the global namespace
using ::time;
~~^
/Applications/Xcode.app/Contents/Developer/Toolchains/XcodeDefault.xctoolchain/usr/bin/../lib/c++/v1/ctime:63:9: error:
no member named 'asctime' in the global namespace
using ::asctime;
~~^
/Applications/Xcode.app/Contents/Developer/Toolchains/XcodeDefault.xctoolchain/usr/bin/../lib/c++/v1/ctime:64:9: error:
no member named 'ctime' in the global namespace
using ::ctime;
~~^
/Applications/Xcode.app/Contents/Developer/Toolchains/XcodeDefault.xctoolchain/usr/bin/../lib/c++/v1/ctime:65:9: error:
no member named 'gmtime' in the global namespace
using ::gmtime;
~~^
/Applications/Xcode.app/Contents/Developer/Toolchains/XcodeDefault.xctoolchain/usr/bin/../lib/c++/v1/ctime:66:9: error:
no member named 'localtime' in the global namespace
using ::localtime;
~~^
/Applications/Xcode.app/Contents/Developer/Toolchains/XcodeDefault.xctoolchain/usr/bin/../lib/c++/v1/ctime:67:9: error:
no member named 'strftime' in the global namespace
using ::strftime;
~~^
In file included from /Users/liubing/OpenSource/sound/audiowaveform/src/Main.cpp:29:
In file included from /Users/liubing/OpenSource/sound/audiowaveform/src/Options.h:29:
In file included from /usr/local/include/boost/filesystem.hpp:16:
In file included from /usr/local/include/boost/filesystem/path.hpp:25:
In file included from /usr/local/include/boost/filesystem/path_traits.hpp:23:
In file included from /usr/local/include/boost/system/error_code.hpp:20:
In file included from /Applications/Xcode.app/Contents/Developer/Toolchains/XcodeDefault.xctoolchain/usr/bin/../lib/c++/v1/ostream:132:
/Applications/Xcode.app/Contents/Developer/Toolchains/XcodeDefault.xctoolchain/usr/bin/../lib/c++/v1/locale:2600:27: error:
member access into incomplete type 'tm'
__get_weekdayname(__tm->tm_wday, __b, __e, __err, __ct);
^
/usr/include/wchar.h:131:19: note: forward declaration of 'tm'
const struct tm * __restrict) __DARWIN_ALIAS(wcsftime);
^
In file included from /Users/liubing/OpenSource/sound/audiowaveform/src/Main.cpp:29:
In file included from /Users/liubing/OpenSource/sound/audiowaveform/src/Options.h:29:
In file included from /usr/local/include/boost/filesystem.hpp:16:
In file included from /usr/local/include/boost/filesystem/path.hpp:25:
In file included from /usr/local/include/boost/filesystem/path_traits.hpp:23:
In file included from /usr/local/include/boost/system/error_code.hpp:20:
In file included from /Applications/Xcode.app/Contents/Developer/Toolchains/XcodeDefault.xctoolchain/usr/bin/../lib/c++/v1/ostream:132:
/Applications/Xcode.app/Contents/Developer/Toolchains/XcodeDefault.xctoolchain/usr/bin/../lib/c++/v1/locale:2612:25: error:
member access into incomplete type 'tm'
__get_monthname(__tm->tm_mon, __b, __e, __err, __ct);
^
/usr/include/wchar.h:131:19: note: forward declaration of 'tm'
const struct tm * __restrict) __DARWIN_ALIAS(wcsftime);
^
In file included from /Users/liubing/OpenSource/sound/audiowaveform/src/Main.cpp:29:
In file included from /Users/liubing/OpenSource/sound/audiowaveform/src/Options.h:29:
In file included from /usr/local/include/boost/filesystem.hpp:16:
In file included from /usr/local/include/boost/filesystem/path.hpp:25:
In file included from /usr/local/include/boost/filesystem/path_traits.hpp:23:
In file included from /usr/local/include/boost/system/error_code.hpp:20:
In file included from /Applications/Xcode.app/Contents/Developer/Toolchains/XcodeDefault.xctoolchain/usr/bin/../lib/c++/v1/ostream:132:
/Applications/Xcode.app/Contents/Developer/Toolchains/XcodeDefault.xctoolchain/usr/bin/../lib/c++/v1/locale:2624:20: error:
member access into incomplete type 'tm'
__get_year(__tm->tm_year, __b, __e, __err, __ct);
^
/usr/include/wchar.h:131:19: note: forward declaration of 'tm'
const struct tm * __restrict) __DARWIN_ALIAS(wcsftime);
^
In file included from /Users/liubing/OpenSource/sound/audiowaveform/src/Main.cpp:29:
In file included from /Users/liubing/OpenSource/sound/audiowaveform/src/Options.h:29:
In file included from /usr/local/include/boost/filesystem.hpp:16:
In file included from /usr/local/include/boost/filesystem/path.hpp:25:
In file included from /usr/local/include/boost/filesystem/path_traits.hpp:23:
In file included from /usr/local/include/boost/system/error_code.hpp:20:
In file included from /Applications/Xcode.app/Contents/Developer/Toolchains/XcodeDefault.xctoolchain/usr/bin/../lib/c++/v1/ostream:132:
/Applications/Xcode.app/Contents/Developer/Toolchains/XcodeDefault.xctoolchain/usr/bin/../lib/c++/v1/locale:2641:31: error:
member access into incomplete type 'tm'
__get_weekdayname(__tm->tm_wday, __b, __e, __err, __ct);
^
/usr/include/wchar.h:131:19: note: forward declaration of 'tm'
const struct tm * __restrict) __DARWIN_ALIAS(wcsftime);
^
In file included from /Users/liubing/OpenSource/sound/audiowaveform/src/Main.cpp:29:
In file included from /Users/liubing/OpenSource/sound/audiowaveform/src/Options.h:29:
In file included from /usr/local/include/boost/filesystem.hpp:16:
In file included from /usr/local/include/boost/filesystem/path.hpp:25:
In file included from /usr/local/include/boost/filesystem/path_traits.hpp:23:
In file included from /usr/local/include/boost/system/error_code.hpp:20:
In file included from /Applications/Xcode.app/Contents/Developer/Toolchains/XcodeDefault.xctoolchain/usr/bin/../lib/c++/v1/ostream:132:
/Applications/Xcode.app/Contents/Developer/Toolchains/XcodeDefault.xctoolchain/usr/bin/../lib/c++/v1/locale:2646:29: error:
member access into incomplete type 'tm'
__get_monthname(__tm->tm_mon, __b, __e, __err, __ct);
^
/usr/include/wchar.h:131:19: note: forward declaration of 'tm'
const struct tm * __restrict) __DARWIN_ALIAS(wcsftime);
^
In file included from /Users/liubing/OpenSource/sound/audiowaveform/src/Main.cpp:29:
In file included from /Users/liubing/OpenSource/sound/audiowaveform/src/Options.h:29:
In file included from /usr/local/include/boost/filesystem.hpp:16:
In file included from /usr/local/include/boost/filesystem/path.hpp:25:
In file included from /usr/local/include/boost/filesystem/path_traits.hpp:23:
In file included from /usr/local/include/boost/system/error_code.hpp:20:
In file included from /Applications/Xcode.app/Contents/Developer/Toolchains/XcodeDefault.xctoolchain/usr/bin/../lib/c++/v1/ostream:132:
/Applications/Xcode.app/Contents/Developer/Toolchains/XcodeDefault.xctoolchain/usr/bin/../lib/c++/v1/locale:2656:23: error:
member access into incomplete type 'tm'
__get_day(__tm->tm_mday, __b, __e, __err, __ct);
^
/usr/include/wchar.h:131:19: note: forward declaration of 'tm'
const struct tm * __restrict) __DARWIN_ALIAS(wcsftime);
^
In file included from /Users/liubing/OpenSource/sound/audiowaveform/src/Main.cpp:29:
In file included from /Users/liubing/OpenSource/sound/audiowaveform/src/Options.h:29:
In file included from /usr/local/include/boost/filesystem.hpp:16:
In file included from /usr/local/include/boost/filesystem/path.hpp:25:
In file included from /usr/local/include/boost/filesystem/path_traits.hpp:23:
In file included from /usr/local/include/boost/system/error_code.hpp:20:
In file included from /Applications/Xcode.app/Contents/Developer/Toolchains/XcodeDefault.xctoolchain/usr/bin/../lib/c++/v1/ostream:132:
/Applications/Xcode.app/Contents/Developer/Toolchains/XcodeDefault.xctoolchain/usr/bin/../lib/c++/v1/locale:2671:24: error:
member access into incomplete type 'tm'
__get_hour(__tm->tm_hour, __b, __e, __err, __ct);
^
/usr/include/wchar.h:131:19: note: forward declaration of 'tm'
const struct tm * __restrict) __DARWIN_ALIAS(wcsftime);
^
In file included from /Users/liubing/OpenSource/sound/audiowaveform/src/Main.cpp:29:
In file included from /Users/liubing/OpenSource/sound/audiowaveform/src/Options.h:29:
In file included from /usr/local/include/boost/filesystem.hpp:16:
In file included from /usr/local/include/boost/filesystem/path.hpp:25:
In file included from /usr/local/include/boost/filesystem/path_traits.hpp:23:
In file included from /usr/local/include/boost/system/error_code.hpp:20:
In file included from /Applications/Xcode.app/Contents/Developer/Toolchains/XcodeDefault.xctoolchain/usr/bin/../lib/c++/v1/ostream:132:
/Applications/Xcode.app/Contents/Developer/Toolchains/XcodeDefault.xctoolchain/usr/bin/../lib/c++/v1/locale:2674:27: error:
member access into incomplete type 'tm'
__get_12_hour(__tm->tm_hour, __b, __e, __err, __ct);
^
/usr/include/wchar.h:131:19: note: forward declaration of 'tm'
const struct tm * __restrict) __DARWIN_ALIAS(wcsftime);
^
In file included from /Users/liubing/OpenSource/sound/audiowaveform/src/Main.cpp:29:
In file included from /Users/liubing/OpenSource/sound/audiowaveform/src/Options.h:29:
In file included from /usr/local/include/boost/filesystem.hpp:16:
In file included from /usr/local/include/boost/filesystem/path.hpp:25:
In file included from /usr/local/include/boost/filesystem/path_traits.hpp:23:
In file included from /usr/local/include/boost/system/error_code.hpp:20:
In file included from /Applications/Xcode.app/Contents/Developer/Toolchains/XcodeDefault.xctoolchain/usr/bin/../lib/c++/v1/ostream:132:
/Applications/Xcode.app/Contents/Developer/Toolchains/XcodeDefault.xctoolchain/usr/bin/../lib/c++/v1/locale:2677:32: error:
member access into incomplete type 'tm'
__get_day_year_num(__tm->tm_yday, __b, __e, __err, __ct);
^
/usr/include/wchar.h:131:19: note: forward declaration of 'tm'
const struct tm * __restrict) __DARWIN_ALIAS(wcsftime);
^
In file included from /Users/liubing/OpenSource/sound/audiowaveform/src/Main.cpp:29:
In file included from /Users/liubing/OpenSource/sound/audiowaveform/src/Options.h:29:
In file included from /usr/local/include/boost/filesystem.hpp:16:
In file included from /usr/local/include/boost/filesystem/path.hpp:25:
In file included from /usr/local/include/boost/filesystem/path_traits.hpp:23:
In file included from /usr/local/include/boost/system/error_code.hpp:20:
In file included from /Applications/Xcode.app/Contents/Developer/Toolchains/XcodeDefault.xctoolchain/usr/bin/../lib/c++/v1/ostream:132:
/Applications/Xcode.app/Contents/Developer/Toolchains/XcodeDefault.xctoolchain/usr/bin/../lib/c++/v1/locale:2680:25: error:
member access into incomplete type 'tm'
__get_month(__tm->tm_mon, __b, __e, __err, __ct);
^
/usr/include/wchar.h:131:19: note: forward declaration of 'tm'
const struct tm * __restrict) __DARWIN_ALIAS(wcsftime);
^
fatal error: too many errors emitted, stopping now [-ferror-limit=]
20 errors generated.
make[2]: *** [CMakeFiles/audiowaveform.dir/src/Main.cpp.o] Error 1
make[1]: *** [CMakeFiles/audiowaveform.dir/all] Error 2
make: *** [all] Error 2

MP3 audio files out of sync with waveform

Hi Guys,

This is an issue that I've also posted on peaks.js.

MP3 audio files play out of sync with the waveform when using peaks.js. Not sure if this issue is caused by audiowaveform when the waveform is generated or when it is displayed in peaks.js.

AAC audio files seem to work perfectly and this is only an issue with MP3 audio files.

You can see examples on Rewind Radio:

AAC audio (works perfectly) - https://www.rewindradio.com/2ue/createclip
MP3 Audio (out of sync) - https://www.rewindradio.com/2gb/createclip

If anyone has any suggestions that would be great!

Thanks

Anthony

Media type of waveform data binary format?

Hi! I'm unable to find documentation about the media type (MIME-type) of the binary waveform data format.

I understand that this is a format designed by BBC and is not registered in IANA, but is there some vendor specific media type that is preferred?

Almost anything is better than serving the file as application/octet-stream :)

Can't build on Debian 3.2.60-1+deb7u1 i686 GNU/Linux

Hi all!

/home/ds/audiowaveform/src/Main.cpp:33:1: error: static_assert expression is not an integral constant expression
static_assert(std::numeric_limits<int>::max() >= 2147483647L, "size of int");
^             ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
1 error generated.
make[2]: *** [CMakeFiles/audiowaveform.dir/src/Main.cpp.o] Ошибка 1
make[1]: *** [CMakeFiles/audiowaveform.dir/all] Ошибка 2
make: *** [all] Ошибка 2
Debian clang version 3.0-6.2 (tags/RELEASE_30/final) (based on LLVM 3.0)
Target: i386-pc-linux-gnu
Thread model: posix
g++ (Debian 4.7.2-5) 4.7.2
gcc (Debian 4.7.2-5) 4.7.2

cmake ..
-- Build type not specified: default is Release
-- CMAKE_VERSION=2.8.9
-- Build type: Release
-- CMAKE_MODULE_PATH='/home/ds/audiowaveform/cmake/modules'
-- Building version 1.0.9
-- Boost version: 1.49.0
-- Found the following Boost libraries:
--   program_options
--   filesystem
--   regex
--   system
-- Boost_INCLUDE_DIRS='/usr/include'
-- Boost_LIBRARIES='/usr/lib/libboost_program_options-mt.so;/usr/lib/libboost_filesystem-mt.so;/usr/lib/libboost_regex-mt.so;/usr/lib/libboost_system-mt.so'
-- LIBSNDFILE_LIBRARY=/usr/lib/i386-linux-gnu/libsndfile.so
-- LIBGD_LIBRARY=/usr/lib/i386-linux-gnu/libgd.so
-- LIBMAD_LIBRARY=/usr/lib/libmad.so
-- CMAKE_CXX_COMPILER_VERSION='Debian clang version 3.0-6.2 (tags/RELEASE_30/final) (based on LLVM 3.0)
Target: i386-pc-linux-gnu
Thread model: posix'
-- CMAKE_CXX_FLAGS='-std=c++0x -DGTEST_LANG_CXX11=0 -Wall -Wextra -Wconversion -pedantic -DBOOST_FILESYSTEM_NO_DEPRECATED'
-- CMAKE_CXX_FLAGS_DEBUG='-g'
-- CMAKE_CXX_FLAGS_RELEASE='-O3 -DNDEBUG'
-- CMAKE_CXX_COMPILE_OBJECT='<CMAKE_CXX_COMPILER>  <DEFINES> <FLAGS> -o <OBJECT> -c <SOURCE>'
-- Unit tests disabled
-- CMAKE_INSTALL_PREFIX='/usr/local'
-- Configuring done
-- Generating done
-- Build files have been written to: /home/ds/audiowaveform/build
ds@flat:~/audiowaveform/build$ make
[ 15%] Built target doc
[ 15%] Building CXX object CMakeFiles/audiowaveform.dir/src/Main.cpp.o
/home/ds/audiowaveform/src/Main.cpp:33:1: error: static_assert expression is not an integral constant expression
static_assert(std::numeric_limits<int>::max() >= 2147483647L, "size of int");
^             ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
1 error generated.
make[2]: *** [CMakeFiles/audiowaveform.dir/src/Main.cpp.o] Ошибка 1
make[1]: *** [CMakeFiles/audiowaveform.dir/all] Ошибка 2
make: *** [all] Ошибка 2

why it can happens?

ds@flat:~/audiowaveform/build$ uname -a
Linux flat 3.2.0-4-486 #1 Debian 3.2.60-1+deb7u1 i686 GNU/Linux

Fresh install on mac

Hello Chris,

@mgrewal1 reported having troubles to compile audiowaveform using homebrew. I tried too and got this error message while compiling it:

$ cmake ..
-- The C compiler identification is Clang 5.0.0
-- The CXX compiler identification is Clang 5.0.0
-- Check for working C compiler: /usr/bin/cc
-- Check for working C compiler: /usr/bin/cc -- works
-- Detecting C compiler ABI info
-- Detecting C compiler ABI info - done
-- Check for working CXX compiler: /usr/bin/c++
-- Check for working CXX compiler: /usr/bin/c++ -- works
-- Detecting CXX compiler ABI info
-- Detecting CXX compiler ABI info - done
-- Build type not specified: default is Release
-- CMAKE_VERSION=2.8.10.1
-- Build type: Release
-- CMAKE_MODULE_PATH='/tmp/audiowaveform/cmake/modules'
-- Found LibGD: /usr/local/lib/libgd.dylib
-- Found LibSndFile: /usr/local/lib/libsndfile.dylib
-- Found LibMad: /usr/local/lib/libmad.dylib
-- Boost version: 1.55.0
-- Found the following Boost libraries:
--   program_options
--   filesystem
--   system
-- Boost_INCLUDE_DIRS='/usr/local/include'
-- Boost_LIBRARIES='/usr/local/lib/libboost_program_options-mt.dylib;/usr/local/lib/libboost_filesystem-mt.dylib;/usr/local/lib/libboost_system-mt.dylib'
-- LIBSNDFILE_LIBRARY=/usr/local/lib/libsndfile.dylib
-- LIBGD_LIBRARY=/usr/local/lib/libgd.dylib
-- LIBMAD_LIBRARY=/usr/local/lib/libmad.dylib
-- CMAKE_CXX_COMPILER_VERSION='5.0.0'
-- CMAKE_CXX_FLAGS='-stdlib=libc++ -std=c++0x -DGTEST_LANG_CXX11=0 -Wall -Wextra -Wconversion -pedantic -DBOOST_FILESYSTEM_NO_DEPRECATED'
-- CMAKE_CXX_FLAGS_DEBUG='-g'
-- CMAKE_CXX_FLAGS_RELEASE='-O3 -DNDEBUG'
-- CMAKE_CXX_COMPILE_OBJECT='<CMAKE_CXX_COMPILER>  <DEFINES> <FLAGS> -o <OBJECT> -c <SOURCE>'
CMake Error at CMakeLists.txt:224 (add_subdirectory):
  add_subdirectory given source "gmock" which is not an existing directory.


-- CMAKE_INSTALL_PREFIX='/usr/local'
-- Configuring incomplete, errors occurred!

Is it something that makes sense for you?

How to statically link libsndfile.so.1?

How do I modify the configure and make scripts so that libsndfile.so.1 is embedded in the binary? I need a single, working binary file with no external dependencies.

Thanks!

.dat to json not working correctly

audiowaveform -i test.dat -o test.json -w 700 -h 500
Reading waveform data file: test.dat
Sample rate: 16000 Hz
Bits: 8
Samples per pixel: 256
Length: 487829 points
Writing output file: test.json

I tried all options -s -e --pixels-per-seconds the returned data is always the same... it works well with image generation.
Is this a bug or I am not doing it right!
Btw. this an awesome library!!

m4a (AAC / ALAC) support?

I imagine the chances of this are quite remote, as it's a proprietary / patent-encumbered format.

It seems like it's a fairly popular format (for our use-case at least), which is annoying!

Is there a way to output data objects divided by 100?

Hi,
I tried to use Audiowaveform to generate JSON, the output is something like

{ ... "data":[0,0,0,0,-46,37 ...

Instead I would like to output data objects divided by 100.
Is there a built in option or something I can do for this? (reading the doc and searching the web I couldn't find it)

Best regards

"FileDeleter" used in many of the audiowaveform/test modules.

Not sure why FileDeleter deleter(filename); occurs before the test - can anyone explain? I would expect it to be after the test.

Also, why not use something like:
auto basename = boost::filesystem::unique_path("tmp-%%%%-%%%%-%%%%-%%%%"); instead of
char* basename = tempnam(nullptr, "aud"); since tempnam seems to be disliked by some people for security reasons and the existing code generates warnings in g++ 5.4.0 (Ubuntu 16.04).

Is the idea to have ".aud" as the extension if it is undefined?

Is the intention to put the temporary files in the build\temporary folder or does it really matter since FileDeleter will delete the files?

Add parameter to end time

The --start is such a great feature! But could be even better if there was a --end.
So far I am calculating the "end time" based on sample rate, zoom and start point.
But how great would be this as a built in functionality?

How to install on Amazon Lambda?

I have successfully installed audiowaveform on Amazon Linux (which is the same OS for Amazon Lambda), but I can't seem to find a way to create a unique executable file that will include all shared libraries in which audiowaveform depends upon (running ldd audiowaveform shows a lot of them). I can't think of any other way to achieve this. Any hints?

Being able to do this means that I would be able to run it on-demand not worrying about provisioning any EC2 servers (and then saving a lot of $ since my demand is very low).

Compile with libraries

I am trying to compile this so I can ship it an alpine docker container.

Unfortunately I am not too familiar with CMake or how I can run it to compile all of the library files so that I can move the binary to another machine and run it.

@chrisn Would you be able to offer some advice on this?

I am trying to create a Heroku buildpack so that this can be used with Heroku deployments - https://github.com/Mattchewone/heroku-buildpack-audiowaveform

feature: read input data from stdin

it would be nice to build pipes like this:

ffmpeg -i <movie_file> -f wav -  |  audiowaveform -i - -o file.json

without having to tmpfile-dump the wav file.

how to calculate the zoom from audio duration

need to show the waveform from the zero to the end of the audio duration how can i calculate the zoom i notice it depend on width -w too and the -z lets suppose i have song with 138 second how can i show the waveform from 0 to 138 second with width -w 480

generate .json from .mp3

Seems like you can't generate json from a mp3 directly?

audiowaveform -i test.mp3 -o test.json -z 256 -b 8

Can't generate "test.json" from "test.mp3"

Do I need to generate the .dat first, and then the .json from the .dat?

Quiet output option

Thanks for the fantastic utility. Would it be possible to have a "quiet" output option? I'm using this in an automated setting and it'd be great to disable the STDOUT output.

Thanks!

SIGTRAP error when running, after successful build on MacOS

After following the (very long) install instructions and getting a successful build (just warnings, though a lot of them), running make test or ./audiowaveform gives this error:

Process:               audiowaveform_tests [6594]
Path:                  /Users/USER/*/audiowaveform_tests
Identifier:            audiowaveform_tests
Version:               ???
Code Type:             X86-64 (Native)
Parent Process:        ctest [6593]
Responsible:           iTerm [560]
User ID:               501

Date/Time:             2015-02-12 15:31:45.190 -0800
OS Version:            Mac OS X 10.10.2 (14C109)
Report Version:        11
Anonymous UUID:        D3514B03-0A50-D2B3-6B96-1F43348C62D0

Sleep/Wake UUID:       C4848991-C318-4358-A1BF-53ABBC1B3C06

Time Awake Since Boot: 82000 seconds
Time Since Wake:       23000 seconds

Crashed Thread:        0

Exception Type:        EXC_BREAKPOINT (SIGTRAP)
Exception Codes:       0x0000000000000002, 0x0000000000000000

Application Specific Information:
dyld: launch, loading dependent libraries

Dyld Error Message:
  Library not loaded: /usr/local/lib/libFLAC.8.dylib
  Referenced from: /usr/local/lib/libsndfile.1.dylib
  Reason: no suitable image found.  Did find:
    /usr/local/lib/libFLAC.8.dylib: no matching architecture in universal wrapper
    /usr/local/lib/libFLAC.8.dylib: no matching architecture in universal wrapper

Binary Images:
    0x7fff624e2000 -     0x7fff62518837  dyld (353.2.1) <65DCCB06-339C-3E25-9702-600A28291D0E> /usr/lib/dyld
    0x7fff8e022000 -     0x7fff8e023fff  libSystem.B.dylib (1213) <90B107BC-FF74-32CC-B1CF-4E02F544D957> /usr/lib/libSystem.B.dylib
    0x7fff90327000 -     0x7fff9037bfff  libc++.1.dylib (120) <1B9530FD-989B-3174-BB1C-BDC159501710> /usr/lib/libc++.1.dylib

Model: MacBookPro11,3, BootROM MBP112.0138.B14, 4 processors, Intel Core i7, 2.3 GHz, 16 GB, SMC 2.19f12
Graphics: Intel Iris Pro, Intel Iris Pro, Built-In
Graphics: NVIDIA GeForce GT 750M, NVIDIA GeForce GT 750M, PCIe, 2048 MB
Memory Module: BANK 0/DIMM0, 8 GB, DDR3, 1600 MHz, 0x80AD, 0x484D54343147533641465238412D50422020
Memory Module: BANK 1/DIMM0, 8 GB, DDR3, 1600 MHz, 0x80AD, 0x484D54343147533641465238412D50422020
AirPort: spairport_wireless_card_type_airport_extreme (0x14E4, 0x134), Broadcom BCM43xx 1.0 (7.15.159.13.12)
Bluetooth: Version 4.3.2f6 15235, 3 services, 27 devices, 1 incoming serial ports
Network Service: Wi-Fi, AirPort, en0
Serial ATA Device: APPLE SSD SM0512F, 500.28 GB
USB Device: FA GoFlex Desk
USB Device: Internal Memory Card Reader
USB Device: Kinesis Keyboard Hub
USB Device: Evoluent VerticalMouse 4
USB Device: Composite Device
USB Device: BRCM20702 Hub
USB Device: Bluetooth USB Host Controller
USB Device: Apple Internal Keyboard / Trackpad
Thunderbolt Bus: MacBook Pro, Apple Inc., 17.1

Installing on a MacOSX El Capitan Errors

When trying to install via homebrew, I get the following error:

==> Installing audiowaveform from bbcrd/audiowaveform
==> Downloading https://github.com/bbcrd/audiowaveform/archive/1.0.10.tar.gz
Already downloaded: /Library/Caches/Homebrew/audiowaveform-1.0.10.tar.gz
==> cmake .. -DCMAKE_INSTALL_PREFIX='/usr/local/Cellar/audiowaveform/1.0.10' -DCMAKE_BUILD_TYPE=None -DCMAKE_FIND_FRAMEWORK=LAST -Wno-dev -DENABLE_TESTS=0 -DCMAKE_C_COMPILER=/usr/
==> make install
Last 15 lines from /Users/admin/Library/Logs/Homebrew/audiowaveform/02.make:
         ^
[ 35%] Building CXX object CMakeFiles/audiowaveform.dir/src/MathUtil.cpp.o
[ 40%] Building CXX object CMakeFiles/audiowaveform.dir/src/Mp3AudioFileReader.cpp.o
/tmp/audiowaveform20160408-3565-10gtue5/audiowaveform-1.0.10/src/Mp3AudioFileReader.cpp:62:10: fatal error: 'mad.h' file not found
#include <mad.h>
         ^
1 error generated.
make[2]: *** [CMakeFiles/audiowaveform.dir/src/Main.cpp.o] Error 1
make[2]: *** Waiting for unfinished jobs....
1 error generated.
make[2]: *** [CMakeFiles/audiowaveform.dir/src/GdImageRenderer.cpp.o] Error 1
1 error generated.
make[2]: *** [CMakeFiles/audiowaveform.dir/src/Mp3AudioFileReader.cpp.o] Error 1
make[1]: *** [CMakeFiles/audiowaveform.dir/all] Error 2
make: *** [all] Error 2

READ THIS: https://git.io/brew-troubleshooting
If reporting this issue please do so at (not Homebrew/brew):
  https://github.com/bbcrd/homebrew-audiowaveform/issues

PNG output test failures w/ [email protected]

Test are ran on OSX.

[  FAILED  ] 4 tests, listed below:
[  FAILED  ] OptionHandlerTest.shouldRenderWaveformImageFromBinaryWaveformData
[  FAILED  ] OptionHandlerTest.shouldRenderWaveformImageFromWavAudio
[  FAILED  ] OptionHandlerTest.shouldRenderWaveformImageFromMp3Audio
[  FAILED  ] OptionHandlerTest.shouldRenderWaveformImageFromFlacAudio
[ RUN      ] OptionHandlerTest.shouldRenderWaveformImageFromBinaryWaveformData
/Users/thomaspa/Projects/audiowaveform/test/OptionHandlerTest.cpp:67: Failure
Value of: a.size()
Expected: is equal to 4954
  Actual: 4975 (of type unsigned long)
[  FAILED  ] OptionHandlerTest.shouldRenderWaveformImageFromBinaryWaveformData (12 ms)
[ RUN      ] OptionHandlerTest.shouldRenderWaveformImageFromWavAudio
/Users/thomaspa/Projects/audiowaveform/test/OptionHandlerTest.cpp:67: Failure
Value of: a.size()
Expected: is equal to 4980
  Actual: 5001 (of type unsigned long)
[  FAILED  ] OptionHandlerTest.shouldRenderWaveformImageFromWavAudio (14 ms)
[ RUN      ] OptionHandlerTest.shouldRenderWaveformImageFromMp3Audio
/Users/thomaspa/Projects/audiowaveform/test/OptionHandlerTest.cpp:67: Failure
Value of: a.size()
Expected: is equal to 4980
  Actual: 5001 (of type unsigned long)
[  FAILED  ] OptionHandlerTest.shouldRenderWaveformImageFromMp3Audio (21 ms)
[ RUN      ] OptionHandlerTest.shouldRenderWaveformImageFromFlacAudio
/Users/thomaspa/Projects/audiowaveform/test/OptionHandlerTest.cpp:67: Failure
Value of: a.size()
Expected: is equal to 4980
  Actual: 5001 (of type unsigned long)
[  FAILED  ] OptionHandlerTest.shouldRenderWaveformImageFromFlacAudio (17 ms)

Let me know if you need additional details about CPU/architecture/etc.

Cannot build source on windows

Hi there,
I have problems building the library using cmake on windows due to dependencies.. is there any binary out there for windows already built...

Thanks!

Feature request: Ability to have much less samples

I have files that are 60-500 minutes, and all I need are at most 900 samples.

An example file: 141482 frames, (61:35.856) 3695.856
Even --pixels-per-second 1 gives 22K of JSON data.
We can pre-calculate the desired 'pixels-per-second' value (in this example case, it would be roughly --pixels-per-second 0.2165. 500 minutes would be roughly .0267), but audiowaveform seems to only take an integer.

Blue-sky, it would be great to have a '--desired-samples` that uses the first frame, the last frame, and calculates the spacing needed to reach the right number of frames, but that feels like a complex ask. :)

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.