How to stop recording when a finger is released from a button
yoyo last edited by yoyo
My application for iOS has recording function. Based on sample code, I implemented a following code. As you understand, recorder.stop() is executed after alert dialog is closed. I want to change this specification from current one to new one which records a voice while a button on UI is kept touching, and when user releases a finger from a button, recorde.stop() is executed. How should I implement this? I don’t want to use an alert dialog.
recorder = sound.Recorder('speech.m4a') recorder.record() # Continue recording until the 'Finish' button is tapped: dialogs.alert('Recording...','','Finish',hide_cancel_button=True) recorder.stop()
JonB last edited by
you should use a custom ui.View, which lets you define
touch_endedwhich you can use to kick off actions when touch begins, and anther action when it ends.
yoyo last edited by
@JonB Thank you so much! I’m gonna try!