openframeworks / openframeworks/openFrameworks

How to use Emscriptens audioProcess function for audioWorklets with ofSoundstreams buffer?

Open
#7,260 1 comment 0 reactions 0 assignees View on GitHub

Nobody has claimed this yet.

emscripten
Dominant language
C++
Stars
10.4k
Forks
2.6k
Avg merge
1d 21h
Merged PRs (30d)
9

Description

Right now I need to make some changes to Emscriptens audioWorklet branch, because I process the audio on the JS side, while the audioWorklet branch expects the audio to be processed on the c++ side.
This is a simple Emscripten audioWorklet test / example: https://github.com/juj/emscripten/blob/audio_worklets/test/webaudio/tone_generator.c
And this is how I implemented it:
https://github.com/Jonathhhan/openFrameworks/blob/emscripten_3.1.9_audioWorklet/addons/ofxEmscripten/src/ofxEmscriptenSoundStream.cpp
https://github.com/Jonathhhan/openFrameworks/blob/emscripten_3.1.9_audioWorklet/addons/ofxEmscripten/libs/html5audio/lib/emscripten/audio_worklet.js
It would be nice to change the implementation in a way, that it runs without any modifications of the Emscripten source code.

Contributor guide

Open the contributing guide

First steps

  1. Read the whole issue, then the project's contributing guide.
  2. Comment on the issue to say you are picking it up — it saves two people doing the same work.
  3. Fork the repository and make your change on a branch.
  4. Open a pull request that references the issue number.

Research direction

Compare the Emscripten tone_generator.c example with addons/ofxEmscripten/src/ofxEmscriptenSoundStream.cpp and addons/ofxEmscripten/libs/html5audio/lib/emscripten/audio_worklet.js. Determine how audio processing should be shared between JavaScript and C++ for ofSoundStream buffers, then verify the implementation works without modifying Emscripten source.

Written by the indexing model from the issue text.

Assessment

Tech stack
cpp, javascript, wasm
Domain
audio-video-rtc
Issue type
Feature
Difficulty
4/5
Estimated time
3-5 days
Activity status
Stale
Clarity
Needs clarification
Newbie friendliness
25/100

Get new issues in your inbox

A short digest of beginner-friendly GitHub issues.