Отсканируй на iPhone, чтобы установить
Equalizer will apply EQ presets to video and audio files. You can also apply optional filters to isolate speech or enhance stereo and more. The free a-Shell mini app is required.
Что нового
Версия 1.0
First release
Что делает
Действий: 161-
CommentEqualizer 2.2.0 This shortcut will apply EQ presets and various audio filters.
-
CommentThis shortcut requires a-Shell mini https://apps.apple.com/us/app/a-shell-mini/id1543537943
-
CommentBy u/veredictum
-
If
-
Set VariableInput
-
Dictionary
-
Set VariableConfig
-
If
-
Choose from MenuSource media?
-
Choose from MenuPhotos
-
Select Photos
-
Set VariableInput
-
Choose from MenuFiles
-
Select File
-
Set VariableInput
-
Choose from MenuInstall a-Shell mini
-
Open URLs
-
Stop This Shortcut
-
Replace Text
-
Set VariableInputName
-
Set Name
-
Set VariableInput
-
Set VariableExtension
-
Dictionary
-
Save File
-
Get File
-
If
-
Set VariableInputName
-
Set VariableExtension
-
Put FileAsheKube.app.a-Shell-mini
-
If
-
CommentEQ presets inspired by https://descriptive.audio/best-equalizer-settings/
-
Text
-
Get Dictionary from Input
-
Set VariablePresets
-
Get Dictionary Value
-
Filter Files
-
Choose from List
-
Set VariablePreset
-
CommentBuild filter for EQ preset
-
Get Dictionary Value
-
Get Dictionary Value
-
Filter Files
-
Repeat with Each
-
Get Dictionary Value
-
Text
-
Combine Text
-
Text
-
Set VariableEqualizer
-
CommentAdd optional filters
-
Text
-
Split Text
-
Choose from List
-
If
-
Text
-
Split Text
-
Choose from List
-
CommentGet audio sample rate needed for changing pitch and loudness norms.
-
Execute CommandAsheKube.app.a-Shell-mini
-
Repeat with Each
-
Get Dictionary Value
-
If
-
Get Dictionary Value
-
Set VariableSample Rate
-
CommentBuild optional fiters
-
Dictionary
-
Repeat with Each
-
Get Dictionary Value
-
Add to Variable
-
CommentStandard normalization if needed
-
If
-
Text
-
Execute CommandAsheKube.app.a-Shell-mini
-
Wait
-
Text
-
Execute CommandAsheKube.app.a-Shell-mini
-
Set Variableloop
-
Repeat
-
If
-
If
-
Repeat
-
If
-
If
-
Wait
-
Execute CommandAsheKube.app.a-Shell-mini
-
Set Variableloop
-
Match Text
-
If
-
If
-
Get FileAsheKube.app.a-Shell-mini
-
Match Text
-
If
-
If
-
Set VariableMax Volume
-
If
-
Text
-
If
-
Text
-
List
-
Set VariableFilters
-
If
-
If
-
Add to Variable
-
Combine Text
-
Count
-
If
-
If
-
Show Alert
-
Stop This Shortcut
-
If
-
Text
-
If
-
Text
-
Text
-
Execute CommandAsheKube.app.a-Shell-mini
-
Set Variableloop
-
Repeat
-
If
-
If
-
Repeat
-
If
-
If
-
Wait
-
Execute CommandAsheKube.app.a-Shell-mini
-
Set Variableloop
-
Execute CommandAsheKube.app.a-Shell-mini
-
Match Text
-
If
-
Show Alert
-
Run Shortcut
-
Stop This Shortcut
-
If
-
Get FileAsheKube.app.a-Shell-mini
-
Set Name
-
Match Text
-
If
-
Text
-
If
-
Text
-
Split Text
-
Choose from List
-
If
-
Save to Photo Album
-
Open App
-
If
-
Folder
-
If
-
Folder
-
Save File
-
Open File
-
If
-
Set Name
-
Set Name
-
List
-
Quick Look
-
Share
-
Choose from Menu
-
Choose from MenuAdjust EQ settings
-
Run Shortcut
-
Choose from MenuQuit
-
Execute CommandAsheKube.app.a-Shell-mini
Посмотреть как код
Все действия этой команды, записанные на Cherri — языке программирования для приложения «Быстрые команды». Отлично подходит, чтобы разобраться, как она работает.
#include 'actions/web'
#include 'actions/photos'
#define color red
#define glyph sliders
/*
Equalizer 2.2.0
This shortcut will apply EQ presets and various audio filters.
*/
/*
This shortcut requires a-Shell mini
https://apps.apple.com/us/app/a-shell-mini/id1543537943
*/
// By u/veredictum
if ShortcutInput {
@Input = ShortcutInput
}
@Config = {
"Name": "Equalizer",
"RoutineHub ID": "",
"Version": "2.2.0"
}
if !@Input {
menu "Source media?" {
item "Photos":
selectPhotos()
@Input
item "Files":
selectFile()
@Input
item "Install a-Shell mini":
openURL("https://apps.apple.com/us/app/a-shell-mini/id1543537943")
stop()
}
}
replaceText("\'|\/|\\|\:", "_", @Input, false, true)
@InputName
setName(@Input)
@Input
@Extension = @Input
const Dictionary = {
"Extension": "{@Input['File Extension']}",
"Name": "{@InputName}"
}
saveFile("Shortcuts/temp/InputName.json", Dictionary, true)
const File = getFile("Shortcuts/temp/InputName.json", true)
if File {
@InputName = File['Name']
@Extension = File['Extension']
}
rawAction("AsheKube.app.a-Shell-mini.PutFileIntent", {
"ShowWhenRun": false,
"file": "@Input"
})
if @Input {
/*
EQ presets inspired by
https://descriptive.audio/best-equalizer-settings/
*/
const Text = "\n{\n \\"Treble Booster\\": {\n \\"0\\": -4,\n \\"250\\": -2,\n \\"1000\\": 0,\n \\"4000\\": 3,\n \\"16000\\": 6\n },\n \\"Bass Booster\\": {\n \\"0\\": 6,\n \\"250\\": 3,\n \\"1000\\": 0,\n \\"4000\\": -2,\n \\"16000\\": -4\n },\n \\"Mid Booster\\": {\n \\"0\\": -2,\n \\"250\\": 2,\n \\"1000\\": 6,\n \\"4000\\": 2,\n \\"16000\\": -2\n },\n \\"Deep\\": {\n \\"0\\": 4,\n \\"250\\": 8,\n \\"1000\\": 4,\n \\"4000\\": 2,\n \\"16000\\": 1\n },\n \\"Acoustic\\": {\n \\"0\\": 5,\n \\"64\\": 5,\n \\"125\\": 4,\n \\"250\\": 1,\n \\"500\\": 2,\n \\"1000\\": 2,\n \\"2000\\": 3,\n \\"4000\\": 4,\n \\"8000\\": 2,\n \\"16000\\": 1\n },\n \\"Electronic\\": {\n \\"0\\": 5,\n \\"64\\": 5,\n \\"125\\": 1,\n \\"250\\": 0,\n \\"500\\": -1,\n \\"1000\\": 3,\n \\"2000\\": 1,\n \\"4000\\": 1,\n \\"8000\\": 3,\n \\"16000\\": 4\n },\n \\"Latin\\": {\n \\"0\\": 6,\n \\"64\\": 5,\n \\"125\\": 2,\n \\"250\\": 1,\n \\"500\\": 0,\n \\"1000\\": 3,\n \\"2000\\": 0,\n \\"4000\\": 1,\n \\"8000\\": 5,\n \\"16000\\": 6\n },\n \\"Classical\\": {\n \\"0\\": 3,\n \\"64\\": 2,\n \\"125\\": 1,\n \\"250\\": 3,\n \\"500\\": 4,\n \\"1000\\": 2,\n \\"2000\\": 4,\n \\"4000\\": 5,\n \\"8000\\": 4,\n \\"16000\\": 5\n },\n \\"Pop\\": {\n \\"0\\": -2,\n \\"64\\": -1,\n \\"125\\": 0,\n \\"250\\": 3,\n \\"500\\": 5,\n \\"1000\\": 5,\n \\"2000\\": 3,\n \\"4000\\": 0,\n \\"8000\\": -1,\n \\"16000\\": -2\n },\n \\"Rock\\": {\n \\"0\\": 5,\n \\"64\\": 4,\n \\"125\\": 3,\n \\"250\\": 2,\n \\"500\\": 0,\n \\"1000\\": 3,\n \\"2000\\": 1,\n \\"4000\\": 3,\n \\"8000\\": 4,\n \\"16000\\": 5\n },\n \\"Hip Hop\\": {\n \\"0\\": 0,\n \\"64\\": 4,\n \\"125\\": 6,\n \\"250\\": 2,\n \\"500\\": 3,\n \\"1000\\": 5,\n \\"2000\\": 7,\n \\"4000\\": 4,\n \\"8000\\": 2,\n \\"16000\\": 0\n },\n \\"Flat\\": {\n \\"0\\": 0,\n \\"64\\": 0,\n \\"125\\": 0,\n \\"250\\": 0,\n \\"500\\": 0,\n \\"1000\\": 0,\n \\"2000\\": 0,\n \\"4000\\": 0,\n \\"8000\\": 0,\n \\"16000\\": 0\n },\n \\"Vocals\\": {\n \\"0\\": -4,\n \\"64\\": 0,\n \\"125\\": 0,\n \\"250\\": 2,\n \\"500\\": 4,\n \\"1000\\": 5,\n \\"2000\\": 6,\n \\"4000\\": 3,\n \\"8000\\": 4,\n \\"16000\\": 4\n },\n \\"Cinematic\\": {\n \\"0\\": -2,\n \\"64\\": -1,\n \\"125\\": -1,\n \\"250\\": -1,\n \\"500\\": 3,\n \\"1000\\": 6,\n \\"2000\\": 6,\n \\"4000\\": 5,\n \\"8000\\": 6,\n \\"16000\\": 8\n }\n}\n"
getDictionary(Text)
@Presets
const DictionaryValue = getValues(@Presets)
const Files = filterFiles(DictionaryValue, "Name", "A to Z")
chooseFromList(Files, "Which EQ preset?")
@Preset
// Build filter for EQ preset
const DictionaryValue1 = getValue(@Presets, @Preset)
const DictionaryValue2 = getValue(DictionaryValue1, "")
const Files1 = filterFiles(DictionaryValue2, "Name", "A to Z")
for _ in Files1 {
}
joinText(RepeatResults, ";")
@Equalizer = "firequalizer=gain_entry='{}'"
}
// Add optional filters
const Text1 = "Add filters\nSkip"
const SplitText = splitText(Text1)
const ChosenItem = chooseFromList(SplitText, "Optional filters?")
if ChosenItem == "Add filters" {
const Text2 = "Dynamic Normalize\nLoud Normalize\nExtra Stereo\nStereo Widen\nSpeech Isolation\nSpeech Normalize\nNoise Reduction\nLower Pitch\nRaise Pitch\nChorus\nReverb"
const SplitText1 = splitText(Text2)
const ChosenItem1 = chooseFromList(SplitText1, "Which filters?", true)
}
// Get audio sample rate needed for changing pitch and loudness norms.
rawAction("AsheKube.app.a-Shell-mini.ExecuteCommandIntent", {
"ShowWhenRun": false,
"command": "ffprobe -i \\\"{@InputName}.{@Extension}\\\" -print_format json -show_streams -show_format -loglevel error",
"openWindow": "close"
})
for _ in output['streams'] {
const DictionaryValue3 = getValue(@RepeatItem, "codec_type")
if DictionaryValue3 == "audio" {
@SampleRate = @RepeatItem['sample_rate']
}
}
// Build optional fiters
const Dictionary1 = {
"Chorus": "chorus=0.5:0.9:50|60|40:0.4|0.32|0.3:0.25|0.4|0.3:2|2.3|1.3",
"Dynamic Normalize": "dynaudnorm=p=0.9:s=5",
"Extra Stereo": "extrastereo=m=2.5",
"Loud Normalize": "loudnorm=I=-16:TP=-1.5:LRA=14",
"Lower Pitch": "asetrate={@SampleRate}*0.8,aresample={@SampleRate},atempo=1/0.8",
"Noise Reduction": "afftdn=nr=10:nf=-25:tn=1",
"Raise Pitch": "asetrate={@SampleRate}*1.2,aresample={@SampleRate},atempo=1/1.2",
"Reverb": "aecho=1.0:0.7:20:0.5",
"Speech Isolation": "lowpass=4000,highpass=200,compand=attacks=0.1:decays=0.8:points=-80/-900|-45/-15|-27/-9|0/-7|20/-7:gain=5",
"Speech Normalize": "speechnorm=e=12.5:r=0.0001:l=1",
"Stereo Widen": "stereowiden=delay=50:drymix=1.0:crossfeed=0.5:feedback=0.8"
}
for _ in ChosenItem1 {
@Filters += Dictionary1[@RepeatItem]
}
// Standard normalization if needed
if @Input {
const Text3 = "echo\nhideKeyboard\nclear\necho\necho\necho\necho\necho Please wait...\necho\necho\necho"
rawAction("AsheKube.app.a-Shell-mini.ExecuteCommandIntent", {
"ShowWhenRun": false,
"command": "Text3",
"keepGoing": true,
"openWindow": "open"
})
wait(0)
const Text4 = "echo\nhideKeyboard\nclear\necho\necho\necho\necho\necho Please wait...\necho\necho\necho\nrm -f level.txt\nffmpeg -hide_banner -i '{@InputName}.{@Extension}' -af volumedetect -vn -f null - 2> level.txt\necho\nhideKeyboard\nclear\necho\necho\necho\necho\necho Please wait...\necho\necho\necho"
rawAction("AsheKube.app.a-Shell-mini.ExecuteCommandIntent", {
"ShowWhenRun": false,
"command": "Text4",
"keepGoing": true,
"openWindow": "open"
})
@loop = nil
repeat _ for 20 {
if @loop beginsWith "level" {
} else {
repeat _ for 20 {
if @loop beginsWith "level" {
} else {
wait(0)
rawAction("AsheKube.app.a-Shell-mini.ExecuteCommandIntent", {
"ShowWhenRun": false,
"command": "ls level.txt"
})
@loop
}
}
}
}
const Matches = containsText(@loop, "(?m)^level.txt")
if !Matches {
} else {
rawAction("AsheKube.app.a-Shell-mini.GetFileIntent", {
"ShowWhenRun": false,
"fileName": "level.txt"
})
const Matches1 = containsText(, "(?m)(?<=max_volume:\s-)[^ dB]+")
if !Matches1 {
} else {
@MaxVolume = Matches1
}
}
if @MaxVolume {
} else {
}
list(, @Filters)
@Filters
} else {
}
if @Equalizer {
@Filters = @Equalizer
}
const CombinedText = joinText(@Filters, ",")
const Count = count(CombinedText, "Characters")
if Count > 0 {
} else {
confirm("No filters were selected.")
stop()
}
if @SampleRate {
} else {
}
const Text5 = "echo\nhideKeyboard\nclear\necho\necho\necho\necho\necho -------------------------------\necho Leave this app on the screen \necho while encoding is in progress.\necho -------------------------------\necho\necho\necho\nrm -f done\nrm -f filtered.{@Extension}\nffmpeg -loglevel panic -stats -i '{@InputName}.{@Extension}' -af \\"{CombinedText}\\"{} -vcodec copy -y filtered.{@Extension}\ntouch done\necho\nhideKeyboard\nclear\necho\necho\necho\necho\n"
rawAction("AsheKube.app.a-Shell-mini.ExecuteCommandIntent", {
"ShowWhenRun": false,
"command": "Text5",
"keepGoing": true
})
@loop = nil
repeat _ for 20 {
if @loop beginsWith "done" {
} else {
repeat _ for 20 {
if @loop beginsWith "done" {
} else {
wait(0)
rawAction("AsheKube.app.a-Shell-mini.ExecuteCommandIntent", {
"ShowWhenRun": false,
"command": "ls done",
"keepGoing": true
})
@loop
}
}
}
}
rawAction("AsheKube.app.a-Shell-mini.ExecuteCommandIntent", {
"ShowWhenRun": false,
"command": "ls filtered.{@Extension}",
"keepGoing": true
})
const Matches2 = containsText(, "(?m)^filtered")
if !Matches2 {
confirm("Processing failed.\n\nDo you want to try again?")
run(@Config, nil)
stop()
} else {
}
rawAction("AsheKube.app.a-Shell-mini.GetFileIntent", {
"ShowWhenRun": false,
"fileName": "filtered.{@Extension}"
})
const RenamedItem = setName(File1, "{@Input}-eq")
const Matches3 = containsText(RenamedItem['File Extension'], "mov|mp4|m4a", false)
if Matches3 {
} else {
}
const SplitText2 = splitText(IfResult)
const ChosenItem2 = chooseFromList(SplitText2)
if ChosenItem2 contains "Photos" {
savePhoto(RenamedItem)
openApp("com.apple.mobileslideshow")
}
if ChosenItem2 contains "Files" {
rawAction("is.workflow.actions.folder", {
"WFFolder": "Ask: \"Choose folder\""
})
if !Folder {
rawAction("is.workflow.actions.folder", {
"WFFolder": ""
})
}
saveFile("", RenamedItem, true)
openFile(IfResult1)
}
if ChosenItem2 contains "Preview" {
setName(RenamedItem, "After: {@Preset}")
setName(@Input, "Before")
const List = list(, )
quicklook(List)
share(RenamedItem)
menu nil {
item "Adjust EQ settings":
run(@Config, @Input)
item "Quit":
}
}
rawAction("AsheKube.app.a-Shell-mini.ExecuteCommandIntent", {
"ShowWhenRun": false,
"command": "rm -f done\\nrm -f filtered.{@Extension}\\nrm -f '{@InputName}.{@Extension}'",
"keepGoing": true
})
Декомпилировано с помощью cherri 2.3.0 (GPL-2.0). Перед компиляцией могут понадобиться небольшие исправления.
Оценки и отзывы
Написать отзыв–
из 5
★★★★★
★★★★
★★★
★★
★
0 ratings
Пока нет отзывов. Поделись мнением первым!
Реклама
Вам также может понравиться
Реклама