Add the reviewer_will_replay_recording hook (#1877)

This commit is contained in:
Abdo 2022-05-18 06:44:56 +03:00 committed by GitHub
parent a5ad95ca41
commit 638286a3fc
No known key found for this signature in database
GPG key ID: 4AEE18F83AFDEB23
2 changed files with 9 additions and 0 deletions

View file

@ -1095,6 +1095,9 @@ time = %(time)d;
record_audio(self.mw, self.mw, False, after_record)
def onReplayRecorded(self) -> None:
self._recordedAudio = gui_hooks.reviewer_will_replay_recording(
self._recordedAudio
)
if not self._recordedAudio:
tooltip(tr.studying_you_havent_recorded_your_voice_yet())
return

View file

@ -164,6 +164,12 @@ hooks = [
option is unchecked; This is so as to allow playing custom
sounds regardless of that option.""",
),
Hook(
name="reviewer_will_replay_recording",
args=["path: str"],
return_type="str",
doc="""Used to inspect and modify a recording recorded by "Record Own Voice" before replaying.""",
),
# Debug
###################
Hook(