Skip to content

Instantly share code, notes, and snippets.

@trongnghia203
trongnghia203 / install_pyenv.md
Last active July 1, 2024 14:29
Install pyenv
@HudsonHuang
HudsonHuang / audio_format.py
Created October 11, 2019 15:21
Convert audio data of PCM16/float32 to byte, and vice versa.
"""Helper functions for working with audio files in NumPy."""
"""some code borrowed from https://github.com/mgeier/python-audio/blob/master/audio-files/utility.py"""
import numpy as np
import contextlib
import librosa
import struct
import soundfile
def float_to_byte(sig):
@loganasherjones
loganasherjones / agnoster-pyenv
Created February 5, 2019 02:39
Display pyenv environment on agnoster prompt
# vim:ft=zsh ts=2 sw=2 sts=2
#
# agnoster's Theme - https://gist.github.com/3712874
# A Powerline-inspired theme for ZSH
#
# # README
#
# In order for this theme to render correctly, you will need a
# [Powerline-patched font](https://github.com/Lokaltog/powerline-fonts).
# Make sure you have a recent version: the code points that Powerline
@chief7
chief7 / read_wave.py
Created February 18, 2017 13:55
Read big wave file in python (pcm, little endian) without library.
import struct
def read_wave_raw(filename):
"""
Just pass in a filename and get bytes representation of
audio data as result
:param filename: a wave file
:param rate:
:return: tuple -> data, #channels, samplerate, datatype (in bits)