An Error With Compiling For Board Arduino/Genuino Uno

Hi! Can you please help me with my code? I attach a copy below.

#include <TimerOne.h>
#include "receiver_types.h"
#include "SD.h"
#define SD_ChipSelectPin 10           
#include "TMRpcm.h"                   
#include "SPI.h"


#define INT_REF 

enum receiver_state frame_state = IDLE ;

//This defines receiver properties
#define SENSOR_PIN 3
#define SYMBOL_PERIOD 500
#define SAMPLE_PER_SYMBOL 4
#define WORD_LENGTH 10 
#define SYNC_SYMBOL 0xD5 
#define ETX 0x03 
#define STX 0x02 //Start or frame symbol 


// global variables for frame decoding
char frame_buffer[38] ;
int frame_index  = -1 ;
int frame_size = -1 ;

unsigned int signal_mean = 0 ;
unsigned long acc_sum = 0 ; 
unsigned int acc_counter = 0 ;

long shift_reg = 0;

void ADC_setup(){
  ADCSRA =  bit (ADEN);                      
  ADCSRA |= bit (ADPS0) |  bit (ADPS1) | bit (ADPS2);  // Prescaler of 128
  #ifdef INT_REF
  ADMUX  =  bit (REFS0) | bit (REFS1);    
  #else
  ADMUX  =  bit (REFS0) ;   
  #endif
}

void ADC_start_conversion(int adc_pin){
  ADMUX &= ~(0x07) ; //clearing enabled channels
  ADMUX  |= (adc_pin & 0x07) ;    
  bitSet (ADCSRA, ADSC) ;
}

int ADC_read_conversion(){
 while(bit_is_set(ADCSRA, ADSC));
 return ADC ;
}
//End of ADC management functions

#define START_SYMBOL 0x02
#define STOP_SYMBOL 0x01
#define START_STOP_MASK  ((STOP_SYMBOL << 20) | (START_SYMBOL << 18) | STOP_SYMBOL) //STOP/START/16bits/STOP
#define SYNC_SYMBOL_MANCHESTER  (0x6665) /* Sync symbol, encoded as a 16-bit Manchester value to help the decoding */
inline int is_a_word(long  * manchester_word, int time_from_last_sync, unsigned int * detected_word){
        if(time_from_last_sync >= 20  || frame_state == IDLE){ // we received enough bits to test the sync      
            if(((*manchester_word) & START_STOP_MASK) == (START_STOP_MASK)){ // testing first position 
                  (*detected_word) = ((*manchester_word) >> 2) & 0xFFFF;
                  if(frame_state == IDLE){
                     if((*detected_word) == SYNC_SYMBOL_MANCHESTER) return 2 ;
                  }
                  return 1 ;
                  // byte with correct framing
            }else if(frame_state != IDLE && time_from_last_sync == 20){
               (*detected_word)= ((*manchester_word) >> 2) & 0xFFFF;
               return 1 ;
            }
          }
          return 0 ;
}

inline int insert_edge( long  * manchester_word, char edge, int edge_period, int * time_from_last_sync, unsigned int * detected_word){
   int new_word = 0 ;
   int is_a_word_value = 0 ;
   int sync_word_detect = 0 ;
   if( ((*manchester_word) & 0x01) != edge ){ //mak sure we don't have same edge ...
             if(edge_period > (SAMPLE_PER_SYMBOL+1)){
                unsigned char last_bit = (*manchester_word) & 0x01 ;
                (*manchester_word) = ((*manchester_word) << 1) | last_bit ; // signal was steady for longer than a single symbol, 
                (*time_from_last_sync) += 1 ;
                is_a_word_value = is_a_word(manchester_word, (*time_from_last_sync), detected_word);
                if(is_a_word_value > 0){ //found start stop framing
                   new_word = 1 ;
                  (*time_from_last_sync) =  0 ;
                  if(is_a_word_value > 1) sync_word_detect = 1 ; //we detected framing and sync word in manchester format
                }
             }
             //storing edge value in word
             if(edge < 0){
              (*manchester_word) = ( (*manchester_word) << 1) | 0x00 ; // signal goes down
             }else{
              (*manchester_word) = ( (*manchester_word) << 1) | 0x01 ; // signal goes up
             }
             (*time_from_last_sync) += 1 ;
             is_a_word_value = is_a_word(manchester_word, (*time_from_last_sync), detected_word);
             if(sync_word_detect == 0 && is_a_word_value > 0){ //if sync word was detected at previous position, don't take word detection into account
               new_word = 1 ;
               (*time_from_last_sync) =  0 ;
             }
          }else{
            new_word = -1 ;
          }
          return new_word ;
}


