# Copy and Paste parts of a audio file

**URL:** <https://discourse.processing.org/t/copy-and-paste-parts-of-a-audio-file/31422>\
**Category:** Libraries\
**Created:** [July 24, 2021, 1:14pm UTC](https://discourse.processing.org/t/copy-and-paste-parts-of-a-audio-file/31422 "2021-07-24T13:14:37Z")\
**Posts on this page:** 7\
**Page:** 1

<div class="post-metadata">

**Author:** ![AshSnaga](https://yyz2.discourse-cdn.com/flex036/user_avatar/discourse.processing.org/ashsnaga/32/13807_2.png) [@AshSnaga](https://discourse.processing.org/u/AshSnaga)\
**Post date:** [July 24, 2021, 1:14pm UTC](https://discourse.processing.org/t/copy-and-paste-parts-of-a-audio-file/31422/1 "2021-07-24T13:14:37Z")

</div>

Hi. I am new in sound processing and Processing too. I want to copy pieces from a audio file and paste in a different order and save it. How I can make this? Wich sound library is better for do it? Can you orient me in the right direction? Thank you.

---

<div class="post-metadata">

**Author:** ![glv](https://yyz2.discourse-cdn.com/flex036/user_avatar/discourse.processing.org/glv/32/18785_2.png) [@glv](https://discourse.processing.org/u/glv)\
**Post date:** [July 24, 2021, 2:05pm UTC](https://discourse.processing.org/t/copy-and-paste-parts-of-a-audio-file/31422/2 "2021-07-24T14:05:18Z")

</div>

Hello,

There is the Processing Sound library.

I always start by looking through what is available in the resources.

There are resources (tutorials, references, examples, etc.) here:  
[https://processing.org/](https://processing.org/)

And examples that come with Processing:

![image](https://canada1.discourse-cdn.com/flex036/uploads/processingfoundation1/original/2X/f/f1a617959e1c2b20423a23c341d320a4fdc944c4.png)

And the JavaDocs:  
[https://processing.github.io/processing-sound/processing/sound/SoundFile.html](https://processing.github.io/processing-sound/processing/sound/SoundFile.html)

The Minim library may be of interest.

![image](https://canada1.discourse-cdn.com/flex036/uploads/processingfoundation1/original/2X/a/a9393df10fc0473685d676a36f7804b45d058420.png)

I was able to set loop points and play once with some changes to code.  
You may be able to cue and play what you want with this strategy.

> [@AshSnaga](#):
>
> I want to copy pieces from a audio file and paste in a different order and save it

This would require more exploration.  
I just took a quick look.

`:)`

---

<div class="post-metadata">

**Author:** ![AshSnaga](https://yyz2.discourse-cdn.com/flex036/user_avatar/discourse.processing.org/ashsnaga/32/13807_2.png) [@AshSnaga](https://discourse.processing.org/u/AshSnaga)\
**Post date:** [July 24, 2021, 2:28pm UTC](https://discourse.processing.org/t/copy-and-paste-parts-of-a-audio-file/31422/3 "2021-07-24T14:28:45Z")

</div>

Thanks, glv. I’m fighting with Sound, Beads, Minim and others and I learned a lot but not how cut segments of a sound and rewrite in different order. ;(

---

<div class="post-metadata">

**Author:** ![AshSnaga](https://yyz2.discourse-cdn.com/flex036/user_avatar/discourse.processing.org/ashsnaga/32/13807_2.png) [@AshSnaga](https://discourse.processing.org/u/AshSnaga)\
**Post date:** [July 24, 2021, 2:31pm UTC](https://discourse.processing.org/t/copy-and-paste-parts-of-a-audio-file/31422/4 "2021-07-24T14:31:09Z")

</div>

Thanks. I go to try with cue and record or something like this. 😃

---

<div class="post-metadata">

**Author:** ![glv](https://yyz2.discourse-cdn.com/flex036/user_avatar/discourse.processing.org/glv/32/18785_2.png) [@glv](https://discourse.processing.org/u/glv)\
**Post date:** [July 24, 2021, 2:38pm UTC](https://discourse.processing.org/t/copy-and-paste-parts-of-a-audio-file/31422/5 "2021-07-24T14:38:14Z")

</div>

Hello,

In the setLoopPoints example I did this to play once:

```auto
void keyPressed()
  {
  snip.loop(0);
  }

```

I was experimenting and got lucky!  
I am sure there is a reference for that somewhere.

Have fun!

`:)`

---

<div class="post-metadata">

**Author:** ![AshSnaga](https://yyz2.discourse-cdn.com/flex036/user_avatar/discourse.processing.org/ashsnaga/32/13807_2.png) [@AshSnaga](https://discourse.processing.org/u/AshSnaga)\
**Post date:** [July 24, 2021, 3:46pm UTC](https://discourse.processing.org/t/copy-and-paste-parts-of-a-audio-file/31422/6 "2021-07-24T15:46:00Z")

</div>

Thanks, glv. Hav fun you too. 😃

---

<div class="post-metadata">

**Author:** ![AshSnaga](https://yyz2.discourse-cdn.com/flex036/user_avatar/discourse.processing.org/ashsnaga/32/13807_2.png) [@AshSnaga](https://discourse.processing.org/u/AshSnaga)\
**Post date:** [July 24, 2021, 4:05pm UTC](https://discourse.processing.org/t/copy-and-paste-parts-of-a-audio-file/31422/7 "2021-07-24T16:05:52Z")

</div>

I think snip.loop() is the answer for all troubles of the humanity.
