This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
import numpy as np | |
from pydub import AudioSegment | |
# ffmpeg -fflags +genpts -i 008.wma -sample_fmt s16p -b:a 320k 008.mp3 | |
def load_audio(file_path): | |
""" | |
Load an audio file and convert it to a NumPy array. | |
""" | |
audio = AudioSegment.from_file(file_path) |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
#!/usr/bin/env python3 | |
# -*- coding: utf-8 -*- | |
import argparse | |
import datetime | |
import os | |
import shutil | |
import time | |
import zipfile |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
#!/bin/bash | |
LC_ALL=C find . -name '?*.*' -type f -printf '%b.%f\0' | LC_ALL=C gawk -F . -v RS='\0' ' | |
{s[$NF] += $1; n[$NF]++} | |
END { | |
PROCINFO["sorted_in"] = "@val_num_asc" | |
for (e in s) printf "%15d %4d %s\n", s[e]*512, n[e], e | |
}' |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
#!/usr/bin/env python3 | |
import argparse | |
import os | |
import sys | |
from ctypes import * | |
FALLOC_FL_KEEP_SIZE = 0x01 | |
FALLOC_FL_PUNCH_HOLE = 0x02 |