I want to ignore the special characters that the user inputs in a string, while
ID: 3587851 • Letter: I
Question
I want to ignore the special characters that the user inputs in a string, while outputting the DTMF signal sound.
Basically, I am building a DTMF encoder, which for each keypress of a telephone keypad, the system combines a row tone and a column tone and sends both.
For example: "12 34aB-cd$%^&76" should output the tones for "1234abcd76" ignoring spaces and all other characters not found on phone keypad. Is there any quicker and/or easier way to do this?
CODE:
sound_out = np.concatenate(sound)
print(sound_out)
Audio(sound_out,rate = Fs)
Explanation / Answer
You can use a dictionary
Related Questions
Hire Me For All Your Tutoring Needs
Integrity-first tutoring: clear explanations, guidance, and feedback.
Drop an Email at
drjack9650@gmail.com
drjack9650@gmail.com
Navigate
Integrity-first tutoring: explanations and feedback only — we do not complete graded work. Learn more.