Yes, see faust2android -h:

Usage: faust2android [-install] [-source] [-swig] [-faust] [-reuse] 
[-soundfile] [-osc] [-debug] [additional Faust options (-vec -vs 8...)] 
<file.dsp>
Use '-install' once compilation is over, installs the generated app on the 
Android device connected to the computer.
Use '-source' creates an eclipse project of the app in the current directory.
Use '-swig' regenerate the C++ and the JAVA interface for the native portion of 
the app.
Use '-faust' only carries out the Faust compilation and install the generated 
C++ file in the JNI folder.
Use '-reuse' keep build directory and reuse it to speedup compilation.
Use '-soundfile' when compiling DSP using 'soundfile' primitive, to add needed 
resources
Use '-osc' to active OSC interface
Use '-debug' verbose output.

So basically:

faust2android -soundfile  tsndfile.dsp.

Or faust2api -h

….
To generate an Android API, run: faust2api -android yourFaustCode.dsp
….
Android specific options:
   -package: set the JAVA package name (e.g. '-package mypackage' will change 
the JAVA package name to 'mypackage.DspFaust'). The default package name is 
'com.DspFaust.'
   -soundfile : add built-in Soundfile support to the API.
….

So:

faust2api -soundfile  tsndfile.dsp

As suggested by Julius I recently added a -resample parameter to have the sound 
files be resampled at load/init time using libsamplerate 
(http://www.mega-nerd.com/SRC/). This is currently only added in faust2jack, 
faust2caqt and faust2jaqt scripts

Stéphane 

> Le 13 juin 2019 à 22:30, Selim <[email protected]> a écrit :
> 
> Hello,
> Is it possible to run this on android ?
> 
> Le sam. 8 juin 2019 à 01:41, Julius Smith <[email protected]> a écrit :
> Thanks to Stéphane for helping me create this working example:
> 
> // Test soundfile primitive
> //
> // USAGE:
> //
> // > faust2caqt -soundfile tsndfile.dsp
> //
> // Doc: https://faust.grame.fr/doc/manual/index.html#soundfile-primitive
> 
> gate = button("gate");
> inc = 1;
> play(i) = i, _~(*(gate):+(inc*gate)); // play i'th soundfile
> process = play(0) : soundfile("son[url:{'/w/s/wav/uh-oh-.wav'}]",2):!,!,_,_;
> // or soundfile("label[url:{'path1';'path2';'path3'}]", n);
> 
> 
> On Fri, Jun 7, 2019 at 1:46 AM Julius Smith <[email protected]> wrote:
> >
> > Hi Stéphane,
> >
> > This sounds really useful!  I tried it just now and it did not work,
> > and I don't understand the error message.  What does it mean?
> >
> > Thanks,
> > - Julius
> >
> > > cat tsndfile.dsp
> > // Test soundfile primitive
> > // Doc: https://faust.grame.fr/doc/manual/index.html#soundfile-primitive
> > n = 1;
> > process = soundfile("mylabel[url:/w/s/wav/uh-oh-.wav]", n);
> > // or soundfile("label[url:{'path1';'path2';'path3'}]", n);
> >
> > > faust tsndfile.dsp
> > ERROR : out of range soundfile part number (interval() instead of
> > interval(0,255)) in expression :
> > length(soundfile(mylabel[url:/w/s/wav/uh-oh-.wav]),int(IN[0]))
> >
> > > sndinfo /w/s/wav/uh-oh-.wav
> > ========================================
> > File : /w/s/wav/uh-oh-.wav
> > Length : 17903
> > RIFF : 17895
> > WAVE
> > fmt  : 16
> >   Format        : 0x1 => WAVE_FORMAT_PCM
> >   Channels      : 1
> >   Sample Rate   : 11025
> >   Block Align   : 1
> >   Bit Width     : 8
> >   Bytes/sec     : 11025
> > *** 'data' chunk should be an even number of bytes in length.
> > data : 17859
> > End
> >
> > ----------------------------------------
> > Sample Rate : 11025
> > Frames      : 17859
> > Channels    : 1
> > Format      : 0x00010005
> > Sections    : 1
> > Seekable    : TRUE
> > Duration    : 00:00:01.620
> > Signal Max  : 128 (0.00 dB)
> >
> > > faust --version
> > FAUST Version 2.17.13
> > Embedded backends:
> >    DSP to C
> >    DSP to C++
> >    DSP to Java
> >    DSP to old C++
> >    DSP to WebAssembly (wast/wasm)
> >    DSP to SOUL
> > Copyright (C) 2002-2019, GRAME - Centre National de Creation Musicale.
> > All rights reserved.
> >
> > On Thu, Jun 6, 2019 at 11:24 PM Stéphane Letz <[email protected]> wrote:
> > >
> > > Hi Gary,
> > >
> > > Currently soundfile support is done using the language « soundfile » 
> > > primitive, that allows to load files at DSP init time, and process them 
> > > in the code, see: 
> > > https://faust.grame.fr/doc/manual/index.html#soundfile-primitive.
> > >
> > > There is no « please save this buffer to a WAV file » support for now. 
> > > This would require a bit of development at « architecture file level » 
> > > that is , developing a piece of code to somewhat keep audio outputs and 
> > > write them on disk on the fly. This is an additional code that does audio 
> > > files read as a separated DSP object using Libsndfile here: 
> > > https://github.com/grame-cncm/faust/blob/master-dev/architecture/faust/dsp/sound-player.h.
> > >  This could serve an an example to start with.
> > >
> > > Note that your requirement could be precised, discussing that on the 
> > > Faust Slack channel 
> > > here:https://join.slack.com/t/faustaudio/shared_invite/enQtNjQ2NDU1OTY4MjQ1LWRlMDY0OTc0ZmM3ZTc5ZjA4MTQzMTYxYzAzZmJiOTMwYzMxNjdiZjlkNTQxYTJiOWUxNzNlMzcyMGNhNDMyODY
> > >
> > > Stéphane
> > >
> > > > Le 7 juin 2019 à 00:29, Gary Worsham <[email protected]> a écrit :
> > > >
> > > > I'm thinking of implementing something like this, where it has a looper 
> > > > and instruments and MIDI and an external input and you could build up 
> > > > some crazy loops that way.  Well it would be a shame just to lose them 
> > > > every time you wanted to start fresh, so I'm wondering if there's a way 
> > > > to say "please save this buffer to a WAV file".
> > > >
> > > > Thanks,
> > > >
> > > > GW
> > > > _______________________________________________
> > > > Faudiostream-users mailing list
> > > > [email protected]
> > > > https://lists.sourceforge.net/lists/listinfo/faudiostream-users
> > >
> > >
> > >
> > > _______________________________________________
> > > Faudiostream-users mailing list
> > > [email protected]
> > > https://lists.sourceforge.net/lists/listinfo/faudiostream-users
> >
> >
> >
> > --
> >
> > Julius O. Smith III <[email protected]>
> > Professor of Music and, by courtesy, Electrical Engineering
> > CCRMA, Stanford University
> > http://ccrma.stanford.edu/~jos/
> 
> 
> 
> -- 
> 
> Julius O. Smith III <[email protected]>
> Professor of Music and, by courtesy, Electrical Engineering
> CCRMA, Stanford University
> http://ccrma.stanford.edu/~jos/
> 
> 
> _______________________________________________
> Faudiostream-users mailing list
> [email protected]
> https://lists.sourceforge.net/lists/listinfo/faudiostream-users



_______________________________________________
Faudiostream-users mailing list
[email protected]
https://lists.sourceforge.net/lists/listinfo/faudiostream-users

Reply via email to