Skip to content

Instantly share code, notes, and snippets.

# 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
@dchabot
dchabot / ffmpeg_load_audio.py
Created June 4, 2018 17:52 — forked from kylemcdonald/ffmpeg_load_audio.py
Load audio from ffmpeg into Python using numpy.
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',