Devices Module
Classes:
|
A reusable controller for camera-related functionality. |
A reusable controller for microphone-related functionality. |
|
|
A reusable controller for screen-related functionality. |
- class PyXA.Additions.Devices.XACamera[source]
Bases:
objectA reusable controller for camera-related functionality.
New in version 0.3.0.
Methods:
capture()record(file_path[, duration])Records a video for the specified duration, saving into the provided file path.
- record(file_path: str | XAPath, duration: float | None = 10) XAVideo[source]
Records a video for the specified duration, saving into the provided file path.
- Parameters:
file_path (Union[str, XAPath]) – The file path to save the video at.
duration (Union[float, None], optional) – The duration of the video, in seconds, or None to record continuously until the script is canceled, defaults to 10.
- Returns:
The resulting video as a PyXA object.
- Return type:
New in version 0.3.0.
- class PyXA.Additions.Devices.XAMicrophone[source]
Bases:
objectA reusable controller for microphone-related functionality.
New in version 0.3.0.
Methods:
record(file_path[, duration])Records audio for the specified duration, saving into the provided file path.
- record(file_path: str | XAPath, duration: float | None = 10) XASound[source]
Records audio for the specified duration, saving into the provided file path.
- Parameters:
file_path (Union[str, XAPath]) – The file path to save the audio at.
duration (Union[float, None], optional) – The duration of the audio, in seconds, or None to record continuously until the script is canceled, defaults to 10.
- Returns:
The resulting audio as a PyXA object.
- Return type:
New in version 0.3.0.
- class PyXA.Additions.Devices.XAScreen[source]
Bases:
objectA reusable controller for screen-related functionality.
New in version 0.3.0.
Methods:
capture()Captures the screen and returns it as a
PyXA.XABase.XAImageobject.capture_rect(x, y, width, height)Captures the screen within the specified rectangle and returns it as a
PyXA.XABase.XAImageobject.capture_window(app, window_index)Captures the specified window and returns it as a
PyXA.XABase.XAImageobject.record(file_path[, duration])- capture() XAImage[source]
Captures the screen and returns it as a
PyXA.XABase.XAImageobject.- Returns:
The resulting image.
- Return type:
New in version 0.3.0.
- capture_rect(x: int, y: int, width: int, height: int) XAImage[source]
Captures the screen within the specified rectangle and returns it as a
PyXA.XABase.XAImageobject.- Parameters:
rect (XARect) – The rectangle to capture.
- Returns:
The resulting image.
- Return type:
New in version 0.3.0.
- capture_window(app: XAApplication, window_index: int) XAImage[source]
Captures the specified window and returns it as a
PyXA.XABase.XAImageobject.- Parameters:
app (XAApplication) – The application to capture the window from.
window_index (int) – The index of the window to capture.
- Returns:
The resulting image.
- Return type:
New in version 0.3.0.