Text to Video

टेक्स्ट-टू-वीडियो कन्वर्टर

body { font-family: Arial, sans-serif; text-align: center; background-color: #f4f4f4; } .container { margin-top: 50px; } textarea { width: 80%; height: 100px; } button { padding: 10px 20px; margin-top: 10px; background-color: blue; color: white; border: none; cursor: pointer; } canvas { margin-top: 20px; background: white; border: 1px solid black; } function convertToVideo() { let text = document.getElementById("textInput").value; if (!text) { alert("कृपया कुछ टेक्स्ट डालें!"); return; } // Text-to-Speech let speech = new SpeechSynthesisUtterance(text); speech.lang = "hi-IN"; // हिंदी के लिए speechSynthesis.speak(speech); // Canvas पर टेक्स्ट एनिमेशन let canvas = document.getElementById("videoCanvas"); let ctx = canvas.getContext("2d"); canvas.width = 500; canvas.height = 300; let x = 10, y = 150; function animateText() { ctx.clearRect(0, 0, canvas.width, canvas.height); ctx.font = "24px Arial"; ctx.fillStyle = "black"; ctx.fillText(text, x, y); x += 2; if (x < canvas.width) { requestAnimationFrame(animateText); } } animateText(); }

Comments

Popular posts from this blog