   wave.play();
 }
 
+
+#define NUMMAX 10
+short nums[NUMMAX];
+short numindex = 0;//points to first empty space
+char FileName[NUMMAX+5];
+
+void addnum(char num) {
+  if(numindex < NUMMAX) {
+    nums[numindex++] = num;
+  }
+  #ifdef DEBUG
+  else {
+    Serial.println("numindex over max");
+  }
+  #endif//DEBUG
+}
+
+void removenum() {
+  if(numindex > 0) {
+    --numindex;
+  }
+  #ifdef DEBUG
+  else {
+    Serial.println("trying to remove from empty num list");
+  }
+  #endif//DEBUG
+}
+
+short fillnum() {
+  short fnindex;
+  {for(fnindex = 0; fnindex < numindex; ++fnindex) {
+    Serial.println(nums[fnindex]);
+    FileName[fnindex] = (char)(nums[fnindex] + '0');
+  }}
+
+  return fnindex;
+}
+
+void makeFileName() {
+  short fnindex = fillnum();
+
+  FileName[fnindex++] = '.';
+  FileName[fnindex++] = 'w';
+  FileName[fnindex++] = 'a';
+  FileName[fnindex++] = 'v';
+  FileName[fnindex++] = '\0';
+}
+
+void printFileName() {
+  makeFileName();
+  Serial.println(FileName);
+}
 
 void setup() {
   

long lastHangDebounceTime = 0;  // the last time the reciever pin was toggled
long lastDialDebounceTime = 0; // last time the dial switch was toggled
long lastCountDebounceTime = 0;
const long debounceDelay = 50;    // the debounce time; increase if the output flickers
const long countDebounceDelay = 10;

State phoneState = nodial;


used in the Theater Ninjas play Turing Machine.

Coded by Eric Faehnrich

don't have 0 in file name, must be in root directory of sd card

22khz 16 bit mono
ffmpeg -i 111.mp3 -acodec pcm_s16le -ac 1 -ar 16000 out.wav
*/

#include <WaveHC.h>
