Wrote this (untested code) before the discussion.
If I understood what you wanted to do this should do it (I believe) using less memory than any of the presented methods.
const uint8_t pinSPEAKER = 1;
const uint8_t pinANALOG_SENSOR = 2;
const unsigned long ONE_SECOND = 1000UL;
const unsigned long TWO_SECONDS = 2UL * ONE_SECOND;
const unsigned long THREE_SECONDS = 3UL * ONE_SECOND;
const unsigned long TONE_TIME_ON = 250UL;
const unsigned long TONE_TIME_OFF = 250UL;
const unsigned long SAMPLE_DELAY = 300UL;
const int SAMPLE_COUNT = 4;
void signal(const int n)
{
for ( int i = n; i--; )
{
tone(1, 4500);
delay(TONE_TIME_ON);
noTone(1);
delay(TONE_TIME_OFF);
}
delay(THREE_SECONDS);
}
void signal_number(int value)
{
int place;
int digit;
if ( value < 10 )
{
signal(value);
}
else
{
place = value / 10;
signal_number(place);
digit = value % 10;
signal(digit);
}
}
void loop()
{
int val = 0;
for ( int i = SAMPLE_COUNT, val = 0; i--; )
{
val = analogRead(pinANALOG_SENSOR);
delay(SAMPLE_DELAY);
}
int average = val / SAMPLE_COUNT;
signal_number(average);
}
void setup()
{
pinMode(pinSPEAKER, OUTPUT);
delay(THREE_SECONDS);
}