Navigation Menu

Skip to content

Instantly share code, notes, and snippets.

@ghedo
ghedo / sound_playback.c
Last active March 2, 2024 08:47
Simple sound playback using ALSA API and libasound
/*
* Simple sound playback using ALSA API and libasound.
*
* Compile:
* $ cc -o play sound_playback.c -lasound
*
* Usage:
* $ ./play <sample_rate> <channels> <seconds> < <file>
*
* Examples:
@Pretz
Pretz / generate.py
Created February 8, 2012 21:04
CSV to WAV: Needed a way to convert a list of numbers in a CSV file to a wave audio file. Go python.
#!/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):