This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
import dearpygui.dearpygui as dpg | |
class App: | |
def __init__(self): | |
pass | |
def window(self): | |
with dpg.window(label="Test"): | |
dpg.add_text("Hello world") | |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
import ctypes | |
from typing import Optional, Union, ByteString | |
from . import opus | |
from .pyogg_error import PyOggError | |
class OpusEncoder: | |
"""Encodes PCM data into Opus frames.""" | |
def __init__(self) -> None: | |
self._encoder: Optional[ctypes.pointer] = None |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
#include <stdio.h> | |
int main() { | |
float epsilon = 1; | |
float one = 1; | |
while (1 + epsilon != 1) { | |
printf("Epsilon = %.12f\n", epsilon); | |
epsilon/=2; | |
} |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
# same encoder for thailand by damp11113 | |
import datetime | |
import numpy as np | |
import pyaudio | |
import time | |
import soundfile as sf | |
from scipy import signal | |
import os | |
import pyttsx3 |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
import os | |
import subprocess | |
import paramiko | |
import socket | |
import sys | |
import threading | |
from damp11113 import pyversion, osversion, cmd, list2str | |
import pyfiglet |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
import struct | |
def create_multiplex4_file(filename, sample_rate, data_format, data_streams): | |
with open(filename, 'wb') as file: | |
# Write header information | |
header = struct.pack('!If', sample_rate, data_format) | |
file.write(header) | |
# Write data streams | |
for stream_data in data_streams: |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
import os | |
import json | |
import shutil | |
# ---------------- setting here -------------------- | |
extracted_path = <extracted folder> | |
objects_path = <objects folder> | |
index_json = <index file ex 1.19.json> | |
# --------------------------------------------------- |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
from mido import MidiFile | |
import time | |
import easygui | |
import fluidsynth | |
import os | |
os.system(f'title seclect midi file') | |
midi_file = easygui.fileopenbox(filetypes=['*.mid', '*.midi'], title='Select a MIDI file') | |
# check file type | |
try: |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
import pyaudio | |
import numpy as np | |
import time | |
CHUNK = 2**11 | |
p = pyaudio.PyAudio() | |
stream = p.open(format=pyaudio.paInt16, channels=2, rate=44100, input=True, input_device_index=5, frames_per_buffer=CHUNK) |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
/* | |
* Created by damp11113 | |
* | |
* This example code is in github https://gist.github.com/damp11113/62af5256702c661086f8ae6d2bb6716e | |
*/ | |
#include <Wire.h> | |
#include <LiquidCrystal_I2C.h> | |
int lcdColumns = A5; | |
int lcdRows = A4; |