Skip to content

Instantly share code, notes, and snippets.

View a-sajjad72's full-sized avatar

Sajjad Ali a-sajjad72

View GitHub Profile
from pydub import AudioSegment
from pydub.silence import split_on_silence
import time
def remove_silence_add_delay(input_path, output_path, silence_thresh=-40, min_silence_len=2000, delay=200):
# Load the separated vocal track
vocal_track = AudioSegment.from_file(input_path)
# Split the vocal track on silence with the specified threshold
non_silent_vocals = split_on_silence(vocal_track, silence_thresh=silence_thresh, min_silence_len=min_silence_len)
openapi: 3.0.0
info:
title: Audiobook Recommendation API
version: 1.0.0
description: An API of content-based recommendations for Audiobooks.
servers:
- url: http://localhost:3000
paths:
/api/books:
get:
@a-sajjad72
a-sajjad72 / build dlib.md
Last active June 6, 2023 18:37
here are the commands that you can use to build the dlib library for iOS
https://medium.com/@prabhu_irl/getting-started-with-dlib-on-ios-5e66d77380d
brew install --cask xquartz
brew install cmake
@a-sajjad72
a-sajjad72 / fileSharing.py
Last active June 27, 2023 06:20
a simple framework based on client-server model to send/receive file/messages
import socket
from _thread import *
import threading
import os, zipfile
from pip._vendor.rich.console import Console
from pip._vendor.rich.progress import (
Progress,
TextColumn,
BarColumn,
TransferSpeedColumn,
@a-sajjad72
a-sajjad72 / compress.py
Last active April 5, 2023 10:30
As lz4 provides you the fastest (de)compression speed. Here is python script to create an archive and extract the archive using lz4 algorithm.
import os
import lz4.frame
def compression(files):
with open('archive.lz4', 'wb') as archive:
for file_name in files:
# Write file metadata as length-prefixed string to the archive
archive.write(len(file_name).to_bytes(2, byteorder='big'))
archive.write(file_name.encode("utf-8"))