Skip to content

Instantly share code, notes, and snippets.

import pygame
import sys, os
import numpy as np
import time
pygame.init()
pygame.mixer.init()
window_surface = pygame.display.set_mode((800, 600))
def get_sound(level):
from recorder import Recorder
import numpy as np
import wave
import time
class basic_recorder(Recorder):
def start(self):
self.record_stop = False
self.cache_wave = []
/*************************************************************************
* ADOBE CONFIDENTIAL
* ___________________
*
* Copyright 2014 Adobe Inc.
* All Rights Reserved.
*
* NOTICE: Adobe permits you to use, modify, and distribute this file in
* accordance with the terms of the Adobe license agreement accompanying
* it. If you have received this file from a source other than Adobe,
def mp3_2_wav(file):
name = os.path.splitext(os.path.basename(file))[0]
audio = AudioSegment.from_file(file, format="mp3")
#, frame_rate=22050, channels=1, sample_width=2
audio = audio.set_frame_rate(22050)
audio = audio.set_channels(1)
audio = audio.set_sample_width(2)
exports.westworld_sence = function (location) {
basic_location = [parseInt(location.x), parseInt(location.y), parseInt(location.z)];
basic_world = location.world;
var location_object = org.bukkit.Location;
/** Relative location x y, spawn typeid, spawn, data */
var creation = [
[0, 0, 1, 0],
[1, 0, 1, 0],
from socket import socket
from multiprocessing.dummy import Pool
machine_ip, machine_port = "192.168.20.150", 8899
connect_machine_socket = socket()
connect_machine_socket.bind((machine_ip, machine_port))
connect_machine_socket.listen()
from socket import socket
from multiprocessing.dummy import Pool
import time
def wait_client(client_socket, ip_port):
try:
pag = []
tmp = None
while True:
import socket
import sys
host, port = "192.168.43.201", 5000
sock = socket.socket(socket.AF_INET, socket.SOCK_STREAM)
sock.bind((host, port))
sock.listen(1)
import os
root_dir = "odoo-db-data"
for this_dir in os.listdir(root_dir):
now_path = "/".join([root_dir, this_dir])
if os.path.isdir(now_path):
if len(os.listdir(now_path)) == 0:
print (now_path)
def pre_execute(function):
print("in pre execute")
return function()
@pre_execute
def execute():
print ("hello world")