W
W
weranda2014-07-11 09:46:23
Computer networks
weranda, 2014-07-11 09:46:23

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

1 answer(s)
S
SilentFl, 2014-07-11
@SilentFl

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 question

Ask a Question

731 491 924 answers to any question