Taking variables from serial monitor in an array

i have connected a microphone with arduino uno and i am using uspeech library, As i speak in the mic the data appears in the form of alphabets and when i am quite there will be no data. I want to take the data in the array as soon as i start speaking and when i speak again the array should contain the new series of data.The data on the serial monitor is in the form of:
o
o
o
a
e
e

o
o
e
e
e
e

e
e

Please tell me how to do that thank you in advance

Your question isn't very clear. Is Arduino connected to the microphone? IF Arduino is the thing sending the data to the Serial monitor in the first place then you don't need to get anything from the Serial monitor. You just need to look at the code you have and in all the places where you send some value to the Serial monitor, do something different with the value if you want to.

Either way, we can't be of any help to you without code.

Thank you for your reply.Yes the microphone is connected with the microphone and a bluetooth device(hc-05).As i speak in the microphone the data describe above appears on the serial monitor then i send this data from one arduino to other using hc05 but on the other monitor instead of the same data i want to see the count of alphabets that appear everytime i speak in the microphone like 6 6 2 fro above example.

Delta_G:
Either way, we can't be of any help to you without code.

Here is the code on sender arduino

#include <SoftwareSerial.h>
#include <uspeech.h>
signal voice(A0);
#define rxPin 11
#define txPin 12
SoftwareSerial myserial= SoftwareSerial(rxPin,txPin);
 void setup(){
  Serial.begin(9600);
  myserial.begin(9600);
   voice.calibrate();
  //voice.f_enabled = true;
  voice.minVolume = 1000;
  voice.fconstant = 300;
  voice.econstant = 2;
  voice.aconstant = 4;
  voice.vconstant = 6;
  voice.shconstant = 10;
}
void loop()
{
     Serial.println(voice.getPhoneme());
     myserial.println(voice.getPhoneme());
     delay(100);
     
    
}

and here is the code on the receiving arduino

void setup()
{ 
Serial.begin(9600);
Serial1.begin(9600);
}

void loop()
{
 if ( Serial.available() )   {  Serial1.write( Serial.read() );  }
  }
  
}

this prints the same data as appearing on the sender i have no idea how to count the no of alphabets everytime i speak in microphone

Aiman-Farid:
i have no idea how to count the no of alphabets everytime i speak in microphone

Can you be more specific about what you want to do. You want the receiver to count how many times the sender sends it a letter? That's easy. Every time you read a character from the Serial line, add one to a counter.

int howManyLettersReceived

void setup()
{ 
Serial.begin(9600);
Serial1.begin(9600);
}

void loop()
{
 if ( Serial.available() )   {  
     Serial1.write( Serial.read() );  
     howManyLettersReceived++;
  }
  
}

Actually my main task is to count how many o’s (alphabet) occurs whenever i speak for example when i say one in the mic i got
o
o
e
e
so it means 2 o’s
then again i said two in the microphone i got
e
e
e
it means 0 o’s
but this work have to be done continuously on the sender side the serial monitor will continuously show the alphabets and on the receiver side number of o’s for that word will be shown

Well, same concept but test that the thing you read was an 'o'.

int oCount;

void setup()
{ 
Serial.begin(9600);
Serial1.begin(9600);
}

void loop()
{
 if ( Serial.available() )   {  
     char c = Serial.read();
     if(c == 'o'){
          oCount++;
     }
  }
  
}

And then at whatever point in there you want, either every pass of loop (don't do that), or inside the available() test or right after you increment the counter you simply print out that oCount variable.

Serial1.print("The number of o's so far =  ");
Serial1.println(oCount);

This code is almost certainly incorrect

void loop()
{
     Serial.println(voice.getPhoneme());
     myserial.println(voice.getPhoneme());
     delay(100);
}

because it sends two different phonemes.
I suspect you want to send the same phoneme to both serial devices and if so the code should be

void loop()
{
     char phonemeChar = voice.getPhoneme();
     Serial.println(phonemeChar);
     myserial.println(phonemeChar);
     delay(100);
}

If this was my project I would be very tempted to do the counting on the sending Arduino and then when the character changes just send the character and the count.

Something like

void loop()
{
     static char phonemeChar = ''
     static char prevChar = phonemeChar;
     static byte charCount = 0;
     phonemeChar = voice.getPhoneme();
     if (phonemeChar == prevChar) {
          charCount ++;
     }
     else {
         Serial.print(phonemeChar);
         Serial.print(',');
         Serial.println(charCount);
         myserial.println(phonemeChar);
         myserial.print(',');
         myserial.println(charCount);
         charCount = 1;
     }
     delay(100);
}

Then you could use the second example in Serial Input Basics to receive the data and the parse example to split it up.

...R

Thank you for your time.May be i am not clear in defining my object. I have to count the no of o's in between the white spaces ( blank lines). Will it do that ? i man as soon as i start speaking it will count o's and when there is silence it won't count and then again if i speak it will count and so on?
so the output on sender/receiver should be
SENDER ////// receiver
o
o
e
e
2

d
d
o
o
2

e
e
0

So now you want it to stop counting and reset the count anytime you quit speaking. I think we've given you enough to go on. I think it's time for you to put in some work. See if you can put it together and if it doesn't work come post it here and we'll help you get it right.

Aiman-Farid:
May be i am not clear in defining my object. I have to count the no of o’s in between the white spaces ( blank lines).

I was certainly unclear. I thought you wanted to count the number of times each character appeared.

I still think you should do the counting on the sending Arduino. But you will need code to identify when a “white space” occurs. You can use millis() to measure the interval between characters. If the interval exceeds a preset value you have “white space”.

I don’t know exactly how your phoneme library works so I can’t make specific suggestions. The general idea is to save the value of millis() every time a character is received and use something like this to test for an interval

if (millis() - lastSavedMillis >= intervalMillis) {
   // we have white space
}

Now, as @Delta_G has said, it’s time for you to do some work.

…R
PS, if you need to measure time between characters I reckon it is essential to do that on the Arduino that is calling the phoneme library to ensure you eliminate the risk of other timing glitches causing confusion.