Skip to content

Commit

Permalink
Add audio to encoder 🔥
Browse files Browse the repository at this point in the history
  • Loading branch information
NiiightmareXD committed Aug 8, 2024
1 parent 65e7317 commit cc49892
Show file tree
Hide file tree
Showing 8 changed files with 743 additions and 188 deletions.
4 changes: 2 additions & 2 deletions Cargo.lock

Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.

2 changes: 1 addition & 1 deletion Cargo.toml
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
[package]
name = "windows-capture"
version = "1.2.2"
version = "1.3.2"
authors = ["NiiightmareXD"]
edition = "2021"
description = "Fastest Windows Screen Capture Library For Rust 🔥"
Expand Down
12 changes: 5 additions & 7 deletions README.md
Original file line number Diff line number Diff line change
Expand Up @@ -26,7 +26,7 @@ Add this library to your `Cargo.toml`:

```toml
[dependencies]
windows-capture = "1.2.2"
windows-capture = "1.3.2"
```
or run this command

Expand All @@ -44,7 +44,7 @@ use std::{

use windows_capture::{
capture::GraphicsCaptureApiHandler,
encoder::{VideoEncoder, VideoEncoderQuality, VideoEncoderType},
encoder::{AudioSettingBuilder, ContainerSettingsBuilder, VideoEncoder, VideoSettingsBuilder},
frame::Frame,
graphics_capture_api::InternalCaptureControl,
monitor::Monitor,
Expand All @@ -71,12 +71,10 @@ impl GraphicsCaptureApiHandler for Capture {
println!("Got The Flag: {message}");

let encoder = VideoEncoder::new(
VideoEncoderType::Hevc,
VideoEncoderQuality::HD1080p,
1920,
1080,
VideoSettingsBuilder::new(1920, 1080),
AudioSettingBuilder::default().disabled(true),
ContainerSettingsBuilder::default(),
"video.mp4",
Some(30),
)?;

Ok(Self {
Expand Down
10 changes: 4 additions & 6 deletions examples/basic.rs
Original file line number Diff line number Diff line change
Expand Up @@ -5,7 +5,7 @@ use std::{

use windows_capture::{
capture::GraphicsCaptureApiHandler,
encoder::{VideoEncoder, VideoEncoderQuality, VideoEncoderType},
encoder::{AudioSettingBuilder, ContainerSettingsBuilder, VideoEncoder, VideoSettingsBuilder},
frame::Frame,
graphics_capture_api::InternalCaptureControl,
monitor::Monitor,
Expand All @@ -32,12 +32,10 @@ impl GraphicsCaptureApiHandler for Capture {
println!("Got The Flag: {message}");

let encoder = VideoEncoder::new(
VideoEncoderType::Hevc,
VideoEncoderQuality::HD1080p,
1920,
1080,
VideoSettingsBuilder::new(1920, 1080),
AudioSettingBuilder::default().disabled(true),
ContainerSettingsBuilder::default(),
"video.mp4",
Some(30),
)?;

Ok(Self {
Expand Down
Loading

0 comments on commit cc49892

Please sign in to comment.