This file contains 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
# build helloworld executable when user executes "make" | |
volumecontrol: volumecontrol.o | |
$(CC) $(LDFLAGS) -lasound volumecontrol.o -o volumecontrol | |
volumecontrol.o: volumecontrol.c | |
$(CC) $(CFLAGS) -c volumecontrol.c | |
# remove object files and executable when user executes "make clean" | |
clean: | |
rm *.o volumecontrol |
This file contains 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
import numpy as np | |
import subprocess as sp | |
import os | |
DEVNULL = open(os.devnull, 'w') | |
# load_audio can not detect the input type | |
def ffmpeg_load_audio(filename, sr=44100, mono=False, normalize=True, in_type=np.int16, out_type=np.float32): | |
channels = 1 if mono else 2 | |
format_strings = { | |
np.float64: 'f64le', |