{"id":43778,"date":"2026-03-15T12:25:27","date_gmt":"2026-03-15T12:25:27","guid":{"rendered":"https:\/\/imictest.com\/?page_id=43778"},"modified":"2026-03-21T14:47:15","modified_gmt":"2026-03-21T14:47:15","slug":"microphone-test","status":"publish","type":"page","link":"https:\/\/imictest.com\/?page_id=43778&lang=hi","title":{"rendered":"Microphone Test"},"content":{"rendered":"\n<div class=\"mic-test-wrapper\">\n\n<!-- Microphone Selector & Controls -->\n<div class=\"mic-controls\">\n    <select id=\"microphoneSelect\" class=\"mic-selector\"><\/select>\n    <button id=\"startTest\" class=\"test-btn\">Start Test<\/button>\n    <button id=\"stopTest\" class=\"test-btn\" style=\"display:none;\">Stop Test<\/button>\n<\/div>\n\n<!-- Volume Visualizer -->\n<div class=\"visualizer-container\">\n    <canvas id=\"volumeVisualizer\" width=\"800\" height=\"150\"><\/canvas>\n    <div id=\"decibelMeter\" class=\"decibel-display\">0 dB<\/div>\n<\/div>\n\n<!-- Recording Controls -->\n<div class=\"recording-controls\">\n    <button id=\"recordBtn\" class=\"rec-btn\" disabled>Record<\/button>\n    <button id=\"stopRecBtn\" class=\"rec-btn\" style=\"display:none;\">Stop Recording<\/button>\n    <button id=\"playRecBtn\" class=\"rec-btn\" style=\"display:none;\" disabled>Play Recording<\/button>\n    <span id=\"recordTime\" class=\"record-time\">00:00<\/span>\n<\/div>\n\n<!-- Microphone Information Grid -->\n<div class=\"mic-info-grid\">\n    <div class=\"info-card\">\n        <div class=\"info-label\">Status<\/div>\n        <div id=\"status\" class=\"info-value\">Not started<\/div>\n    <\/div>\n    <div class=\"info-card\">\n        <div class=\"info-label\">Microphone Name<\/div>\n        <div id=\"microphoneName\" class=\"info-value\">Not selected<\/div>\n    <\/div>\n    <div class=\"info-card\">\n        <div class=\"info-label\">Sample Rate<\/div>\n        <div id=\"sampleRate\" class=\"info-value\">\u2014<\/div>\n    <\/div>\n    <div class=\"info-card\">\n        <div class=\"info-label\">Audio Channels<\/div>\n        <div id=\"channels\" class=\"info-value\">\u2014<\/div>\n    <\/div>\n    <div class=\"info-card\">\n        <div class=\"info-label\">Latency<\/div>\n        <div id=\"latency\" class=\"info-value\">\u2014<\/div>\n    <\/div>\n    <div class=\"info-card\">\n        <div class=\"info-label\">Noise Level<\/div>\n        <div id=\"noiseLevel\" class=\"info-value\">\u2014<\/div>\n    <\/div>\n<\/div>\n\n<!-- Frequency Analyzer -->\n<div class=\"frequency-analyzer\">\n    <h3>Frequency Analyzer<\/h3>\n    <canvas id=\"frequencyCanvas\" width=\"800\" height=\"200\"><\/canvas>\n<\/div>\n\n<\/div>\n\n<style>\n.mic-test-wrapper {\n    max-width: 1000px;\n    margin: 0 auto;\n    padding: 20px;\n}\n\n.mic-controls {\n    display: flex;\n    gap: 15px;\n    margin-bottom: 30px;\n    flex-wrap: wrap;\n}\n\n.mic-selector {\n    flex: 1;\n    min-width: 200px;\n    padding: 12px 16px;\n    border: 1px solid rgba(26, 26, 26, 0.15);\n    border-radius: 8px;\n    font-size: 1rem;\n    background: white;\n}\n\n.test-btn, .rec-btn {\n    padding: 12px 28px;\n    border-radius: 50px;\n    border: none;\n    font-weight: 600;\n    cursor: pointer;\n    transition: all 0.3s ease;\n    text-transform: uppercase;\n    letter-spacing: 1px;\n    font-size: 0.85rem;\n}\n\n.test-btn {\n    background: #6bdd9a;\n    color: #1a1a1a;\n}\n\n.test-btn:hover {\n    background: #5acc88;\n    transform: translateY(-2px);\n    box-shadow: 0 4px 12px rgba(107, 221, 154, 0.3);\n}\n\n.rec-btn {\n    background: #c445ed;\n    color: white;\n}\n\n.rec-btn:hover:not(:disabled) {\n    background: #b33ddc;\n    transform: translateY(-2px);\n}\n\n.rec-btn:disabled {\n    opacity: 0.5;\n    cursor: not-allowed;\n}\n\n.visualizer-container {\n    background: white;\n    border-radius: 16px;\n    padding: 30px;\n    margin-bottom: 25px;\n    box-shadow: 0 2px 12px rgba(26, 26, 26, 0.06);\n    position: relative;\n}\n\n#volumeVisualizer {\n    width: 100%;\n    height: 150px;\n    border-radius: 8px;\n}\n\n.decibel-display {\n    position: absolute;\n    top: 20px;\n    right: 30px;\n    background: #6bdd9a;\n    color: #1a1a1a;\n    padding: 8px 20px;\n    border-radius: 50px;\n    font-weight: 700;\n    font-size: 1.1rem;\n    box-shadow: 0 2px 8px rgba(107, 221, 154, 0.3);\n}\n\n.recording-controls {\n    display: flex;\n    gap: 15px;\n    align-items: center;\n    margin-bottom: 30px;\n    flex-wrap: wrap;\n}\n\n.record-time {\n    font-size: 1.2rem;\n    font-weight: 600;\n    font-family: 'Courier New', monospace;\n    color: #c445ed;\n}\n\n.mic-info-grid {\n    display: grid;\n    grid-template-columns: repeat(auto-fit, minmax(250px, 1fr));\n    gap: 20px;\n    margin-bottom: 30px;\n}\n\n.info-card {\n    background: white;\n    border-radius: 12px;\n    padding: 20px;\n    box-shadow: 0 2px 8px rgba(26, 26, 26, 0.06);\n    transition: transform 0.2s ease, box-shadow 0.2s ease;\n}\n\n.info-card:hover {\n    transform: translateY(-2px);\n    box-shadow: 0 4px 16px rgba(26, 26, 26, 0.1);\n}\n\n.info-label {\n    font-size: 0.85rem;\n    color: rgba(26, 26, 26, 0.6);\n    text-transform: uppercase;\n    letter-spacing: 1px;\n    margin-bottom: 8px;\n    font-weight: 600;\n}\n\n.info-value {\n    font-size: 1.15rem;\n    color: #1a1a1a;\n    font-weight: 600;\n}\n\n.frequency-analyzer {\n    background: white;\n    border-radius: 16px;\n    padding: 30px;\n    box-shadow: 0 2px 12px rgba(26, 26, 26, 0.06);\n}\n\n.frequency-analyzer h3 {\n    margin: 0 0 20px 0;\n    font-size: 1.3rem;\n}\n\n#frequencyCanvas {\n    width: 100%;\n    height: 200px;\n    border-radius: 8px;\n}\n\n\/* Responsive Design *\/\n@media (max-width: 768px) {\n    .mic-controls {\n        flex-direction: column;\n    }\n    \n    .mic-selector {\n        width: 100%;\n    }\n    \n    .mic-info-grid {\n        grid-template-columns: 1fr;\n    }\n    \n    #volumeVisualizer, #frequencyCanvas {\n        height: 120px;\n    }\n    \n    .decibel-display {\n        position: static;\n        display: inline-block;\n        margin-top: 15px;\n    }\n}\n<\/style>\n\n<script>\n(function() {\n    let audioContext, analyser, microphone, dataArray, bufferLength;\n    let animationId;\n    let mediaRecorder, recordedChunks = [];\n    let recordingInterval;\n    let recordingStartTime;\n    \n    const micSelect = document.getElementById('microphoneSelect');\n    const startBtn = document.getElementById('startTest');\n    const stopBtn = document.getElementById('stopTest');\n    const recordBtn = document.getElementById('recordBtn');\n    const stopRecBtn = document.getElementById('stopRecBtn');\n    const playRecBtn = document.getElementById('playRecBtn');\n    const volumeCanvas = document.getElementById('volumeVisualizer');\n    const freqCanvas = document.getElementById('frequencyCanvas');\n    const decibelMeter = document.getElementById('decibelMeter');\n    const recordTime = document.getElementById('recordTime');\n    \n    \/\/ Get available microphones\n    async function getMicrophones() {\n        try {\n            const devices = await navigator.mediaDevices.enumerateDevices();\n            const audioInputs = devices.filter(device => device.kind === 'audioinput');\n            \n            micSelect.innerHTML = '';\n            audioInputs.forEach((device, index) => {\n                const option = document.createElement('option');\n                option.value = device.deviceId;\n                option.text = device.label || `Microphone ${index + 1}`;\n                micSelect.appendChild(option);\n            });\n        } catch (error) {\n            console.error('Error getting microphones:', error);\n        }\n    }\n    \n    \/\/ Start microphone test\n    async function startTest() {\n        try {\n            const constraints = {\n                audio: {\n                    deviceId: micSelect.value ? { exact: micSelect.value } : undefined\n                }\n            };\n            \n            const stream = await navigator.mediaDevices.getUserMedia(constraints);\n            \n            audioContext = new (window.AudioContext || window.webkitAudioContext)();\n            analyser = audioContext.createAnalyser();\n            microphone = audioContext.createMediaStreamSource(stream);\n            \n            analyser.fftSize = 2048;\n            bufferLength = analyser.frequencyBinCount;\n            dataArray = new Uint8Array(bufferLength);\n            \n            microphone.connect(analyser);\n            \n            \/\/ Update UI\n            document.getElementById('status').textContent = 'Active';\n            document.getElementById('microphoneName').textContent = micSelect.options[micSelect.selectedIndex].text;\n            document.getElementById('sampleRate').textContent = audioContext.sampleRate + ' Hz';\n            document.getElementById('channels').textContent = stream.getAudioTracks()[0].getSettings().channelCount || 1;\n            document.getElementById('latency').textContent = (audioContext.baseLatency * 1000).toFixed(2) + ' ms';\n            \n            startBtn.style.display = 'none';\n            stopBtn.style.display = 'inline-block';\n            recordBtn.disabled = false;\n            \n            \/\/ Setup media recorder\n            mediaRecorder = new MediaRecorder(stream);\n            mediaRecorder.ondataavailable = e => recordedChunks.push(e.data);\n            mediaRecorder.onstop = handleRecordingStop;\n            \n            visualize();\n        } catch (error) {\n            console.error('Error starting test:', error);\n            alert('Could not access microphone. Please ensure you have granted permission.');\n        }\n    }\n    \n    \/\/ Stop test\n    function stopTest() {\n        if (animationId) cancelAnimationFrame(animationId);\n        if (audioContext) audioContext.close();\n        if (microphone) microphone.disconnect();\n        \n        document.getElementById('status').textContent = 'Stopped';\n        startBtn.style.display = 'inline-block';\n        stopBtn.style.display = 'none';\n        recordBtn.disabled = true;\n        \n        \/\/ Clear canvases\n        const vCtx = volumeCanvas.getContext('2d');\n        const fCtx = freqCanvas.getContext('2d');\n        vCtx.clearRect(0, 0, volumeCanvas.width, volumeCanvas.height);\n        fCtx.clearRect(0, 0, freqCanvas.width, freqCanvas.height);\n    }\n    \n    \/\/ Visualize audio\n    function visualize() {\n        const vCtx = volumeCanvas.getContext('2d');\n        const fCtx = freqCanvas.getContext('2d');\n        \n        function draw() {\n            animationId = requestAnimationFrame(draw);\n            \n            analyser.getByteTimeDomainData(dataArray);\n            \n            \/\/ Volume visualizer\n            vCtx.fillStyle = '#f5f0eb';\n            vCtx.fillRect(0, 0, volumeCanvas.width, volumeCanvas.height);\n            vCtx.lineWidth = 3;\n            vCtx.strokeStyle = '#6bdd9a';\n            vCtx.beginPath();\n            \n            const sliceWidth = volumeCanvas.width \/ bufferLength;\n            let x = 0;\n            \n            for (let i = 0; i < bufferLength; i++) {\n                const v = dataArray[i] \/ 128.0;\n                const y = v * volumeCanvas.height \/ 2;\n                \n                if (i === 0) {\n                    vCtx.moveTo(x, y);\n                } else {\n                    vCtx.lineTo(x, y);\n                }\n                \n                x += sliceWidth;\n            }\n            \n            vCtx.stroke();\n            \n            \/\/ Calculate decibels\n            const sum = dataArray.reduce((a, b) => a + Math.abs(b - 128), 0);\n            const average = sum \/ bufferLength;\n            const db = 20 * Math.log10(average \/ 128);\n            const displayDb = Math.max(-60, Math.min(0, db));\n            decibelMeter.textContent = displayDb.toFixed(1) + ' dB';\n            \n            \/\/ Noise level\n            if (average < 5) {\n                document.getElementById('noiseLevel').textContent = 'Very Low';\n            } else if (average < 15) {\n                document.getElementById('noiseLevel').textContent = 'Low';\n            } else if (average < 30) {\n                document.getElementById('noiseLevel').textContent = 'Medium';\n            } else {\n                document.getElementById('noiseLevel').textContent = 'High';\n            }\n            \n            \/\/ Frequency analyzer\n            analyser.getByteFrequencyData(dataArray);\n            fCtx.fillStyle = '#f5f0eb';\n            fCtx.fillRect(0, 0, freqCanvas.width, freqCanvas.height);\n            \n            const barWidth = (freqCanvas.width \/ bufferLength) * 2.5;\n            let barHeight;\n            x = 0;\n            \n            for (let i = 0; i < bufferLength; i++) {\n                barHeight = (dataArray[i] \/ 255) * freqCanvas.height;\n                \n                const hue = (i \/ bufferLength) * 120;\n                fCtx.fillStyle = `hsl(${hue + 150}, 70%, 60%)`;\n                fCtx.fillRect(x, freqCanvas.height - barHeight, barWidth, barHeight);\n                \n                x += barWidth + 1;\n            }\n        }\n        \n        draw();\n    }\n    \n    \/\/ Recording functions\n    function startRecording() {\n        recordedChunks = [];\n        mediaRecorder.start();\n        recordBtn.style.display = 'none';\n        stopRecBtn.style.display = 'inline-block';\n        \n        recordingStartTime = Date.now();\n        recordingInterval = setInterval(updateRecordingTime, 100);\n    }\n    \n    function stopRecording() {\n        mediaRecorder.stop();\n        stopRecBtn.style.display = 'none';\n        recordBtn.style.display = 'inline-block';\n        clearInterval(recordingInterval);\n    }\n    \n    function updateRecordingTime() {\n        const elapsed = Date.now() - recordingStartTime;\n        const minutes = Math.floor(elapsed \/ 60000);\n        const seconds = Math.floor((elapsed % 60000) \/ 1000);\n        recordTime.textContent = `${minutes.toString().padStart(2, '0')}:${seconds.toString().padStart(2, '0')}`;\n    }\n    \n    function handleRecordingStop() {\n        const blob = new Blob(recordedChunks, { type: 'audio\/webm' });\n        playRecBtn.disabled = false;\n        playRecBtn.onclick = () => {\n            const audio = new Audio(URL.createObjectURL(blob));\n            audio.play();\n        };\n    }\n    \n    \/\/ Event listeners\n    startBtn.addEventListener('click', startTest);\n    stopBtn.addEventListener('click', stopTest);\n    recordBtn.addEventListener('click', startRecording);\n    stopRecBtn.addEventListener('click', stopRecording);\n    \n    \/\/ Initialize\n    getMicrophones();\n    \n})();\n<\/script>\n\n\n\n<div class=\"wp-block-columns is-layout-flex wp-container-core-columns-is-layout-8f761849 wp-block-columns-is-layout-flex\">\n<div class=\"wp-block-column is-layout-flow wp-block-column-is-layout-flow\" style=\"flex-basis:100%\">\n<div class=\"wp-block-columns is-layout-flex wp-container-core-columns-is-layout-8f761849 wp-block-columns-is-layout-flex\">\n<div class=\"wp-block-column is-layout-flow wp-block-column-is-layout-flow\" style=\"flex-basis:100%\">\n<div>\n<div class=\"wp-block-columns is-layout-flex wp-container-core-columns-is-layout-8f761849 wp-block-columns-is-layout-flex\">\n<div class=\"wp-block-column is-layout-flow wp-block-column-is-layout-flow\">\n<div>\n<figure class=\"wp-block-image size-large is-resized\"><img loading=\"lazy\" decoding=\"async\" width=\"1024\" height=\"536\" src=\"https:\/\/imictest.com\/wp-content\/uploads\/2026\/03\/Screenshot_13-discover-1024x536.webp\" alt=\"\" class=\"wp-image-43902\" style=\"aspect-ratio:1.9104605776736925;width:350px;height:auto\" srcset=\"https:\/\/imictest.com\/wp-content\/uploads\/2026\/03\/Screenshot_13-discover-1024x536.webp 1024w, https:\/\/imictest.com\/wp-content\/uploads\/2026\/03\/Screenshot_13-discover-300x157.webp 300w, https:\/\/imictest.com\/wp-content\/uploads\/2026\/03\/Screenshot_13-discover-768x402.webp 768w, https:\/\/imictest.com\/wp-content\/uploads\/2026\/03\/Screenshot_13-discover.webp 1200w\" sizes=\"auto, (max-width: 1024px) 100vw, 1024px\" \/><\/figure>\n<\/div>\n<\/div>\n\n\n\n<div class=\"wp-block-column is-layout-flow wp-block-column-is-layout-flow\">\n<figure class=\"wp-block-image size-large is-resized\"><img loading=\"lazy\" decoding=\"async\" width=\"1024\" height=\"536\" src=\"https:\/\/imictest.com\/wp-content\/uploads\/2026\/03\/Screenshot_13-discover-1024x536.webp\" alt=\"\" class=\"wp-image-43902\" style=\"aspect-ratio:1.9104605776736925;width:350px;height:auto\" srcset=\"https:\/\/imictest.com\/wp-content\/uploads\/2026\/03\/Screenshot_13-discover-1024x536.webp 1024w, https:\/\/imictest.com\/wp-content\/uploads\/2026\/03\/Screenshot_13-discover-300x157.webp 300w, https:\/\/imictest.com\/wp-content\/uploads\/2026\/03\/Screenshot_13-discover-768x402.webp 768w, https:\/\/imictest.com\/wp-content\/uploads\/2026\/03\/Screenshot_13-discover.webp 1200w\" sizes=\"auto, (max-width: 1024px) 100vw, 1024px\" \/><\/figure>\n<\/div>\n\n\n\n<div class=\"wp-block-column is-layout-flow wp-block-column-is-layout-flow\">\n<figure class=\"wp-block-image size-large is-resized\"><img loading=\"lazy\" decoding=\"async\" width=\"1024\" height=\"536\" src=\"https:\/\/imictest.com\/wp-content\/uploads\/2026\/03\/Screenshot_13-discover-1024x536.webp\" alt=\"\" class=\"wp-image-43902\" style=\"aspect-ratio:1.9104605776736925;width:350px;height:auto\" srcset=\"https:\/\/imictest.com\/wp-content\/uploads\/2026\/03\/Screenshot_13-discover-1024x536.webp 1024w, https:\/\/imictest.com\/wp-content\/uploads\/2026\/03\/Screenshot_13-discover-300x157.webp 300w, https:\/\/imictest.com\/wp-content\/uploads\/2026\/03\/Screenshot_13-discover-768x402.webp 768w, https:\/\/imictest.com\/wp-content\/uploads\/2026\/03\/Screenshot_13-discover.webp 1200w\" sizes=\"auto, (max-width: 1024px) 100vw, 1024px\" \/><\/figure>\n<\/div>\n<\/div>\n<\/div>\n<\/div>\n<\/div>\n<\/div>\n<\/div>\n","protected":false},"excerpt":{"rendered":"<p>Start Test Stop Test 0 dB Record Stop Recording Play Recording 00:00 Status Not started Microphone Name Not selected Sample Rate \u2014 Audio Channels \u2014 Latency \u2014 Noise Level \u2014 Frequency Analyzer<\/p>\n","protected":false},"author":1,"featured_media":0,"parent":0,"menu_order":0,"comment_status":"closed","ping_status":"closed","template":"","meta":{"footnotes":""},"class_list":["post-43778","page","type-page","status-publish"],"_links":{"self":[{"href":"https:\/\/imictest.com\/index.php?rest_route=\/wp\/v2\/pages\/43778","targetHints":{"allow":["GET"]}}],"collection":[{"href":"https:\/\/imictest.com\/index.php?rest_route=\/wp\/v2\/pages"}],"about":[{"href":"https:\/\/imictest.com\/index.php?rest_route=\/wp\/v2\/types\/page"}],"author":[{"embeddable":true,"href":"https:\/\/imictest.com\/index.php?rest_route=\/wp\/v2\/users\/1"}],"replies":[{"embeddable":true,"href":"https:\/\/imictest.com\/index.php?rest_route=%2Fwp%2Fv2%2Fcomments&post=43778"}],"version-history":[{"count":5,"href":"https:\/\/imictest.com\/index.php?rest_route=\/wp\/v2\/pages\/43778\/revisions"}],"predecessor-version":[{"id":43903,"href":"https:\/\/imictest.com\/index.php?rest_route=\/wp\/v2\/pages\/43778\/revisions\/43903"}],"wp:attachment":[{"href":"https:\/\/imictest.com\/index.php?rest_route=%2Fwp%2Fv2%2Fmedia&parent=43778"}],"curies":[{"name":"wp","href":"https:\/\/api.w.org\/{rel}","templated":true}]}}