Skip to content

record audio node support#4289

Merged
christian-byrne merged 10 commits intomainfrom
uploadAudio
Jul 24, 2025
Merged

record audio node support#4289
christian-byrne merged 10 commits intomainfrom
uploadAudio

Conversation

@jtydhr88
Copy link
Collaborator

@jtydhr88 jtydhr88 commented Jun 28, 2025

Bounty task - audio input node, requested in https://www.notion.so/drip-art/Audio-input-node-1706d73d365080eeb8e5e39790584dff?source=copy_link
Need BE change here Comfy-Org/ComfyUI#8716

Please notice I introdcued two new dependencies to support record audio:

  1. extendable-media-recorder https://www.npmjs.com/package/extendable-media-recorder
  2. extendable-media-recorder-wav-encoder https://www.npmjs.com/package/extendable-media-recorder-wav-encoder

the reason of why I need this two is, as practised, the native browser MediaRecorder API has significant limitations for our use case:

  1. Format Incompatibility: Chrome produces WebM format, Firefox produces OGG format, even when requesting audio/wav
  2. Backend Processing Issues: The generated files cannot be properly read by torchaudio.load() in our Python backend
  3. Cross-browser Inconsistency: Different browsers generate different audio formats, causing compatibility issues

so we need to use this extendable-media-recorder could allow us record WAV directly.

┆Issue is synchronized with this Notion page by Unito

Copy link
Contributor

@christian-byrne christian-byrne left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Could you add a unit test and demo recording if possible?

@jtydhr88
Copy link
Collaborator Author

Copy link
Contributor

@christian-byrne christian-byrne left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Great work on overall!

Left some comments that need to be addressed before merging, primarily around resource management and cleanup.

christian-byrne

This comment was marked as duplicate.

@christian-byrne
Copy link
Contributor

christian-byrne commented Jul 2, 2025

For anyone else: To test this feature, you need to do this in ComfyUI folder:

git remote add jtydhr88 https://github.com/jtydhr88/ComfyUI.git
git fetch jtydhr88
git checkout -b record-audio-node jtydhr88/record-audio-node

Copy link
Contributor

@christian-byrne christian-byrne left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Nice, this looks ready to merge. The only two minor things I would say are:

  1. Is it possible to replace timeout with hard-coded 500ms with somthing that resolves on mediaRecorder.onStop (or similar)?
  2. Could we remove the console.logs?

@jtydhr88
Copy link
Collaborator Author

@christian-byrne fixed your feedback, please double check

@jtydhr88
Copy link
Collaborator Author

there is one failed test about locale, likely not caused by this change

@github-actions
Copy link

github-actions bot commented Jul 19, 2025

⚠️ Warnings

⚠️ Warning: E2E Test Coverage Missing

If this PR modifies behavior that can be covered by browser-based E2E tests, those tests are required. PRs lacking applicable test coverage may not be reviewed until added. Please add or update browser tests to ensure code quality and prevent regressions.

⚠️ Warning: Visual Documentation Missing

If this PR changes user-facing behavior, visual proof (screen recording or screenshot) is required. PRs without applicable visual documentation may not be reviewed until provided.
You can add it by:

  • GitHub: Drag & drop media directly into the PR description

  • YouTube: Include a link to a short demo

@socket-security
Copy link

socket-security bot commented Jul 19, 2025

Review the following changes in direct dependencies. Learn more about Socket for GitHub.

Diff Package Supply Chain
Security
Vulnerability Quality Maintenance License
Addedextendable-media-recorder-wav-encoder@​7.0.12999100669080
Addedextendable-media-recorder@​9.2.27991009191100

View full report

@christian-byrne christian-byrne merged commit 906bc42 into main Jul 24, 2025
2 checks passed
@christian-byrne christian-byrne deleted the uploadAudio branch July 24, 2025 07:22
@christian-byrne christian-byrne mentioned this pull request Jul 24, 2025
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

3 participants