collab/PineapplePad

git clone https://git.julia.blue/collab/PineapplePad

Joseph RyanGet sfx for death/level up9e3c12a

master
853 B30 linesraw
1import sys
2import os
3
4if len(sys.argv) < 2:
5    print "This script takes a file with a list of audio files and youtube video ID's, as well as titles, see exampleSounds.txt"
6    sys.exit()
7
8f = open(sys.argv[1])
9for line in f:
10    if line == '':
11        continue
12    song = line.split(':')
13    inputFile = song[0].strip()
14    outputFile = song[1].strip()
15    if '.' not in inputFile:
16        os.system("youtube-dl " + inputFile +
17                  " -q -o \"yt-temp.%(ext)s\" -x --audio-format wav")
18        inputFile = "yt-temp.wav"
19    print "Converting", outputFile, "to raw low quality audio... ",
20    os.system(
21        "sox " +
22        inputFile +
23        " -r 8000 -b 8 -c 1 -e unsigned-integer " +
24        outputFile +
25        ".wav vol $(sox " +
26        inputFile +
27        " -n stat -v 2>&1)")
28    print "Finished"
29
30os.system("rm yt-temp.wav")