Skip to content

Combining audio nodes (wet/dry convolver) outputs glitchy audio #1000

@plasticrake

Description

@plasticrake

Description

My first Expo/RN project so please forgive me if missing something simple here.

I'm trying to implement reverb with wet/dry mix like below:

Routing: source →\-→             dryGain → destination
                  \→ convolver → wetGain → destination

By themselves, the dry and wet routes sound fine (if I comment out the other). But if I have them both together the audio sounds very glitchy and the playback runs fast. I ran a similar setup using Web Audio (not using RN) in browser and it worked fine.

I extracted out a simple example to github as requested (can you even run things from a snack that use react-native-audio-api?) I'm using the same reverb code from the pedal example. But I had tried my own reverb version and even a worklet version and they all had similar issues.

Here is the key part of the code:

	sourceRef.current
		.connect(dryGainRef.current)
		.connect(audioContext.destination);

	sourceRef.current
		.connect(convolverNodeRef.current)
		.connect(wetGainRef.current)
		.connect(audioContext.destination);

Am I missing something or is this a bug?

I've tested on iOS/Android simulator and an Android device.

Steps to reproduce

  1. Clone repo
  2. npm install
  3. expo run
  4. Open app
  5. Audio will auto play and sound horrible!
  6. Feel free to use the slider to add reverb to the horrible noises!

Snack or a link to a repository

https://github.com/plasticrake/reverb-dry-wet-test

React Native Audio API version

0.11.7

React Native version

0.83.2

Platforms

iOS, Android

JavaScript runtime

Hermes

Workflow

Expo Go

Architecture

Paper (Old Architecture)

Build type

None

Device

iOS simulator

Device model

No response

Acknowledgements

Yes

Metadata

Metadata

Assignees

No one assigned

    Labels

    bugSomething isn't working

    Type

    No type

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions