X-Git-Url: https://git.mxchange.org/?a=blobdiff_plain;f=src%2FSound%2Fmorse.hxx;h=1fcb482cdea30e092c5cb900d091818c8c46428b;hb=f0e6716953604730579a5e45f785fd063737dce4;hp=c17635ef91fc7f377717f75e79f783d36cfe4079;hpb=95e27e8cb96e80a3ba7582105646d914ccadb452;p=flightgear.git diff --git a/src/Sound/morse.hxx b/src/Sound/morse.hxx index c17635ef9..1fcb482cd 100644 --- a/src/Sound/morse.hxx +++ b/src/Sound/morse.hxx @@ -90,8 +90,8 @@ static const char DAH = '2'; static const char end = '0'; static const int BYTES_PER_SECOND = 8000; -static const int BEAT_LENGTH = 240; // milleseconds (5 wpm) -// static const int BEAT_LENGTH = 92; // milleseconds (13 wpm) +// static const int BEAT_LENGTH = 240; // milleseconds (5 wpm) +static const int BEAT_LENGTH = 92; // milleseconds (13 wpm) static const int TRANSITION_BYTES = (int)(0.005 * BYTES_PER_SECOND); static const int COUNT_SIZE = BYTES_PER_SECOND * BEAT_LENGTH / 1000; static const int DIT_SIZE = 2 * COUNT_SIZE; // 2 counts @@ -130,6 +130,21 @@ public: }; +/** + * \relates FGMorse + * Make a tone of specified freq and total_len with trans_len ramp in + * and out and only the first len bytes with sound, the rest with + * silence. + * @param buf unsigned char pointer to sound buffer + * @param freq desired frequency of tone + * @param len length of tone within sound + * @param total_len total length of sound (anything more than len is padded + * with silence. + * @param trans_len length of ramp up and ramp down to avoid audio "pop" + */ +void make_tone( unsigned char *buf, int freq, + int len, int total_len, int trans_len ); + #endif // _MORSE_HXX