Pages: [1]   Go Down
Author Topic: simpleAudioPlayer : where is isrId set ?  (Read 538 times)
0 Members and 1 Guest are viewing this topic.
Offline Offline
Full Member
Karma: 2
Posts: 109
View Profile
 Bigger Bigger  Smaller Smaller  Reset Reset

Hi all, I'm studying simple Audio Player in order to output a wave table.
after I strip the unnecessary stuff, the sketch works once. not repeatedly.
can anybody spot the problem ?

when looking at the audio.cpp and daq.cpp, I noticed isrId. it seems it is
never given it's proper value (38 I believe ?).
But I'm a newbie on cpp, can anybody check and tell me where this
variable is set, or why the programming is OK without giving it a value ?

my stripped sketch, which hangs after one round :
#include <Audio.h>

void setup()
  // 44100Khz stereo => 88200 sample rate
  // 100 mSec of prebuffering.
  Audio.begin(44100, 100);

void loop()
  const int S=1024; // Number of samples to read in block
  short buffer[S];
  // no sine yet, just a ramp, within the 12 bits...
  for (short i = 0; i<S ; i++) {buffer[i]=i;} 
  // Audio.prepare(buffer, S, volume); not needed as values are 12 bits unsigned already
  // Feed samples to audio
  Audio.write(buffer, S);


Pages: [1]   Go Up
Jump to: