Skip to content

Instantly share code, notes, and snippets.

@germanviscuso
Last active April 29, 2022 07:05
Show Gist options
  • Star 0 You must be signed in to star a gist
  • Fork 1 You must be signed in to fork a gist
  • Save germanviscuso/200f27f975d685dd89d4fcc4c334ef10 to your computer and use it in GitHub Desktop.
Save germanviscuso/200f27f975d685dd89d4fcc4c334ef10 to your computer and use it in GitHub Desktop.
Audio file conversion for Alexa skills
# Convert audio to SSML compatible mp3
ffmpeg -i <input-file> -ac 2 -codec:a libmp3lame -b:a 48k -ar 16000 <output-file.mp3>
# Normalize audio
ffmpeg -i <input-file.mp3> -af loudnorm=I=-14:TP=-3:LRA=11:print_format=json -b:a 48k -ar 16000 <output-file.mp3>
# Do both at the same time
ffmpeg -i <input-file.mp3> -ac 2 -codec:a libmp3lame -af loudnorm=I=-16:TP=-3:LRA=11:print_format=json -b:a 48k -ar 16000 <output-file.mp3>
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment