Skip to content

Cannot use worklets with latest expo (using tabs template) #789

@marksyzm

Description

@marksyzm

Description

With 0.10.0 of react-native-audio-api, it will not currently instantiate a worklet node as it is not recognising 0.61 of react-native-worklets. 0.6.0 doesn't work either - it never seems to accept the worklets installation.

Expo (using latest 54.0.22 at this time) by default will only let me install 0.5.2 of react-native-worklets, and when I try and build on android, the worklets version validation fails.

Is there a patch for this or some other workaround? Shall I just remove the check in the C code?

Steps to reproduce

Run microphone recording environment:

const bufferSize = 1024
const sampleRate = 48000

const worklet = (audioData: Float32Array[], inputChannelCount: number) => {
  "worklet"
  console.log(audioData[1].length)
}

const recorder = new AudioRecorder({
  sampleRate,
  bufferLengthInSamples: bufferSize,
})
const audioContext = new AudioContext({ sampleRate })

const workletNode = audioContext.createWorkletNode(
  worklet,
  bufferSize,
  channelsPerFrame,
  "UIRuntime"
)
const adapterNode = audioContext.createRecorderAdapter()

adapterNode.connect(workletNode)
workletNode.connect(audioContext.destination)
recorder.connect(adapterNode)

recorder.start()

Snack or a link to a repository

https://snack.expo.dev/@marksyzm/suspicious-orange-truffles

React Native Audio API version

0.10.0

React Native version

0.81.5

Platforms

Android

JavaScript runtime

Hermes

Workflow

Expo Dev Client

Architecture

Fabric (New Architecture)

Build type

Debug app & dev bundle

Device

Real device

Device model

Pixel 3A XL

Acknowledgements

Yes

Metadata

Metadata

Assignees

No one assigned

    Labels

    No labels
    No labels

    Type

    No type

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions