# Audio conversion how

**URL:** <https://forum.juce.com/t/audio-conversion-how/2796>\
**Category:** General JUCE discussion\
**Created:** [May 2, 2008, 11:21am UTC](https://forum.juce.com/t/audio-conversion-how/2796 "2008-05-02T11:21:05Z")\
**Posts on this page:** 5\
**Page:** 1

<div class="post-metadata">

**Author:** ![atom](https://sea2.discourse-cdn.com/flex026/user_avatar/forum.juce.com/atom/32/113_2.png) [@atom](https://forum.juce.com/u/atom)\
**Post date:** [May 2, 2008, 11:21am UTC](https://forum.juce.com/t/audio-conversion-how/2796/1 "2008-05-02T11:21:05Z")

</div>

Could someone quickly just skecth how you would use JUCE methods to read from one format and write other format (audio files: wav ogg flac) i mean in sequence what has to be done, i got lost in thoe Reader and Writer classes and am not sure how to deal with this, maybe someone can point me to some source code example, that would be fine too.

---

<div class="post-metadata">

**Author:** ![robiwan](https://sea2.discourse-cdn.com/flex026/user_avatar/forum.juce.com/robiwan/32/2446_2.png) [@robiwan](https://forum.juce.com/u/robiwan)\
**Post date:** [May 3, 2008, 6:56pm UTC](https://forum.juce.com/t/audio-conversion-how/2796/2 "2008-05-03T18:56:57Z")

</div>

Sketchty: In a loop, read N samples from one format (f.i. ogg AudioFormatReader) into a AudioSampleBuffer via AudioSampleBuffer::readFromAudioReader, then write N samples into the other format (f.i. wav AudioFormatWriter) via AudioSampleBuffer::writeToAudioWriter, until you’re done. Simple as that (thnx jules).

---

<div class="post-metadata">

**Author:** ![atom](https://sea2.discourse-cdn.com/flex026/user_avatar/forum.juce.com/atom/32/113_2.png) [@atom](https://forum.juce.com/u/atom)\
**Post date:** [May 4, 2008, 10:24am UTC](https://forum.juce.com/t/audio-conversion-how/2796/3 "2008-05-04T10:24:34Z")

</div>

i spent last two days getting to that 🙂

thanks jules for making it simple, it’s just my head that’s not working properly.

could someone also explaing to me what is the quality setting for FLAC, i thought it’s a losseless codec so what is the quality setting for ?

---

<div class="post-metadata">

**Author:** ![valley](https://avatars.discourse-cdn.com/v4/letter/v/67e7ee/32.png) [@valley](https://forum.juce.com/u/valley)\
**Post date:** [May 4, 2008, 11:48am UTC](https://forum.juce.com/t/audio-conversion-how/2796/4 "2008-05-04T11:48:19Z")

</div>

If the setting is labelled quality, I think that’s a misnomer.

Flac is lossless, but you can adjust the level of compression. Depending on your music style, upping this setting will often just cause the encoder to spend a very long time making your audio file very fractionally smaller. Typically the default setting is good balance of time/CPU load over resultant file size.

---

<div class="post-metadata">

**Author:** ![atom](https://sea2.discourse-cdn.com/flex026/user_avatar/forum.juce.com/atom/32/113_2.png) [@atom](https://forum.juce.com/u/atom)\
**Post date:** [May 4, 2008, 4:42pm UTC](https://forum.juce.com/t/audio-conversion-how/2796/5 "2008-05-04T16:42:24Z")

</div>

the “quality” word caught my attention

```auto
qualityOptionIndex the index of one of compression qualities returned by the getQualityOptions() method. If there aren't any quality options for this format, just pass 0 in this parameter, as it'll be ignored 
```

this is the documentation for the createWriterFor() method of the FlacAudioFormat class.
