Skip to content
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

feat: add capture.py - also fixes audio recording #362

Merged
merged 71 commits into from
Aug 29, 2023

Conversation

0dm
Copy link
Collaborator

@0dm 0dm commented Jul 7, 2023

What kind of change does this PR introduce?
Adds a new module - capture for macOS. This allows for easy screen + audio recording.

    capture = OpenAdaptCapture()
    capture.start(audio=True)
    input("Press enter to stop")
    capture.stop()

bugfix: we can now record audio while also recording window states.

Summary

motivation: i dug through apple's api for what felt like ages
creating this allowed me to easily debug and find the cause of the error getting focused window bug - closes #183
this is also useful if we ever need a recording.

Checklist

  • My code follows the style guidelines of OpenAdapt
  • I have performed a self-review of my code
  • If applicable, I have added tests to prove my fix is functional/effective
  • I have linted my code locally prior to submission
  • I have commented my code, particularly in hard-to-understand areas
  • I have made corresponding changes to the documentation (e.g. README.md, requirements.txt)
  • New and existing unit tests pass locally with my changes

How can your code be run and tested?

demo: https://streamable.com/5a09ym
captured via capture.py
you can clearly hear the audio!

Other information

@0dm 0dm requested a review from abrichr July 7, 2023 18:23
@OpenAdaptAI OpenAdaptAI deleted a comment from cr-gpt bot Jul 11, 2023
@abrichr
Copy link
Member

abrichr commented Jul 26, 2023

Than you @0dm! Any thoughts on how to implement this on Windows? Do you have a Windows machine you can use?

@0dm
Copy link
Collaborator Author

0dm commented Jul 27, 2023

@abrichr I can try working on a Windows version (win32) using Parallels.

@0dm 0dm mentioned this pull request Aug 24, 2023
7 tasks
openadapt/replay.py Outdated Show resolved Hide resolved
openadapt/replay.py Outdated Show resolved Hide resolved
Copy link
Member

@abrichr abrichr left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

LGTM! 🚀

@abrichr abrichr merged commit 581b9b8 into OpenAdaptAI:main Aug 29, 2023
R-ohit-B-isht pushed a commit to R-ohit-B-isht/OpenAdapt that referenced this pull request Jun 21, 2024
* merge

* Create capture.py

* Update capture.py

* Update capture.py

* it's finally fixed

* add dependencies

* comment

* move code + use config.CAPTURE_DIR_PATH

* remove debug lines

* Update capture.py

* OpenAdaptCapture -> Capture

* add camera

* Let's have this off by default.

* hotfix

* fix

* linting

* Create capture.py

* windows

* cleanup + lint

* Update _windows.py

* add audio + new windows recording

* screen_recorder.free_resources()

* Update _windows.py

* isort

* add playback recording

* Update replay.py

* Update replay.py

* Update README.md

* Revert "Update README.md"

This reverts commit 7064103.

* Update README.md

* Revert "Revert "Update README.md""

This reverts commit 0fe8156.

* Update README.md

* run pre-commit

* Update pyproject.toml

* Update openadapt/replay.py

* Update openadapt/replay.py

* Update openadapt/replay.py

* Update replay.py

* update poetry.lock

---------

Co-authored-by: Richard Abrich <[email protected]>
Co-authored-by: Richard Abrich <[email protected]>
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

Error getting focused window (macOS)
2 participants