Hi,
This request is quite broad for a single Q&A, since it involves both designing the app (key handling, audio playback, state management) and writing all the implementation code. A few pointers to help you get started:
- For a web-based version (HTML/JavaScript):
- See MDN Web Docs: Using the Web Audio API – it explains how to load and play audio files in response to user actions.
- For capturing keystrokes, refer to MDN: Document: keydown event.
- For a desktop app (e.g., Python, C#, Java):
- Each language has libraries to capture key events and play audio (e.g.,
pygamein Python,System.Media.SoundPlayerin C#).
- Each language has libraries to capture key events and play audio (e.g.,
Since you’re just starting out, a practical first step would be to choose one platform (web or desktop) and try a very small example:
- Play one audio file on a single key press.
- Extend to multiple keys and multiple sounds.
- Add the “toggle” logic for dial tone and hang-up.
If you’d like to stick with the web and HTML/JS, I’d recommend starting with the Web Audio API tutorial.
Hope this helps.