I am trying to build an app using React-Native that will record a sound on a mobile device, using expo-av, and send it to a Flask API.
The problem is that the data I receive from expo-av, into the API, is in an unexpected format. I would like to retrieve the signal/wave data of the sound but when I plot the data to inspect it I get plot-A below, instead of something more like plot-B.
This resource was very useful and contains a fully reproducible example: https://www.tderflinger.com/en/react-native-audio-recording-flask
How can I retrieve in Python (flask) the sample's data that would could help me produce a plot like these? And what does plot-A represent?
plot-A:
plot-B
Python code for plot-A:
import numpy as np
import matplotlib.pyplot as plt
# This is a preview of the data from expo-av
# I made the flask api print(request.get_data()) and copied it from the terminal
string = b'\x00\x00\x00\x18ftyp3gp4\x00\x00\ ... x00\x00\x00('
# binary to np array
data = np.frombuffer(string, dtype=np.uint8)
plt.plot(data)
plt.show()
Thank you