carlhudson83
New member
Hi,
Apologies if this problem is caused by my fumbling of C++ classes, but I'm trying to create a small custom audio object, and I can't seem to construct it properly..
Here's my custom audio class:
And I create it in setup() with this:
I'd like it's update() method to modify a wavetable array pointer every 128 samples..
But at the moment, the update() method is not being called by the interrupt.. Have I constructed it wrong?
Thanks,
Carl
Apologies if this problem is caused by my fumbling of C++ classes, but I'm trying to create a small custom audio object, and I can't seem to construct it properly..
Here's my custom audio class:
Code:
class AudioBlockPlayer : public AudioStream
{
public:
AudioBlockPlayer() : AudioStream(0, NULL) { begin(); }
void begin(void);
virtual void update(void);
int onFlag;
private:
audio_block_t *inputQueueArray[1];
};
void AudioBlockPlayer::begin(void)
{
onFlag = 1;
}
void AudioBlockPlayer::update(void)
{
testCount++;
if (testCount > 4) testCount = 0;
}
And I create it in setup() with this:
Code:
AudioBlockPlayer blockPlayer;
blockPlayer.begin();
I'd like it's update() method to modify a wavetable array pointer every 128 samples..
But at the moment, the update() method is not being called by the interrupt.. Have I constructed it wrong?
Thanks,
Carl