#define EDGE_THRESHOLD 4 /* Defines the voltage difference between two samples to detect a rising/falling edge. Can be increased depensing on the environment */
int oldValue = 0 ;
int steady_count = 0 ;
int dist_last_sync = 0 ;
unsigned int detected_word = 0;
int new_word = 0;
char old_edge_val = 0 ;
void sample_signal_edge(){
  char edge_val ;
 
  int sensorValue  = ADC_read_conversion(); 
  ADC_start_conversion(SENSOR_PIN); 
  #ifndef DEBUG
  #ifdef DEBUG_ANALOG
  Serial.println(sensorValue, DEC);
  #endif
  #endif
  if((sensorValue - oldValue) > EDGE_THRESHOLD) edge_val = 1 ;
  else if((oldValue - sensorValue) > EDGE_THRESHOLD) edge_val = -1;
  else edge_val = 0 ;
  oldValue = sensorValue ;
  if(edge_val == 0 || edge_val == old_edge_val || (edge_val != old_edge_val && steady_count < 2)){
    if( steady_count < (4 * SAMPLE_PER_SYMBOL)){
      steady_count ++ ;
    }
  }else{  
          new_word = insert_edge(&shift_reg, edge_val, steady_count, &(dist_last_sync), &detected_word); 
          if(dist_last_sync > (8*SAMPLE_PER_SYMBOL)){ 
            dist_last_sync = 32 ;
          }
          //if(new_word >= 0){
            steady_count = 0 ;
          //}
        }
        old_edge_val = edge_val ;
}

int add_byte_to_frame(char * frame_buffer, int * frame_index, int * frame_size, enum receiver_state * frame_state ,unsigned char data){
  if(data == SYNC_SYMBOL/* && (*frame_index) < 0*/){
    (*frame_index) = 0 ;
    (*frame_size) = 0 ;
    (*frame_state) = SYNC ;
    //Serial.println("SYNC");
    return 0 ;
  }
  if((*frame_state) != IDLE){ // we are synced
  frame_buffer[*frame_index] = data ;
  (*frame_index) ++ ;
    if(data == STX){
      //Serial.println("START");
      (*frame_state) = START ;
       return 0 ;
    }else if(data == ETX){
      //Serial.println("END");
      (*frame_size) = (*frame_index) ;
      (*frame_index) = -1 ;
      (*frame_state) = IDLE ;
      //Serial.println("END");
       return 1 ;
    }else if((*frame_index) >= 38){ 
      (*frame_index) = -1 ;
      (*frame_size) = -1 ;
      (*frame_state) = IDLE ;
      return -1 ;
    }else{
      (*frame_state) = DATA ;
    }
    return 0 ;
  }
  return -1 ;
}

TMRpcm tmrpcm;

void setup() {
  int i; 
  Serial.begin(115200);
  Serial.println("Start of receiver program");
  ADC_setup();
  ADC_start_conversion(SENSOR_PIN);
  Timer1.initialize(SYMBOL_PERIOD/SAMPLE_PER_SYMBOL); 
  Timer1.attachInterrupt(sample_signal_edge);

  tmrpcm.speakerPin=9;
if(!SD.begin(SD_ChipSelectPin))
{
  Serial.println("SD fail");
  return;
}
tmrpcm.setVolume(6);
tmrpcm.play("es.wav");

}

void loop() {
  int i; 
  unsigned char received_data;
  char received_data_print ;
  int nb_shift ;
  int byte_added = 0 ;
  if(new_word == 1){
    received_data = 0 ;
    for(i = 0 ; i < 16 ; i = i + 2){ //decoding Manchester
             received_data = received_data << 1 ;
             if(((detected_word >> i) & 0x03) == 0x01){
                 received_data |= 0x01 ;
             }else{
                 received_data &= ~0x01 ;
             }
    }
    received_data = received_data & 0xFF ;
    #ifdef DEBUG
      Serial.print(received_data & 0xFF, HEX);
      Serial.print(", ");
      Serial.println((char) received_data);
      tmrpcm.setVolume(7);
      tmrpcm.play("es.wav");
      
    #endif
    new_word = 0 ;
    if((byte_added = add_byte_to_frame(frame_buffer, &frame_index, &frame_size, &frame_state,received_data)) > 0){
      frame_buffer[frame_size-1] = '\0';
      Serial.println(&(frame_buffer[1]));
    }
  }
}

I got these error messages :
Archiving built core (caching) in: C:\Users\MUHINW~1\AppData\Local\Temp\arduino_cache_791812\core\core_arduino_avr_uno_0c812875ac70eb4a9b385d8fb077f54c.a
libraries\TMRpcm-master\TMRpcm.cpp.o (symbol from plugin): In function `sFile':

(.text+0x0): multiple definition of `__vector_13'

libraries\TimerOne-master\TimerOne.cpp.o (symbol from plugin):(.text+0x0): first defined here

collect2.exe: error: ld returned 1 exit status

exit status 1
Error compiling for board Arduino/Genuino Uno.

receiver_types.h (135 Bytes)

The TMRpcm library and the TimerOne library both use the interrupts of Timer1 - you cannot use both at the same time.

The Atmega328p (used in uno/nano/pro mini) has three timers (each of which does 2 PWM channels) - timer0 is an 8-bit timer used for millis() and as such libraries don't typically use it (messing with timer0 breaks millis() and delay() ). Timer2 is an 8-bit timer with a few weird features, and timer1 is the nice one - 16-bit (nominally configured for 8 so it's analogWrite() works the same), with input capture.

Some other boards have more 16-bit timers (though the library would need to be modified to use them instead) - for example, the Mega uses the 2560, which I think has 3, and third party '1284p-based boards have more than one 16-bit timer too (and the attiny841's timer2 is another 16-bit timer). Note that this is just AVRs - while other architectures often have really spiffy timers, if the library wasn't written for those, it's non-trivial to port them to the timers on a different architecture - the AVR timers are identical across the product line (only difference is how many of which kind of timer the chip has, for the most part - though a few parts have a "weird" timer), and are IMO very easy to write code to interact with.