Skip to content

Instantly share code, notes, and snippets.

View cjweaver's full-sized avatar

Chris Weaver cjweaver

View GitHub Profile
@cjweaver
cjweaver / concate_m4a_by_date_modified.py
Last active May 11, 2025 12:53
Concatenate m4a files using their 'Date Modified'
import os
from pydub import AudioSegment
def concatenate_m4a_by_date(directory, output_file="output.m4a"):
"""
Concatenates all .m4a files in a directory based on their "Date Modified" attribute.
Parameters:
- directory (str): Path to the folder containing .m4a files.
- output_file (str): Name of the output concatenated .m4a file (default: "output.m4a").
@cjweaver
cjweaver / restore_m4a_date_from_metadata.py
Created May 11, 2025 12:43
Restore Google Recorder dates
#!/usr/bin/env python3
"""
M4A Date Modifier - Sets the modification date of .m4a files based on embedded metadata.
This script updates the "Date Modified" attribute of all .m4a files in a specified directory
to match their embedded creation_time metadata tag. Useful for organizing audio recordings
chronologically in file managers and media applications.
Usage:
python modify_m4a_dates.py --directory PATH [--verbose] [--dry-run]