We investigate the dynamic behaviour of resonant tunneling diode-photodetectors (RTD-PDs) in which the excitability can be activated by either electrical noise or optical signals. In both cases, we find the characteristics of the stochastic spiking behavior are not only dependent on the biasing positions but also controlled by the intensity of the input perturbations. Additionally, we explore the ability of RTD-PDs to perform optical signal transmission and neuromorphic spike generation simultaneously. These versatile functions indicate the possibility of making use of RTD-PDs for innovative applications, such as optoelectronic neuromorphic circuits for spike-encoded signaling and data processing.