{"size": 1134, "ext": "js", "max_stars_repo_path": "docs/example1/speech-output.js", "max_stars_repo_name": "FunThomas424242/webspeech.example", "max_stars_repo_stars_event_min_datetime": null, "max_stars_repo_stars_event_max_datetime": null, "max_issues_repo_path": "docs/example1/speech-output.js", "max_issues_repo_name": "FunThomas424242/webspeech.example", "max_issues_repo_issues_event_min_datetime": null, "max_issues_repo_issues_event_max_datetime": null, "max_forks_repo_path": "docs/example1/speech-output.js", "max_forks_repo_name": "FunThomas424242/webspeech.example", "max_forks_repo_forks_event_min_datetime": null, "max_forks_repo_forks_event_max_datetime": null}
{"max_stars_count": null, "max_issues_count": null, "max_forks_count": null, "avg_line_length": 34.3636363636, "max_line_length": 75, "alphanum_fraction": 0.5873015873}
var synthese = window.speechSynthesis;
var suchfeld = document.querySelector('#suchfeld');

function suchkriterienVorlesen(){
    if (synthese.speaking) {
        console.error('Spricht bereits');
        return;
    }
    if (suchfeld.value !== '') {
        var vorleseText = 'Ihre Eingaben zur Kontrolle: '+ suchfeld.value;
        console.log("Text:"+vorleseText);
        var leserStimmeMitText = new SpeechSynthesisUtterance(vorleseText);
        leserStimmeMitText.onend = function (event) {
            console.log('Vorlesen beendet');
        }
        leserStimmeMitText.onerror = function (event) {
            console.error('Fehler beim Vorlesen');
        }
        var voices = synthese.getVoices();
        for(i = 0; i < voices.length ; i++) {
            if(voices[i].default) {
                console.log("Voice:"+voices[i].name + voices[i].lang);
                leserStimmeMitText.voice = voices[i];
                break;
            }
        }
        leserStimmeMitText.pitch = 1;
        leserStimmeMitText.rate = 1;
        leserStimmeMitText.volume = 1;
        synthese.speak(leserStimmeMitText);
    }
}
