Skip to content

Instantly share code, notes, and snippets.

View nkpro2000's full-sized avatar
💻
Learning....

nkpro2000

💻
Learning....
View GitHub Profile
@tshirtman
tshirtman / test_rounded.py
Created September 6, 2013 15:44
Rounded rectangle implementation, this is a widget, should probably be converted to a canvas instruction
from kivy.app import App
from kivy.lang import Builder
from kivy.uix.widget import Widget
from kivy.properties import NumericProperty, ListProperty
from math import sin, cos, pi
kv = '''
BoxLayout:
FloatLayout:
RoundedBox:
@dustinfarris
dustinfarris / main.py
Last active March 30, 2021 11:20
Download a file in a Kivy application then open it in a separate application
#!/usr/bin/env python
import sys
sys.platform = 'linux2'
import os.path
import mimetypes
import urlparse
import requests
@ExpandOcean
ExpandOcean / kivy_cv.py
Created January 7, 2015 06:48
kivy and opencv work together demo
# coding:utf-8
from kivy.app import App
from kivy.uix.image import Image
from kivy.clock import Clock
from kivy.graphics.texture import Texture
import cv2
class KivyCamera(Image):
def __init__(self, capture, fps, **kwargs):
@codediodeio
codediodeio / database.rules.json
Last active June 22, 2024 07:03
Common Database Rules for Firebase
// No Security
{
"rules": {
".read": true,
".write": true
}
}
@nkpro2000sr
nkpro2000sr / change_duration.py
Last active February 16, 2020 18:35
To change dueration of audio file. we can also generate different voices with changing dueration and frame_rate.
from pydub import AudioSegment as As
import os
def change(p_af, p_maf, duer, fr= None) :
"""$p_af is path of input audio file
$p_maf is path for output audio file
$duer = output audio file duration (in seconds)
$fr = output audio file frame rate"""
with open(p_af, 'rb') as af :
sound = As.from_file(af)
@nkpro2000sr
nkpro2000sr / say_gtts.py
Created February 8, 2020 07:19
text_to_speech you can hear speech by calling say("text")
from gtts import gTTS
from io import BytesIO
import pygame; pygame.mixer.init()
def say(text):
tts = gTTS(text=text, lang='en')
fp = BytesIO()
tts.write_to_fp(fp)
fp.seek(0)
pygame.mixer.music.load(fp)
@nkpro2000sr
nkpro2000sr / audplt.py
Last active February 21, 2020 07:01
plot audio file in matplotlib
from matplotlib import pyplot as plt
import librosa
#For specgram
NFFT = 1024
noverlap = 900
#For MFCC
n_mfcc = 40