Wie kann ich den HTML -Audio -Player -Cache jedes Mal neu laden, wenn ich eine Taste drücke?HTML

HTML-Programmierer
Anonymous
 Wie kann ich den HTML -Audio -Player -Cache jedes Mal neu laden, wenn ich eine Taste drücke?

Post by Anonymous »

Ich habe eine erstellte WAV -Datei mit dem Aufschluss über. Das Audiospiel erkennt jedoch erst nach einer zufälligen Zeit. Ich möchte, dass der Audio-Player aktualisiert und prüft, ob in.wav unterschiedlich ist.

Code: Select all

function display(textString,keyString,modeString,instrumentString, onSuccess) {
// ajax allows the function to take place without having to refresh webpage
$.ajax({
// searches for string_return in app.py
url: "string_return",
data: {
text_string: textString,
key_string : keyString,
mode_string : modeString,
instrument_string : instrumentString
},
// allows function know to return json data type and look for GET method
dataType: "json",
type: "GET",
// what this does is if the ajax request is successful, it executes the specified function in
// the parameter (in the below case, that's specified as function(returnedString))
success: function(response) {
onSuccess(response);
}
});
}
// if button with id "convert-button" is clicked...
$("#convert-button").on("click", function() {
// textString is set to the value the user inputted in the text box
let textString = $("#text-input").val();
let key = $("#key").val();
let mode = $("#mode").val();
let inst = $("#instrument").val();
// display method from above is called
display(textString, key, mode, inst,function(returnedString) {
$("#returned_string").text(returnedString);
});

const audio_player = document.getElementById("player");
audio_player.load();
});
< /code>
Ich weiß10.245.100.65 - - [27/Apr/2024 17:13:01] "GET /static/in.wav HTTP/1.1" 206 -
in meiner Flask -App. Wie kann ich diesen Audio -Player -Neuladen erneut auslösen?>

Quick Reply

Change Text Case: 
   
  • Similar Topics
    Replies
    Views
    Last post