This file contains hidden or 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 packages | |
from pydub import AudioSegment | |
from pydub.playback import play | |
# Play audio | |
playaudio = AudioSegment.from_file("bala.wav", format="wav") | |
play(playaudio) |
This file contains hidden or 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 vad import VoiceActivityDetector | |
# import json | |
# Input file | |
audiofile = "abc.wav" | |
plotaudiosignal = VoiceActivityDetector(audiofile) | |
# Plotting the Audio signals, so that we can identify when it is having silence in audio |
This file contains hidden or 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 | |
from pydub import AudioSegment | |
import glob | |
# if "audio" folder not exists, it will create | |
if not os.path.isdir("audio"): | |
os.mkdir("audio") | |
# Grab the Audio files in "audio" folder | |
wavfiles = glob.glob("./audio/*.wav") |
This file contains hidden or 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 collections | |
import contextlib | |
import sys | |
import wave | |
import webrtcvad | |
def read_wave(path): | |
"""Reads a .wav file. | |
Takes the path, and returns (PCM audio data, sample rate). |
This file contains hidden or 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 | |
from flask import Flask, flash, request, redirect, render_template | |
from werkzeug.utils import secure_filename | |
app=Flask(__name__) | |
app.secret_key = "secret key" | |
app.config['MAX_CONTENT_LENGTH'] = 16 * 1024 * 1024 | |
path = os.getcwd() |
This file contains hidden or 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
<!doctype html> | |
<title>Python Flask Multiple Files Upload Example</title> | |
<h2>Select file to upload</h2> | |
<p> | |
{% with messages = get_flashed_messages() %} | |
{% if messages %} | |
<ul class=flashes> | |
{% for message in messages %} | |
<li>{{ message }}</li> | |
{% endfor %} |
This file contains hidden or 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 | |
from flask import Flask, flash, request, redirect, render_template | |
from werkzeug.utils import secure_filename | |
app=Flask(__name__) | |
app.secret_key = "secret key" | |
app.config['MAX_CONTENT_LENGTH'] = 16 * 1024 * 1024 | |
# Get current path |
This file contains hidden or 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
<!doctype html> | |
<title>Python Flask Multiple Files Upload Example</title> | |
<h2>Select file(s) to upload</h2> | |
<p> | |
{% with messages = get_flashed_messages() %} | |
{% if messages %} | |
<ul class=flashes> | |
{% for message in messages %} | |
<li>{{ message }}</li> | |
{% endfor %} |
This file contains hidden or 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 zipfile | |
import os | |
from flask import send_file,Flask,send_from_directory | |
app = Flask(__name__) | |
@app.route('/download_files') | |
def download_all(): | |
# Zip file Initialization and you can change the compression type | |
zipfolder = zipfile.ZipFile('Audiofiles.zip','w', compression = zipfile.ZIP_STORED) |
This file contains hidden or 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 flask import Flask,send_file,send_from_directory | |
app = Flask(__name__) | |
# The absolute path of the directory containing images for users to download | |
app.config["CLIENT_IMAGES"] = "E:/AudiotoText/Flask_File_Downloads/filedownload/files/image" | |
# The absolute path of the directory containing CSV files for users to download | |
app.config["CLIENT_CSV"] = "E:/AudiotoText/Flask_File_Downloads/filedownload/files/csv" |
OlderNewer