Answer the question
In order to leave comments, you need to log in
How to convert a set of words or sounds to dial-ip (PPP) sound?
Greetings.
Tell me, experts, how can I convert text or speech into the sound emitted by the diul-up modem?
Answer the question
In order to leave comments, you need to log in
I won’t tell you how to do it “in an industrial way”, but here’s a “knee-knee” thing, just to listen to the approximate sound of the modem, you can rivet it in 5 minutes (it will squeak with a speaker):
#include <iostream>
#include <string.h>
#include <windows.h>
using namespace std;
const float delay = 1000.0 / 300.0; //300 бод/сек, V.21
const char * text = "Приветствую. Вот скажите мне знатоки, как можно конвертировать текст или речь в звук, издаваемый модемом dial-up?";
int main() {
for (int i = 0; i < strlen(text); i++) {
char x = text[i];
int mask = 1 << 7; //0b1000000
for (int j = 0; j < 8; j++, mask >>= 1) {
int freq = ((x & mask) != 0) ? 980 : 1180; //980Гц для "1", 1180Гц для "0"
Beep(freq, (int)delay); //так не совсем правильно (задержки не те), но "послушать" пойдет
}
}
return 0;
}
Didn't find what you were looking for?
Ask your questionAsk a Question
731 491 924 answers to any question