From a9b7b73bc1bbe47affa034a7dec09b7acbd0e267 Mon Sep 17 00:00:00 2001 From: Mick Grierson Date: Wed, 12 Oct 2011 00:23:56 +0100 Subject: Support for loading a specific channel from a stereo wav file as an argument to the load function. Default is channel 0 --- maximilian.cpp | 13 ++++++++++++- 1 file changed, 12 insertions(+), 1 deletion(-) (limited to 'maximilian.cpp') diff --git a/maximilian.cpp b/maximilian.cpp index 3b4d660..a9cdcfc 100644 --- a/maximilian.cpp +++ b/maximilian.cpp @@ -332,8 +332,9 @@ double *maxiMix::ambisonic(double input,double eight[8],double x,double y,double } -bool maxiSample::load(string fileName) { +bool maxiSample::load(string fileName, int channel) { myPath = fileName; + readChannel=channel; return read(); } @@ -396,6 +397,16 @@ bool maxiSample::read() length=myDataSize*(0.5/myChannels); inFile.close(); // close the input file + if (myChannels>1) { + int position=0; + int channel=readChannel*2; + for (int i=channel;i