# Converting AudioIn to a SoundFile

**URL:** https://discourse.processing.org/t/converting-audioin-to-a-soundfile/39987
**Category:** Libraries
**Created:** [December 2, 2022, 10:52am UTC](https://discourse.processing.org/t/converting-audioin-to-a-soundfile/39987 "2022-12-02T10:52:05Z")
**Posts on this page:** 1
**Page:** 1

<div class="post-metadata">

### Author: ![alpharome01](https://avatars.discourse-cdn.com/v4/letter/a/4da419/32.png) [@alpharome01](https://discourse.processing.org/u/alpharome01)
#### Post date: [December 2, 2022, 10:52am UTC](https://discourse.processing.org/t/converting-audioin-to-a-soundfile/39987/1 "2022-12-02T10:52:05Z")

</div>

I’m making a audio recorder/saver, this is the code as of right now.

```auto
import processing.sound.*;
AudioIn audioIn;
int stage;
SoundFile segments[] = new SoundFile[10000];
void setup() {
  fullScreen();
  audioIn = new AudioIn(this, 0);
  audioIn.play();
}      

void draw() {
  background(0);
  segments[stage] = audioIn;
  stage++;
}

```

This code, of course, throws an error, due to the fact you can’t add an audioIn to a SoundFile.  
Is there any way to convert an AudioIn to a SoundFile, PImage or String?
