Skip to content

Commit

Permalink
Merge branch 'main' into update-formula-aarch64-apple-darwin-aebb9adb…
Browse files Browse the repository at this point in the history
…d09d50e29f009a6b56f7e45011e3d0c9
  • Loading branch information
louis030195 authored Sep 3, 2024
2 parents ab7248f + cba68cf commit 0ae2f24
Show file tree
Hide file tree
Showing 9 changed files with 29 additions and 16 deletions.
4 changes: 2 additions & 2 deletions .github/workflows/release-app.yml
Original file line number Diff line number Diff line change
Expand Up @@ -20,7 +20,7 @@ jobs:
- uses: actions/checkout@v4

- name: create draft release
uses: crabnebula-dev/cloud-release@v0.2.0
uses: crabnebula-dev/cloud-release@v0
with:
command: release draft ${{ secrets.CN_APP_SLUG }} --framework tauri
api-key: ${{ secrets.CN_API_KEY }}
Expand Down Expand Up @@ -180,7 +180,7 @@ jobs:
tauriScript: bunx tauri -v

- name: Upload Assets to CrabNebula Cloud
uses: crabnebula-dev/cloud-release@v0.2.2
uses: crabnebula-dev/cloud-release@v0
with:
command: release upload ${{ secrets.CN_APP_SLUG }} --framework tauri
api-key: ${{ secrets.CN_API_KEY }}
Expand Down
2 changes: 1 addition & 1 deletion Cargo.toml
Original file line number Diff line number Diff line change
Expand Up @@ -15,7 +15,7 @@ resolver = "2"


[workspace.package]
version = "0.1.73"
version = "0.1.74"
authors = ["louis030195 <[email protected]>"]
description = ""
repository = "https://github.com/mediar-ai/screenpipe"
Expand Down
3 changes: 1 addition & 2 deletions Formula/screenpipe.rb
Original file line number Diff line number Diff line change
Expand Up @@ -10,12 +10,11 @@ class Screenpipe < Formula
sha256 "6b6b540d9565a13bbf52f8c14224dc7876f40861044313aa8c992b866e015973" # arm64
else
url "https://github.com/mediar-ai/screenpipe/releases/download/v#{version}/screenpipe-#{version}-x86_64-apple-darwin.tar.gz"
sha256 "538fdeb9024a041d29b6647a47381ef701c0fe46841b5bced98038fffa816fd4" # x86_64
sha256 "8acabe46b935ac8ed6607a43a5d47e81b5647ee2c52193bcb3b646628a4ced9b" # x86_64
end
end

depends_on "ffmpeg"
depends_on "tesseract"

def install
bin.install Dir["bin/*"]
Expand Down
2 changes: 1 addition & 1 deletion examples/apps/screenpipe-app-tauri/src-tauri/Cargo.toml
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
[package]
name = "screenpipe-app"
version = "0.1.81"
version = "0.1.82"
description = ""
authors = ["you"]
license = ""
Expand Down
18 changes: 12 additions & 6 deletions screenpipe-audio/src/core.rs
Original file line number Diff line number Diff line change
Expand Up @@ -187,6 +187,7 @@ async fn run_ffmpeg(
duration: Duration,
) -> Result<()> {
debug!("Starting FFmpeg process");

let mut command = Command::new(find_ffmpeg_path().unwrap());
command
.args(&[
Expand All @@ -195,13 +196,17 @@ async fn run_ffmpeg(
"-ar",
&sample_rate.to_string(),
"-ac",
&channels.to_string(),
&if channels > 2 { 2 } else { channels }.to_string(),
"-i",
"pipe:0",
"-c:a",
"aac",
"-b:a",
"128k",
"64k", // Reduced bitrate for higher compression
"-profile:a",
"aac_low", // Use AAC-LC profile for better compatibility
"-movflags",
"+faststart", // Optimize for web streaming
"-f",
"mp4",
output_path.to_str().unwrap(),
Expand Down Expand Up @@ -412,10 +417,11 @@ pub async fn record_and_transcribe(
error!("Error joining audio thread: {:?}", e);
}

tokio::fs::File::open(&output_path_clone_2.to_path_buf())
.await?
.sync_all()
.await?;
// Commented to chekc if its the "Access is denied on windows" error
// tokio::fs::File::open(&output_path_clone_2.to_path_buf())
// .await?
// .sync_all()
// .await?;

debug!("Sending audio to audio model");
if let Err(e) = whisper_sender.send(AudioInput {
Expand Down
7 changes: 7 additions & 0 deletions screenpipe-audio/src/pcm_decode.rs
Original file line number Diff line number Diff line change
Expand Up @@ -21,6 +21,7 @@ pub fn pcm_decode<P: AsRef<std::path::Path>>(path: P) -> anyhow::Result<(Vec<f32

// Create a probe hint using the file's extension. [Optional]
let hint = symphonia::core::probe::Hint::new();
// hint.with_extension("mp4");

// Use the default options for metadata and format readers.
let meta_opts: symphonia::core::meta::MetadataOptions = Default::default();
Expand All @@ -31,6 +32,12 @@ pub fn pcm_decode<P: AsRef<std::path::Path>>(path: P) -> anyhow::Result<(Vec<f32
// Get the instantiated format reader.
let mut format = probed.format;

// Debug log the format information
debug!(
"Detected format: {:?}",
format.metadata().current().unwrap()
);

// Find the first audio track with a known (decodeable) codec.
let track = format
.tracks()
Expand Down
4 changes: 2 additions & 2 deletions screenpipe-server/src/cli.rs
Original file line number Diff line number Diff line change
Expand Up @@ -69,7 +69,7 @@ pub struct Cli {
pub fps: f64, // ! not crazy about this (unconsistent behaviour across platforms) see https://github.com/mediar-ai/screenpipe/issues/173

/// Audio chunk duration in seconds
#[arg(short = 'd', long, default_value_t = 30)]
#[arg(short = 'd', long, default_value_t = 120)]
pub audio_chunk_duration: u64,

/// Port to run the server on
Expand Down Expand Up @@ -148,7 +148,7 @@ pub struct Cli {
#[arg(long, default_value_t = false)]
pub use_pii_removal: bool,

/// Restart recording process every X minutes (0 means no periodic restart)
/// Restart recording process every X minutes (0 means no periodic restart) - NOT RECOMMENDED
#[arg(long, default_value_t = 0)]
pub restart_interval: u64,
}
3 changes: 2 additions & 1 deletion screenpipe-server/src/core.rs
Original file line number Diff line number Diff line change
Expand Up @@ -255,8 +255,9 @@ async fn record_audio(
let device_control_clone = device_control_clone.clone();

let new_file_name = Utc::now().format("%Y-%m-%d_%H-%M-%S").to_string();
let sanitized_device_name = audio_device_clone.to_string().replace(['/', '\\'], "_");
let file_path = PathBuf::from(&*output_path_clone)
.join(format!("{}_{}.mp4", audio_device_clone, new_file_name))
.join(format!("{}_{}.mp4", sanitized_device_name, new_file_name))
.to_str()
.expect("Failed to create valid path")
.to_string();
Expand Down
2 changes: 1 addition & 1 deletion screenpipe-vision/src/microsoft.rs
Original file line number Diff line number Diff line change
Expand Up @@ -39,4 +39,4 @@ pub async fn perform_ocr_windows(image: &DynamicImage) -> (String, String, Optio
.to_string();

(text, json_output, Some(1.0))
}
}

0 comments on commit 0ae2f24

Please sign in to comment.