2

I need to incorporate REVERSED audio in my react native app.

I'm working with Expo Audio's example app for reference https://github.com/expo/audio-recording-example

The audio does not need to be stored-long term nor needs a slider.

I've tried to see if changing the rate from 1.0 to -1.0 would work but it seems it can only be positive (1.0 - 32.0). I'm not sure if there's a way I can access that temporary recorded file and create a new audio file by manipulating an array?

What is the best way to go about this?

marjt1
  • 21
  • 1

1 Answers1

2

I've had a look around for react native packages with this functionality. There isn't one. I would suggest either uploading the file to a serverless function (e.g. Google Cloud Function or Firebase Function or AWS Lambda) that processes the sound.

Alternatively, you could write native code for iOS and Android and call it from react native. Here is another SO question/answer about that. But being on Expo rather than the normal React Native would potentially make that more difficult.

In both native code and serverless approaches, you can process the sound as according to the top answer: creating a new WAV file, copying the headers in the file, but reversing the body of the file.

Reversing a file is not a widely used/ requested functionality, so libraries have not been made flexible enough for your idea.

Ben Butterworth
  • 22,056
  • 10
  • 114
  • 167