Updated 4/11/2018
Here's my experience of installing the NVIDIA CUDA kit 9.0 on a fresh install of Ubuntu Desktop 16.04.4 LTS.
| #!/usr/bin/env python | |
| import pyaudio | |
| import socket | |
| import sys | |
| FORMAT = pyaudio.paInt16 | |
| CHANNELS = 1 | |
| RATE = 44100 | |
| CHUNK = 4096 |
| import pyaudio | |
| import wave | |
| FORMAT = pyaudio.paInt16 | |
| CHANNELS = 2 | |
| RATE = 44100 | |
| CHUNK = 1024 | |
| RECORD_SECONDS = 5 | |
| WAVE_OUTPUT_FILENAME = "file.wav" | |
| # Keras==1.0.6 | |
| import numpy as np | |
| from keras.models import Sequential | |
| from keras.layers.recurrent import LSTM | |
| from keras.layers.core import TimeDistributedDense, Activation | |
| from keras.preprocessing.sequence import pad_sequences | |
| from keras.layers.embeddings import Embedding | |
| from sklearn.cross_validation import train_test_split | |
| from sklearn.metrics import confusion_matrix, accuracy_score, precision_recall_fscore_support |
| #!/bin/bash | |
| ## This gist contains step by step instructions to install cuda v9.0 and cudnn 7.2 in ubuntu 18.04 | |
| ### steps #### | |
| # verify the system has a cuda-capable gpu | |
| # download and install the nvidia cuda toolkit and cudnn | |
| # setup environmental variables | |
| # verify the installation | |
| ### |
| apt-get update && apt-get install -y \ | |
| sox \ | |
| curl \ | |
| libicu-dev \ | |
| g++ \ | |
| git \ | |
| python \ | |
| python-dev \ | |
| python-setuptools \ |
Updated 4/11/2018
Here's my experience of installing the NVIDIA CUDA kit 9.0 on a fresh install of Ubuntu Desktop 16.04.4 LTS.
| wget --no-check-certificate --content-disposition https://github.com/joyent/node/tarball/v0.7.1 | |
| # --no-check-cerftificate was necessary for me to have wget not puke about https | |
| curl -LJO https://github.com/joyent/node/tarball/v0.7.1 |
| <?php | |
| namespace App\BotMan\Middleware; | |
| use Mpociot\BotMan\Message; | |
| use Mpociot\BotMan\Http\Curl; | |
| use Mpociot\BotMan\Interfaces\HttpInterface; | |
| use Mpociot\BotMan\Interfaces\DriverInterface; | |
| use Mpociot\BotMan\Interfaces\MiddlewareInterface; |
Minimal example: transcode from MP3 to WMA:
ffmpeg -i input.mp3 output.wma
You can get the list of supported formats with:
ffmpeg -formats
Convert WAV to MP3, mix down to mono (use 1 audio channel), set bit rate to 64 kbps and sample rate to 22050 Hz:
| # -*- coding: utf-8 -*- | |
| import os | |
| import uuid | |
| from flask import Flask, render_template, redirect, url_for, request | |
| from flask_uploads import UploadSet, configure_uploads, IMAGES, patch_request_class | |
| from flask_wtf import FlaskForm | |
| from flask_wtf.file import FileField, FileRequired, FileAllowed | |
| from wtforms import SubmitField |