removed autoplay and adjusted naming
This commit is contained in:
@@ -377,10 +377,18 @@ def load_model(model_config=None, model_ckpt_path=None, pretrained_name=None, pr
|
||||
import shutil
|
||||
from urllib.parse import quote
|
||||
def save_audio_files(output, sample_rate, filename_prefix, counter, data=None, save_temp=True):
|
||||
from datetime import datetime
|
||||
|
||||
filename_prefix += ""
|
||||
output_dir = "output"
|
||||
os.makedirs(output_dir, exist_ok=True)
|
||||
wavname = filename_prefix if not data else replace_variables(filename_prefix, data)
|
||||
|
||||
# Get current datetime and format it
|
||||
current_time = datetime.now().strftime("%Y%m%d_%H%M%S")
|
||||
|
||||
# Create filename with datetime
|
||||
wavname = f"{current_time}_{filename_prefix}" if not data else f"{current_time}_{replace_variables(filename_prefix, data)}"
|
||||
|
||||
filepaths = []
|
||||
for i, audio in enumerate(output):
|
||||
if i > 0: # TODO fix batches
|
||||
|
||||
+6
-6
@@ -25,12 +25,12 @@ app.registerExtension({
|
||||
file = "temp/stableaudiosampler.wav";
|
||||
}
|
||||
|
||||
const url = new URL(`http://localhost:8188/view?filename=${encodeURIComponent(file)}&subfolder=&type=output&format=audio%2Fwav`);
|
||||
console.log(import.meta.url)
|
||||
console.log(url)
|
||||
const audio = new Audio(url);
|
||||
audio.volume = 1.0; //this.widgets[1].value;
|
||||
audio.play();
|
||||
// const url = new URL(`http://localhost:8188/view?filename=${encodeURIComponent(file)}&subfolder=&type=output&format=audio%2Fwav`);
|
||||
// console.log(import.meta.url)
|
||||
// console.log(url)
|
||||
// const audio = new Audio(url);
|
||||
// audio.volume = 1.0; //this.widgets[1].value;
|
||||
// audio.play();
|
||||
};
|
||||
}
|
||||
},
|
||||
|
||||
Reference in New Issue
Block a user