-
-
Notifications
You must be signed in to change notification settings - Fork 178
Audio narration #673
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Audio narration #673
Conversation
…vely convert reqd properties to str
e1fb56d
to
61d01c6
Compare
Thanks @KIRA009 ! I tried running a recording with this, but it seems to hang:
![]() Any suggestions? |
@abrichr It could possibly be because the first time the model is downloaded it takes some time, how long was it in this state? |
405ac48
to
4f99f00
Compare
~5min before I killed it. Upon trying again I am no longer experiencing this issue, and the recording completes, modulo this exception:
However, when running
(I have run |
@abrichr my fault. I manually added the |
@KIRA009 when pressing ctrl+c during recording I get this:
I believe we need to follow this pattern used elsewhere in record.py:
After adding this, I no longer get the error, but the process hangs:
![]() |
…er in audio recording process
f2f400e
to
4ef3ea5
Compare
@KIRA009 I'm unable to start the recording:
After manually deleting the lock file:
It looks like there are two issues:
|
After recreating the database, I no longer get the database error. However, I do still get the lock error, and have to manually delete it. Also, after stopping the cording with ctrl+c:
The terminal appears to hang after this line:
After a couple of minutes I press ctrl+c again and from the stack trace it appears to be hanging on |
I think we may need to run this on startup:
Not sure where to put this. |
openadapt/db/crud.py
Outdated
@@ -816,8 +817,14 @@ def acquire_db_lock(timeout: int = 60) -> bool: | |||
logger.error("Failed to acquire database lock.") | |||
return False | |||
if os.path.exists(DATA_DIR_PATH / "database.lock"): | |||
logger.info("Database is locked. Waiting...") | |||
time.sleep(1) | |||
with open(DATA_DIR_PATH / "database.lock", "r") as lock_file: |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
It appears that this path is re-used in several places. What do you think about defining it in config.py
?
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Added in 52516e2
@KIRA009 we could merge this as-is. However ideally we would integrate The reason is for the additional instrumentation (performance and logging). What do you think? |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Merging to fix the database lock issue ASAP. Thank you @KIRA009 ! 🙏
* feat: Add audio narration feature while recording * feat: Remove implicit scrubbing in display_event function and recursively convert reqd properties to str * feat: Add transcribed text to dashboard visualisation * feat: Use recording id as foreign key, and add interrupt signal handler in audio recording process * feat: Check if the lock is stale when acquiring locks * refactor: Convert database lock path to a constant in config file --------- Co-authored-by: Richard Abrich <[email protected]>
What kind of change does this PR introduce?
This PR adds the ability to record audio when recording actions.
Summary
This is a cleaned up and updated PR, taken from #346 . This adds a new process which records the audio narrated by the user while recording, then transcribes it using openai's whisper model, and saves relevant information to the database. A follow up PR would display the transcribed text along with the actions during which they were narrated.
Checklist
How can your code be run and tested?
Other information