{"id":13768578,"url":"https://github.com/DIDAVA/eAudio","last_synced_at":"2025-05-10T23:31:24.927Z","repository":{"id":172861116,"uuid":"226724376","full_name":"DIDAVA/eAudio","owner":"DIDAVA","description":"Extended HTML Audio Object","archived":false,"fork":false,"pushed_at":"2020-04-27T06:51:32.000Z","size":34,"stargazers_count":4,"open_issues_count":0,"forks_count":2,"subscribers_count":1,"default_branch":"master","last_synced_at":"2024-11-17T03:31:46.142Z","etag":null,"topics":["analyser","analyzer","audio","audio-analysis","audio-api","audio-applications","audio-effect","audio-library","audio-object","audio-player","audio-processing","audio-visualizer","equalizer","fade-in","fade-out","fadein","fadeout","html5","javascript","visualization"],"latest_commit_sha":null,"homepage":"","language":"JavaScript","has_issues":true,"has_wiki":null,"has_pages":null,"mirror_url":null,"source_name":null,"license":"mit","status":null,"scm":"git","pull_requests_enabled":true,"icon_url":"https://github.com/DIDAVA.png","metadata":{"files":{"readme":"README.md","changelog":null,"contributing":null,"funding":null,"license":"LICENSE","code_of_conduct":null,"threat_model":null,"audit":null,"citation":null,"codeowners":null,"security":null,"support":null,"governance":null,"roadmap":null,"authors":null}},"created_at":"2019-12-08T20:05:55.000Z","updated_at":"2024-01-24T20:47:14.000Z","dependencies_parsed_at":"2024-01-07T19:04:26.884Z","dependency_job_id":null,"html_url":"https://github.com/DIDAVA/eAudio","commit_stats":null,"previous_names":["didava/eaudio"],"tags_count":0,"template":false,"template_full_name":null,"repository_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/DIDAVA%2FeAudio","tags_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/DIDAVA%2FeAudio/tags","releases_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/DIDAVA%2FeAudio/releases","manifests_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/DIDAVA%2FeAudio/manifests","owner_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/owners/DIDAVA","download_url":"https://codeload.github.com/DIDAVA/eAudio/tar.gz/refs/heads/master","host":{"name":"GitHub","url":"https://github.com","kind":"github","repositories_count":253497296,"owners_count":21917683,"icon_url":"https://github.com/github.png","version":null,"created_at":"2022-05-30T11:31:42.601Z","updated_at":"2022-07-04T15:15:14.044Z","host_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub","repositories_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories","repository_names_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repository_names","owners_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/owners"}},"keywords":["analyser","analyzer","audio","audio-analysis","audio-api","audio-applications","audio-effect","audio-library","audio-object","audio-player","audio-processing","audio-visualizer","equalizer","fade-in","fade-out","fadein","fadeout","html5","javascript","visualization"],"created_at":"2024-08-03T16:01:23.066Z","updated_at":"2025-05-10T23:31:24.641Z","avatar_url":"https://github.com/DIDAVA.png","language":"JavaScript","readme":"# eAudio\n**Extended HTML Audio Object**\n\nThis project is supposed to keep standard html audio object and add missing features to it with the help of `Web Audio API`.\n`AudioContext` is not supported in some old browsers such as `Microsoft Internet Explorer`. Please try this object with the latest modern browsers like `Chrome`, `Firefox` and `Safari`.\n\n## Features\n* 10 Band Equalizer\n* FadeIn / FadeOut\n* Audio Analyser\n* PlayToggle\n* Formatted Time\n* Preset\n\n## Basic Setup\n`eAudio` setup and functionality is the same as standard html audio object: \n```html\n\u003cdiv id=\"container\"\u003e\u003c/div\u003e\n\u003cscript src=\"js/eAudio.js\"\u003e\u003c/script\u003e\n\u003cscript\u003e\n  const audio = new eAudio('your_audio_file.mp3');\n  audio.controls = true;\n  document.querySelector('container').appendChild(audio);\n\u003c/script\u003e\n```\nFor more details review the [basic example](https://github.com/DIDAVA/eAudio/blob/master/examples/basic.html).\n\n## EQ\n`eAudio` comes with 10 band equalizer. The frequency bands are adjusted on standard harmonic octaves (`31Hz`, `63Hz`, `125Hz`, `250Hz`, `500Hz`, `1kHz`, `2kHz`, `4kHz`, `8kHz`, `16kHz`). The gain for each band is limited between `+6db` and `-24db` to prevent output distortion and band converage. The default gain value for each band is `0`.\n```javascript\naudio.q31 = 0;\naudio.q63 = 0;\naudio.q125 = 0;\naudio.q250 = 0;\naudio.q500 = 0;\naudio.q1000 = 0;\naudio.q2000 = 0;\naudio.q4000 = 0;\naudio.q8000 = 0;\naudio.q16000 = 0;\n```\nFor more details review the [equalizer example](https://github.com/DIDAVA/eAudio/blob/master/examples/equalizer.html).\n\n## FadeIn / FadeOut\nBoth fadein and fadeout are separated methods on the `eAudio` object. The fading time can be passed as an argument to the fader methods. If no argument is passed they will use their default value which is `3 seconds`. Please be informed that faders do not have callbacks and will not affect play and pause methods on audio object.\n```javascript\naudio.fadein(); // 3 seconds by default\naudio.fadein(10); // 10 seconds\naudio.fadeout(); // 3 seconds by default\naudio.fadeout(10); // 10 seconds\n```\n\n## Analyser\n`eAudio` supports two kind of analysers (`Frequency Analyse` and `Domain Analyse`). The output of the analyser is an array of numeric values between `0` and `256`. Analyser is customizable by two properties. `specLines` sets the number of output lines and `specSmooth` adjusts the smoothnes of the output lines. The analyser's output array is catchable during the time from two properties `specFreq` and `specDomain`.\n\n#### specLines\nAdjusts the resolution of analyser or in other words sets the output array length. You can set or get the length of the output array. Acceptable values are `16`,`32`,`64`,`128`,`256`,`512` and `1024`. The defaul value is `256`. \n```javascript\nconst currentLines = audio.specLines; // Gets the current lines count\naudio.specLines = 256; // Sets the output length to 256\n```\n\n#### specSmooth\nSets or gets the smoothness of the analyser output. The value must between `0` and `1`. The default value is `0.75`.\n```javascript\nconst smoothness = audio.specSmooth; // Gets the current smoothness\naudio.specSmooth = 0.75; // Sets the smoothness to 0.75\n```\n\n#### specFreq\nReturns the frequency analysis array for the current moment. Each item in the array is an integer between `0` and `256`.\n```javascript\nconst currentAnalysis = audio.specFreq; // Gets an array of integers for current moment\n```\nFor more information and usage see the [spectrum example](https://github.com/DIDAVA/eAudio/blob/master/examples/freqspectrum.html).\n\n#### specDomain\nReturns the domain analysis array for the current moment. Each item in the array is an integer between `0` and `256`.\n```javascript\nconst currentAnalysis = audio.specDomain; // Gets an array of integers for current moment\n```\nFor more information and usage see the [domain example](https://github.com/DIDAVA/eAudio/blob/master/examples/freqdomain.html).\n\n## PlayToggle\nYou can play/pause audio more easily by playToggle property:\n```javascript\naudio.playToggle = true; // Plays the audio\naudio.playToggle = false; // Pauses the audio\n\n// Toggle playback by clicking a button\ndocument.querySelector('button').addEventListener('click', e =\u003e {\n  audio.playToggle = !audio.playToggle; // Toggles play/pause\n});\n```\n\n## Formatted Time\nThis property stringifies the current audio time to `hh:mm:ss` format.\n```html\n\u003cdiv id=\"timer\"\u003e00:00:00\u003c/div\u003e\n\u003cscript\u003e\nconst timer = document.querySelector('#timer');\nsetInterval( () =\u003e {\n  timer.innerText = audio.formattedTime;\n}, 1000);\n\u003c/script\u003e\n```\n\n## Preset\nThis property can set or get the current `source`, `equalizer` and `volume` settings as an json string. It is useful to save your current settings to database or file and simply set all the settings very fast.\n```javascript\nconst currentSettings = audio.preset; // Get the json settings string\n\naudio.preset = currentSettings; // Set the settings back\n```","funding_links":[],"categories":["Sound editing"],"sub_categories":["Sound equalizers"],"project_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2FDIDAVA%2FeAudio","html_url":"https://awesome.ecosyste.ms/projects/github.com%2FDIDAVA%2FeAudio","lists_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2FDIDAVA%2FeAudio/lists"}