Skip to content

Commit

Permalink
minor tweaks, flac example file
Browse files Browse the repository at this point in the history
  • Loading branch information
npisanti committed Apr 13, 2018
1 parent 549eab8 commit 6c21f99
Show file tree
Hide file tree
Showing 4 changed files with 15 additions and 14 deletions.
6 changes: 4 additions & 2 deletions README.md
Original file line number Diff line number Diff line change
@@ -1,7 +1,9 @@
ofxAudioFile
=====================================
cross platform audio file loading addon for openFrameworks, wrapping [dr_wav](https://github.com/mackron/dr_libs/blob/master/dr_wav.h), [dr_mp3](https://github.com/mackron/dr_libs/blob/master/dr_mp3.h), [dr_flac](https://github.com/mackron/dr_libs/blob/master/dr_flac.h) and [stb_vorbis](https://github.com/nothings/stb/blob/master/stb_vorbis.c), so you can read Wav, mp3, FLAC and Ogg Vorbis.
cross platform audio file loading addon for openFrameworks, wrapping [dr_wav](https://github.com/mackron/dr_libs/blob/master/dr_wav.h), [dr_mp3](https://github.com/mackron/dr_libs/blob/master/dr_mp3.h), [dr_flac](https://github.com/mackron/dr_libs/blob/master/dr_flac.h) and [stb_vorbis](https://github.com/nothings/stb/blob/master/stb_vorbis.c), so you can read Wav, mp3, FLAC and Ogg Vorbis. Works on Linux (desktop and raspberry pi), Windows, OSX, Android and iOS. This addon does not play back samples, it just let you access the float values of the audio file waveform. For sample playing you could use the oF included classes or for more advanced sample playback you could try [ofxPDSP](https://github.com/npisanti/ofxPDSP).

As just standard c++ headers are needed for compiling this addon, it should be also possible to use it without openFrameworks.

Example app loads a mp3 file, or you can drag and drop files in the window if your platform let you do that.

As all those libraries are public domain, also this addon have an [unlicense](http://unlicense.org/).
As all those libraries are public domain, also this addon have an [unlicense](http://unlicense.org/).
9 changes: 0 additions & 9 deletions addon_config.mk
Original file line number Diff line number Diff line change
Expand Up @@ -46,15 +46,6 @@ common:
# ADDON_LIBS_EXCLUDE =

linux64:
# binary libraries, these will be usually parsed from the file system but some
# libraries need to passed to the linker in a specific order/
#
# For example in the ofxOpenCV addon we do something like this:
#
# ADDON_LIBS =
# ADDON_LIBS += libs/opencv/lib/linuxarmv6l/libopencv_legacy.a
# ADDON_LIBS += libs/opencv/lib/linuxarmv6l/libopencv_calib3d.a
# ...
linux:
win_cb:
linuxarmv6l:
Expand Down
Binary file added example/bin/data/tubophone.flac
Binary file not shown.
14 changes: 11 additions & 3 deletions example/src/ofApp.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -5,9 +5,17 @@
void ofApp::setup(){
ofBackground( 0 );

audiofile.load( "data/tubophone.mp3");
//audiofile.load( "data/tubophone.wav"); // mono wav source file
//audiofile.load( "data/tubophone.ogg"); // ogg/vorbis
//std::string filepath = "data/tubophone.mp3";
//std::string filepath = "data/tubophone.wav"; // mono wav source file
//std::string filepath = "data/tubophone.ogg"; // ogg/vorbis
std::string filepath = "data/tubophone.flac"; // FLAC

if( ofFile::doesFileExist( filepath, false ) ){
audiofile.load( filepath );
}else{
ofLogError()<<"input file does not exists";
}

}

//--------------------------------------------------------------
Expand Down

0 comments on commit 6c21f99

Please sign in to comment.