Academic Integrity: tutoring, explanations, and feedback — we don’t complete graded work or submit on a student’s behalf.

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

Hire Me For All Your Tutoring Needs
Integrity-first tutoring: clear explanations, guidance, and feedback.
Drop an Email at
drjack9650@gmail.com
Chat Now And Get Quote