Skip to content

Instantly share code, notes, and snippets.

@zumpchke
zumpchke / README.md
Last active September 24, 2021 12:02 — forked from GusAntoniassi/README.md
Play audio files on your microphone with ffmpeg

play-audio-mic.sh

This script was adapted to allow you to play audio files through your microphone input. It does so by creating a virtual microphone and piping an audio file to it.

The work was mostly done in this StackOverflow answer, I just adapted it to use ffmpeg and add a trap to cleanup on exit.

Requirements:

  • ffmpeg
  • Bash
  • PulseAudio/pactl
@zumpchke
zumpchke / rolling_window.py
Created February 7, 2016 08:05 — forked from seberg/rolling_window.py
Multidimensional rolling_window for numpy
def rolling_window(array, window=(0,), asteps=None, wsteps=None, axes=None, toend=True):
"""Create a view of `array` which for every point gives the n-dimensional
neighbourhood of size window. New dimensions are added at the end of
`array` or after the corresponding original dimension.
Parameters
----------
array : array_like
Array to which the rolling window is applied.
window : int or tuple
import time
from keras.models import Sequential
from keras.layers.core import Dense, Dropout, Activation, Lambda, TimeDistributedDense
from keras.layers.recurrent import LSTM
from keras.layers.embeddings import Embedding
from keras.optimizers import RMSprop
from keras.utils import np_utils
import numpy as np
import matplotlib.pyplot as plt