Created
          October 21, 2023 01:40 
        
      - 
      
- 
        Save lordjabez/b8595260d56909f2d40dde8b566d7651 to your computer and use it in GitHub Desktop. 
    Split audio file
  
        
  
    
      This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
      Learn more about bidirectional Unicode characters
    
  
  
    
  | #!/usr/bin/env bash | |
| set -e | |
| audio_filename="${1}" | |
| splits_filename="${2}" | |
| x="00:00:00" | |
| z=0 | |
| audio_filename=$(basename -- "$1") | |
| ext="${audio_filename##*.}" | |
| audio_filename="${audio_filename%.*}" | |
| initcmd="ffmpeg -nostdin -hide_banner -loglevel error -i $1" | |
| while read y; do | |
| initcmd+=" -ss $x -to $y -c copy ${audio_filename}_$z.$ext" | |
| let "z=z+1" | |
| x=$y | |
| done < "${splits_filename}" | |
| $initcmd | 
  
    Sign up for free
    to join this conversation on GitHub.
    Already have an account?
    Sign in to comment