35 jack_default_audio_sample_t **
outs;
47 oss<<
"jack wants "<<nframes<<
" to process which doesn't divide by the number of frames which WSOLA can process in one step "<<
getOutputSize()<<
'\t';
53 outs[i] = ( jack_default_audio_sample_t* ) jack_port_get_buffer (
outputPorts[i] , nframes);
56 while (processed!=nframes) {
61 outs[i][processed+j]=
output(i, j);
63 N=
process(timeScale, audioData);
68 cerr<<
"couldn't read audio, wanted "<<N<<
" got "<<ret<<
" rolling out"<<endl;
82 Matrix<FP_TYPE, Dynamic, Dynamic>
output;
83 int ret=sox.
read(audioData, sampleCount);
84 audioData.transposeInPlace();
85 if (audioData.cols()!=sampleCount){
86 cout<<
"couldn't read "<<sampleCount<<
" samples only read "<<ret<<endl;
87 cout<<
"readAudio "<<audioData.rows()<<
'\t'<<audioData.cols()<<endl;
91 return audioData.cols();
107 exit(
WSOLADebug().evaluateError(ret, fileName));
120 cerr<<
"couldn't read audio, wanted "<<N<<
" got "<<ret<<endl;
124 cout<<
"Jack : sample rate set to : "<<
getSampleRate()<<
" Hz"<<endl;
125 cout<<
"Jack : block size set to : "<<
getBlockSize()<<
" samples"<<endl;
127 outs =
new jack_default_audio_sample_t*[sox.
getChCntIn()];
133 N=
process(timeScale, audioData);
138 cerr<<
"couldn't read audio, wanted "<<N<<
" got "<<ret<<endl;
164 #endif // WSOLAJACK_H_ #define SOX_READ_MAXSCALE_ERROR
Sox couldn't open the filename.max to read the rescale value for the audio file.
~WSOLAJack(void)
Destructor.
virtual int createPorts(string inName, int inCnt, string outName, int outCnt)
int N
The number of audio samples required by WSOLA from the audio file.
int openRead(string fileName)
void setTimeScale(FP_TYPE ts)
virtual int getBlockSize()
virtual int evaluateError(int errorNum)
virtual int startClient()
WSOLAJack(string fileName)
int setBlockSize(int size)
#define NO_ERROR
There is no error.
jack_default_audio_sample_t ** outs
The number of output port created for this audio stream.
Sox< FP_TYPE > sox
Audio file reading class.
FP_TYPE timeScale
The time scale to use for speed scaling the audio.
int readAudio(int sampleCount)
int getSampleRate(void) const
int processAudio(jack_nframes_t nframes)
int getSamplesRequired(void)
void setMaxVal(double newMax)
virtual int connect(string clientName_)
Array< FP_TYPE, Dynamic, Dynamic > output
The output vector, each row is a channel.
#define WSOLA_NFRAMES_JACK_ERROR
Occurs when jack wants to process nframes which is not divisible by N/2.
int process(FP_TYPE timeScale, const DenseBase< Derived > &input)
Matrix< FP_TYPE, Dynamic, Dynamic > audioData
The audio data which has been read from the sox file.
vector< jack_port_t * > outputPorts
The output ports.
int read(Eigen::DenseBase< Derived > &audioData, int count=0)