You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
As pointed out in this issue, loading audio files on Android can take quite some time. Also, piling up promises for audio extractions could considerably eat up resources.
Therefore, while waiting to fix the Android performance issue and be able to read more and more audio files piling up, it would be better to save the waveform to files and read it instead of continuously extracting it from the file.
One evident scenario is opening and scrolling multiple text conversations where we can have plenty of audio files.
This PR provides this capability: We save the extracted waveform of the audio file to the provided waveFormPath. Then, on the next load, we read the JSON data from the file instead of extracting the data live from the audio.
In example/App.tsx, I provided a usage example where we use the item file name and save/read the waveform from the Cache folder with _wf.json. appended to the file name.
Unfortunately, I wanted to save the recorded waveform, but the format differs from the one when reading it from the file, so I left that one out.
I had to integrate react-native-fs for this matter; if needed, I can also switch to rn-fetch-blob, or I could also provide handlers and code this read from/write to file into the App.tsx
The text was updated successfully, but these errors were encountered:
dprevost-LMI
changed the title
feat: save waveform data to file in json format + Bonuses
feat: save waveform data to file in JSON format + bonuses
Oct 6, 2024
dprevost-LMI
changed the title
feat: save waveform data to file in JSON format + bonuses
[FEATURE]: save waveform data to file in JSON format + bonuses
Oct 7, 2024
As pointed out in this issue, loading audio files on Android can take quite some time. Also, piling up promises for audio extractions could considerably eat up resources.
Therefore, while waiting to fix the Android performance issue and be able to read more and more audio files piling up, it would be better to save the waveform to files and read it instead of continuously extracting it from the file.
One evident scenario is opening and scrolling multiple text conversations where we can have plenty of audio files.
This PR provides this capability: We save the extracted waveform of the audio file to the provided
waveFormPath
. Then, on the next load, we read the JSON data from the file instead of extracting the data live from the audio.In
example/App.tsx
, I provided a usage example where we use the item file name and save/read the waveform from theCache
folder with_wf.json.
appended to the file name.Unfortunately, I wanted to save the recorded waveform, but the format differs from the one when reading it from the file, so I left that one out.
I had to integrate
react-native-fs
for this matter; if needed, I can also switch torn-fetch-blob
, or I could also provide handlers and code this read from/write to file into theApp.tsx
The text was updated successfully, but these errors were encountered: