Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

[FEATURE]: save waveform data to file in JSON format + bonuses #109

Open
dprevost-LMI opened this issue Oct 6, 2024 · 0 comments · May be fixed by #114
Open

[FEATURE]: save waveform data to file in JSON format + bonuses #109

dprevost-LMI opened this issue Oct 6, 2024 · 0 comments · May be fixed by #114

Comments

@dprevost-LMI
Copy link
Contributor

dprevost-LMI commented Oct 6, 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 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

@dprevost-LMI 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 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
@kuldip-simform kuldip-simform linked a pull request Oct 23, 2024 that will close this issue
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging a pull request may close this issue.

1 participant