[Question] Is eDSP able to convert radio waves into audible sound?
lyndalopez544 opened this issue · comments
[Question] Is eDSP able to convert radio waves into audible sound?
Not sure what you mean. I guess you want to convert a raw signal into an audible format, lets say WAV. If, it's that the case, you can use the class edsp::io::encoder
.
First of all, you will need to get the raw data from you radio receptor. Normally, you should apply some pre-processing to clean the signal and normalize. Once you are done, you can export your raw data:
const auto sample_rate = 16000;
const auto channels = 1;
const auto data = get_ratio_data(sample_rate, channels); // Replace it with your own method
const auto filename = "example.wav";
edsp::io::encoder<float> encoder(sample_rate, channels);
if (!encoder.open(filename)) {
std::cerr << "Error while creating the audio file";
return;
}
encoder.write(std::cbegin(data), std::cend(data));
Make sure that your channels are interleaved.