Please bookmark this page to avoid losing your image tool!

Sound Laugh Player

(Free & Supports Bulk Upload)

Drag & drop your images here or

The result will appear here...
You can edit the below JavaScript code to customize the image tool.
function processImage(originalImg, laughText = "Ахахахахаха! Хихихихи!", lang = "ru-RU", pitch = 1.2, rate = 1.2) {
    const canvas = document.createElement('canvas');
    canvas.width = originalImg.width;
    canvas.height = originalImg.height;
    const ctx = canvas.getContext('2d');

    // Draw the original image onto the canvas
    ctx.drawImage(originalImg, 0, 0);

    // Create a dark semi-transparent overlay to emphasize the player UI
    ctx.fillStyle = 'rgba(0, 0, 0, 0.5)';
    ctx.fillRect(0, 0, canvas.width, canvas.height);

    // Calculate dimensions for the play button
    const centerX = canvas.width / 2;
    const centerY = canvas.height / 2;
    const radius = Math.min(canvas.width, canvas.height) * 0.15;

    // Draw the play button circle background
    ctx.beginPath();
    ctx.arc(centerX, centerY, radius, 0, 2 * Math.PI, false);
    ctx.fillStyle = 'rgba(255, 255, 255, 0.9)';
    ctx.fill();
    ctx.lineWidth = radius * 0.08;
    ctx.strokeStyle = '#ffffff';
    ctx.stroke();

    // Draw the play button triangle
    ctx.beginPath();
    const triangleSide = radius * 0.8;
    ctx.moveTo(centerX - triangleSide / 2.2, centerY - triangleSide / 1.15);
    ctx.lineTo(centerX + triangleSide / 1.1, centerY);
    ctx.lineTo(centerX - triangleSide / 2.2, centerY + triangleSide / 1.15);
    ctx.closePath();
    ctx.fillStyle = '#222222';
    ctx.fill();

    // Add a text prompt below the play button
    const fontSize = Math.max(16, radius * 0.4);
    ctx.font = `bold ${fontSize}px sans-serif`;
    ctx.fillStyle = '#ffffff';
    ctx.textAlign = 'center';
    ctx.fillText("Click to Play Laugh", centerX, centerY + radius + fontSize * 1.5);

    // Change mouse cursor to indicate it's clickable
    canvas.style.cursor = 'pointer';

    // Add interaction to play the laugh sound using the built-in SpeechSynthesis Web API
    canvas.addEventListener('click', () => {
        if ('speechSynthesis' in window) {
            // Cancel any ongoing speech so it doesn't overlap indefinitely
            window.speechSynthesis.cancel();
            
            const utterance = new SpeechSynthesisUtterance(laughText);
            
            // Set params
            utterance.lang = lang; 
            utterance.pitch = parseFloat(pitch);
            utterance.rate = parseFloat(rate);
            
            // Play the laugh
            window.speechSynthesis.speak(utterance);
        } else {
            console.warn("SpeechSynthesis API is not supported in this browser.");
        }
    });

    return canvas;
}

Free Image Tool Creator

Can't find the image tool you're looking for?
Create one based on your own needs now!

Description

The Sound Laugh Player is an interactive tool that transforms a static image into a clickable media element that plays a synthesized laugh sound. By overlaying a play button and user interface elements onto your uploaded image, it creates an engaging, interactive experience. This tool can be used for creating humorous memes, interactive digital greeting cards, or adding playful elements to social media content and presentations.

Leave a Reply

Your email address will not be published. Required fields are marked *