how to get the duration of a pressed key in MATLAB?
5 Ansichten (letzte 30 Tage)
Ältere Kommentare anzeigen
digital processing
am 4 Jan. 2017
Beantwortet: Walter Roberson
am 4 Jan. 2017
I want to press a key with a specific frequency to generate a sound, but I want the duration of the sound to depend on how long I press the key, could this be done in MATLAB?
0 Kommentare
Akzeptierte Antwort
Walter Roberson
am 4 Jan. 2017
Figures have WindowKeyPressFcn and WindowKeyReleaseFcn callbacks. You could start a timer on the key press and stop it on the key release. But be careful about this because you are permitted to press multiple keys so you have to track which key is pressed and released.
0 Kommentare
Weitere Antworten (0)
Siehe auch
Kategorien
Mehr zu Audio I/O and Waveform Generation finden Sie in Help Center und File Exchange
Community Treasure Hunt
Find the treasures in MATLAB Central and discover how the community can help you!
Start Hunting!