-
Notifications
You must be signed in to change notification settings - Fork 167
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Add audio analyser util function #515
Conversation
🦋 Changeset detectedLatest commit: 361a891 The changes in this PR will be included in the next version bump. This PR includes changesets to release 1 package
Not sure what this means? Click here to learn what changesets are. Click here if you're a maintainer who wants to add another changeset to this PR |
example/sample.ts
Outdated
const { calculateVolume } = createAudioAnalyser(track); | ||
|
||
setInterval(() => { | ||
console.log(calculateVolume()); |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
nit: this would seem pretty noisy in the console. maybe less frequently or as a bonus, hooking it up to a jank meter?
* Additionally returns a convenience method `calculateVolume` to perform instant volume readings on that track. | ||
* Call the returned `cleanup` function to close the audioContext that has been created for the instance of this helper | ||
*/ | ||
export function createAudioAnalyser( |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
should we handle track attachment bug in here? i.e. log a warning if it's not yet attached.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
In my tests, the attachment didn't matter. I had a separate path for RemoteTracks initially that would have handled this case, but it turns out it also works for the analysing use case without any attachments!
* add audio analyser * convert to util function * add comment * cleanup * more comments * update import * add vu meter in example, give option to clone track when creating analyser * revert room options * changeset
* add audio analyser * convert to util function * add comment * cleanup * more comments * update import * add vu meter in example, give option to clone track when creating analyser * revert room options * changeset
* add audio analyser * convert to util function * add comment * cleanup * more comments * update import * add vu meter in example, give option to clone track when creating analyser * revert room options * changeset
No description provided.