Skip to content

Instantly share code, notes, and snippets.

@Pretz
Pretz / generate.py
Created Feb 8, 2012
CSV to WAV: Needed a way to convert a list of numbers in a CSV file to a wave audio file. Go python.
View generate.py
#!/usr/bin/python
import wave
import numpy
import struct
import sys
import csv
from scikits.samplerate import resample
def write_wav(data, filename, framerate, amplitude):
@ghedo
ghedo / sound_playback.c
Last active Nov 11, 2021
Simple sound playback using ALSA API and libasound
View sound_playback.c
/*
* Simple sound playback using ALSA API and libasound.
*
* Compile:
* $ cc -o play sound_playback.c -lasound
*
* Usage:
* $ ./play <sample_rate> <channels> <seconds> < <file>
*
* Examples: