Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

added more color codes #11

Closed
wants to merge 2 commits into from
Closed
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
7 changes: 7 additions & 0 deletions scripts/color
Original file line number Diff line number Diff line change
Expand Up @@ -9,6 +9,13 @@ color() {
declare -A color_mapping=(
# TODO: Add more color values
# Refer bash color codes
['black']=30
['red']=31
['green']=32
['yellow']=33
['blue']=34
['magenta']=35
['cyan']=36
['magenta']=35
)

Expand Down
17 changes: 17 additions & 0 deletions scripts/music-extract
Original file line number Diff line number Diff line change
Expand Up @@ -26,3 +26,20 @@
# └── Songs
# ├── Song1.mp3
# └── Song2.mp3

convert_video_to_audio() {
local file_path="$1"
local output_dir="Music/${file_path%/*}"
mkdir -p "$output_dir"
local output_path="Music/${file_path%.mp4}.mp3"
ffmpeg -i "$file_path" -vn -ar 44100 -ac 2 -b:a 192k "$output_path"
}

find_To_Convert_Files_From_Video_To_Audio() {
local dir="$1"
find "$dir" -type f -name '*.mp4' -print0 | while IFS= read -r -d '' file; do
convert_video_to_audio "$file"
done
}

find_To_Convert_Files_From_Video_To_Audio "videos"