# Merge and trim audio files in p5Sound?

**URL:** <https://discourse.processing.org/t/merge-and-trim-audio-files-in-p5sound/30156>\
**Category:** Libraries\
**Tags:** homework\
**Created:** [May 18, 2021, 5:36pm UTC](https://discourse.processing.org/t/merge-and-trim-audio-files-in-p5sound/30156 "2021-05-18T17:36:51Z")\
**Posts on this page:** 1\
**Showing post:** 2

<div class="post-metadata">

**Author:** ![micuat](https://yyz2.discourse-cdn.com/flex036/user_avatar/discourse.processing.org/micuat/32/19407_2.png) [@micuat](https://discourse.processing.org/u/micuat)\
**Post date:** [May 18, 2021, 7:59pm UTC](https://discourse.processing.org/t/merge-and-trim-audio-files-in-p5sound/30156/2 "2021-05-18T19:59:37Z")

</div>

I normally recommend to look into web audio API instead of trying different JS libraries because everything is basically a wrapper of the native API. I think this would help: [AudioBuffer - Web APIs | MDN](https://developer.mozilla.org/en-US/docs/Web/API/AudioBuffer)

for upload you can also use drag and drop: [dragOver and dragLeave do not work - #6 by micuat](https://discourse.processing.org/t/dragover-and-dragleave-do-not-work/4208/6)

and for saving a file: [wavefile - npm](https://www.npmjs.com/package/wavefile)

if it’s more like a batch operation (if you know start/end time to trim) you can also consider editing on the server - which may be easier but has less flexibility on the editing.

---

_[View the full topic](https://discourse.processing.org/t/merge-and-trim-audio-files-in-p5sound/30156)._
