langgenius / langgenius/dify

[Refactor/Chore] Replace lamejs MP3 encoding with Mediabunny

Open
#38,172 0 comments 1 reaction 1 assignee Claimed by @hyoban View on GitHub
refactor web
Dominant language
TypeScript
Stars
156k
Forks
24.6k
Avg merge
22h 9m
Merged PRs (30d)
610

Description

## Self Checks

- [x] I have read the [Contributing Guide](https://github.com/langgenius/dify/blob/main/CONTRIBUTING.md) and [Language Policy](https://github.com/langgenius/dify/issues/1542).
- [x] This is only for refactors or chores; if you would like to ask a question, please head to [Discussions](https://github.com/langgenius/dify/discussions/categories/general).
- [x] I have searched for existing issues [search for existing issues](https://github.com/langgenius/dify/issues), including closed ones.
- [x] I confirm that I am using English to submit this report, otherwise it will be closed.
- [x] 【中文用户 & Non English User】请使用英语提交,否则会被关闭 :)
- [x] Please do not modify this template :) and fill in all the required fields.

## Description

Replace the web voice input MP3 conversion dependency from `lamejs` to Mediabunny and `@mediabunny/mp3-encoder`. The voice input flow should continue to convert recorder PCM data into an `audio/mp3` Blob before uploading it for speech-to-text.

## Motivation

`lamejs` requires local type declarations and deep imports to work around runtime/global issues. Mediabunny provides a maintained MP3 encoder extension with a public API for encoding raw audio samples, which should make the voice input conversion path easier to maintain.

## Additional Context

This affects the frontend voice input utility and its tests only. The intended behavior is functionally equivalent: record PCM audio, encode MP3 at 128 kbps, and upload the resulting MP3 file.

Contributor guide

Open the contributing guide

Assessment

This issue has not been assessed yet.

Get new issues in your inbox

A short digest of beginner-friendly GitHub issues.