Skip to content

Instantly share code, notes, and snippets.

View johnroper100's full-sized avatar
🖥️
Coding and Having Fun!

John Roper johnroper100

🖥️
Coding and Having Fun!
View GitHub Profile
@johnroper100
johnroper100 / swap
Created January 28, 2019 18:50
Swap two 2D array items in Java
public static int[][] swap(int[][] array, int firstRow, int firstCol, int lastRow, int lastCol) {
int first = array[firstRow][firstCol];
int last = array[lastRow][lastCol];
array[firstRow][firstCol] = last;
array[lastRow][lastCol] = first;
return array;
}
@johnroper100
johnroper100 / testcode.cpp
Last active May 26, 2020 16:58
Test code
#include <stdio.h>
#include <vector>
#include <iostream>
#include <string>
#include "portaudio.h"
#include <sndfile.hh>
#include <cstring>
#include <thread>
#include <chrono>
@johnroper100
johnroper100 / wavfile.py
Created July 4, 2020 02:56 — forked from josephernest/wavfile.py
wavfile.py (enhanced)
# wavfile.py (Enhanced)
# Date: 20190213_2328 Joseph Ernest
#
# URL: https://gist.github.com/josephernest/3f22c5ed5dabf1815f16efa8fa53d476
# Source: scipy/io/wavfile.py
#
# Added:
# * read: also returns bitrate, cue markers + cue marker labels (sorted), loops, pitch
# See https://web.archive.org/web/20141226210234/http://www.sonicspot.com/guide/wavefiles.html#labl
# * read: 24 bit & 32 bit IEEE files support (inspired from wavio_weckesser.py from Warren Weckesser)