Hi All,

Faust code sometimes need to load external sounds: the ffunction mechanism can 
be used to that.

For our internals needs, we have develop a help tool that could be useful for 
everyone. It allows to convert a sound file in a pure C header file, containing 
all samples in a static table, to be used with the ffunction mechanism.

The tool is called "faust-sound-converter" and the corresponding .cpp file is 
located in the architecture file. It requires libsndfile 
(http://www.mega-nerd.com/libsndfile/). You will have to compile it manually 
(for now…)

g++ -O3 faust-sound-converter.cpp -lsndfile -o faust-sound-converter

then :

 faust-sound-converter foo.wav ==> will create a foo.wav.h file containing the 
sound as the C table. The exported functions are called "soundFileSize" and 
"readSoundFile"

Then use the following code in your Faust DSP : 

tableSize =  ffunction(int soundFileSize (), <foo.wav.h>,"");
readSoundFile = ffunction(float readSoundFile (int), <foo.wav.h>,"");

Stéphane 
------------------------------------------------------------------------------
October Webinars: Code for Performance
Free Intel webinars can help you accelerate application performance.
Explore tips for MPI, OpenMP, advanced profiling, and more. Get the most from 
the latest Intel processors and coprocessors. See abstracts and register >
http://pubads.g.doubleclick.net/gampad/clk?id=60134071&iu=/4140/ostg.clktrk
_______________________________________________
Faudiostream-users mailing list
Faudiostream-users@lists.sourceforge.net
https://lists.sourceforge.net/lists/listinfo/faudiostream-users

Reply via email to