Update app.py
Browse files
app.py
CHANGED
|
@@ -1,75 +1,16 @@
|
|
| 1 |
-
|
| 2 |
-
|
| 3 |
-
|
| 4 |
-
|
| 5 |
-
|
| 6 |
-
|
| 7 |
-
|
| 8 |
-
|
| 9 |
-
|
| 10 |
-
|
| 11 |
-
|
| 12 |
-
|
| 13 |
-
|
| 14 |
-
|
| 15 |
-
|
| 16 |
-
|
| 17 |
-
# Reverb effect implementation
|
| 18 |
-
pass
|
| 19 |
-
|
| 20 |
-
def apply_chorus(audio_data):
|
| 21 |
-
# Chorus effect implementation
|
| 22 |
-
pass
|
| 23 |
-
|
| 24 |
-
def apply_distortion(audio_data):
|
| 25 |
-
# Distortion effect implementation
|
| 26 |
-
pass
|
| 27 |
-
|
| 28 |
-
def apply_compression(audio_data):
|
| 29 |
-
# Compression effect implementation
|
| 30 |
-
pass
|
| 31 |
-
|
| 32 |
-
def apply_pitch_correction(audio_data):
|
| 33 |
-
# Pitch correction implementation
|
| 34 |
-
pass
|
| 35 |
-
|
| 36 |
-
def apply_auto_eq(audio_data):
|
| 37 |
-
# Auto EQ implementation
|
| 38 |
-
pass
|
| 39 |
-
|
| 40 |
-
def apply_widen_delay(audio_data):
|
| 41 |
-
# Widen delay implementation
|
| 42 |
-
pass
|
| 43 |
-
|
| 44 |
-
def apply_bitcrusher(audio_data):
|
| 45 |
-
# Bitcrusher effect implementation
|
| 46 |
-
pass
|
| 47 |
-
|
| 48 |
-
@app.route('/')
|
| 49 |
-
def index():
|
| 50 |
-
return render_template('index.html')
|
| 51 |
-
|
| 52 |
-
@app.route('/process', methods=['POST'])
|
| 53 |
-
def process_audio():
|
| 54 |
-
file = request.files['audio_file']
|
| 55 |
-
audio_data, rate = sf.read(file)
|
| 56 |
-
|
| 57 |
-
# Apply effects
|
| 58 |
-
audio_data = apply_vocoder(audio_data, rate)
|
| 59 |
-
audio_data = apply_reverb(audio_data)
|
| 60 |
-
audio_data = apply_chorus(audio_data)
|
| 61 |
-
audio_data = apply_distortion(audio_data)
|
| 62 |
-
audio_data = apply_compression(audio_data)
|
| 63 |
-
audio_data = apply_pitch_correction(audio_data)
|
| 64 |
-
audio_data = apply_auto_eq(audio_data)
|
| 65 |
-
audio_data = apply_widen_delay(audio_data)
|
| 66 |
-
audio_data = apply_bitcrusher(audio_data)
|
| 67 |
-
|
| 68 |
-
# Save processed audio
|
| 69 |
-
output_file = 'processed_audio.wav'
|
| 70 |
-
sf.write(output_file, audio_data, rate)
|
| 71 |
-
|
| 72 |
-
return f'Processed audio saved as {output_file}'
|
| 73 |
-
|
| 74 |
-
if __name__ == '__main__':
|
| 75 |
-
app.run(debug=True)
|
|
|
|
| 1 |
+
import os
|
| 2 |
+
os.system("python pip install pedalboard")
|
| 3 |
+
shell_script = './install_Applio.sh'
|
| 4 |
+
os.system(f'chmod +x {shell_script}')
|
| 5 |
+
try:
|
| 6 |
+
return_code = os.system(shell_script)
|
| 7 |
+
if return_code == 0:
|
| 8 |
+
print("Shell script executed successfully.")
|
| 9 |
+
else:
|
| 10 |
+
print(f"Shell script failed with return code {return_code}")
|
| 11 |
+
except Exception as e:
|
| 12 |
+
print(f"An error occurred: {e}")
|
| 13 |
+
|
| 14 |
+
|
| 15 |
+
|
| 16 |
+
os.system("python -m sklearnex infer-web.py --pycmd python --port 7897 --theme dark")
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|