Skip to content

Instantly share code, notes, and snippets.

@pvilas
Last active June 23, 2023 10:09
Show Gist options
  • Star 0 You must be signed in to star a gist
  • Fork 0 You must be signed in to fork a gist
  • Save pvilas/ae4091dfceed739d8ff95605e11346ba to your computer and use it in GitHub Desktop.
Save pvilas/ae4091dfceed739d8ff95605e11346ba to your computer and use it in GitHub Desktop.
Per treballar amb audio a osx

afinfo exmaple.mp3 afplay example.mp3

Utilitat amb ffmpeg

Tallar audio

ffmpeg -ss 60 -i input-audio.aac -t 15 -c copy output.aac

-ss 60 means, "start from second 60"

-t 15 audio output length in seconds.. in this case, 15 seconds..

# -- afplay example.mp3 --
$ ffplay -nodisp -loglevel panic example.mp3

# -- afinfo example.mp3 --
$ ffprobe example.mp3

# -- afinfo example.mp3 | grep "duration:" | cut -d' ' -f3 --
$ ffprobe -v error -show_entries format=duration -of default=noprint_wrappers=1:nokey=1 example.mp3

# convert mp3 file to a wav file
$ ffmpeg -i example.mp3 example.wav
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment