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
# Loading the Libraries | |
from scipy.io.wavfile import read | |
import numpy as np | |
import matplotlib.pyplot as plt | |
# Read the Audiofile | |
samplerate, data = read('6TU5302374.wav') | |
# Frame rate for the Audio | |
print(samplerate) |
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 pydub import AudioSegment | |
sound = AudioSegment.from_file("chunk.wav") | |
print("----------Before Conversion--------") | |
print("Frame Rate", sound.frame_rate) | |
print("Channel", sound.channels) | |
print("Sample Width",sound.sample_width) | |
# Change Frame Rate | |
sound = sound.set_frame_rate(16000) |
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 pydub import AudioSegment | |
sound = AudioSegment.from_file("chunk.wav") | |
def speed_change(sound, speed): | |
sound_with_altered_frame_rate = sound._spawn(sound.raw_data, overrides={ | |
"frame_rate": int(sound.frame_rate * speed) | |
}) |
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 pydub import AudioSegment | |
import os | |
if not os.path.isdir("splitaudio"): | |
os.mkdir("splitaudio") | |
audio = AudioSegment.from_file("audio123.gsm") | |
lengthaudio = len(audio) | |
print("Length of Audio File", lengthaudio) |
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" |
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
<!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 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 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 | |
path = os.getcwd() |