Mercurial > hg > beaglert
comparison projects/basic_sensor/render.cpp @ 12:a6beeba3a648
Initial support for higher matrix sample rates by reducing the number of channels. Input not tested yet, and not all examples updated to new format.
author | andrewm |
---|---|
date | Thu, 22 Jan 2015 19:00:22 +0000 |
parents | 09f03ac40fcc |
children | 6adb088196a7 |
comparison
equal
deleted
inserted
replaced
11:517715b23df0 | 12:a6beeba3a648 |
---|---|
29 // userData holds an opaque pointer to a data structure that was passed | 29 // userData holds an opaque pointer to a data structure that was passed |
30 // in from the call to initAudio(). | 30 // in from the call to initAudio(). |
31 // | 31 // |
32 // Return true on success; returning false halts the program. | 32 // Return true on success; returning false halts the program. |
33 | 33 |
34 bool initialise_render(int numChannels, int numMatrixFramesPerPeriod, | 34 bool initialise_render(int numMatrixChannels, int numAudioChannels, |
35 int numAudioFramesPerPeriod, float matrixSampleRate, | 35 int numMatrixFramesPerPeriod, |
36 float audioSampleRate, void *userData) | 36 int numAudioFramesPerPeriod, |
37 float matrixSampleRate, float audioSampleRate, | |
38 void *userData) | |
37 { | 39 { |
38 if(numMatrixFramesPerPeriod*2 != numAudioFramesPerPeriod) { | 40 if(numMatrixFramesPerPeriod*2 != numAudioFramesPerPeriod) { |
39 rt_printf("Error: this example needs the matrix enabled, running at half audio rate\n"); | 41 rt_printf("Error: this example needs the matrix enabled, running at half audio rate\n"); |
40 return false; | 42 return false; |
41 } | 43 } |
42 | 44 |
43 gNumChannels = numChannels; | 45 gNumChannels = numAudioChannels; |
44 gInverseSampleRate = 1.0 / audioSampleRate; | 46 gInverseSampleRate = 1.0 / audioSampleRate; |
45 gPhase = 0.0; | 47 gPhase = 0.0; |
46 | 48 |
47 return true; | 49 return true; |
48 } | 50 } |