# Export to wav with command line

**URL:** <https://in-thread.sonic-pi.net/t/export-to-wav-with-command-line/4674>\
**Category:** Support, Help & Resources\
**Created:** [November 23, 2020, 8:03pm UTC](https://in-thread.sonic-pi.net/t/export-to-wav-with-command-line/4674 "2020-11-23T20:03:59Z")\
**Posts on this page:** 6\
**Page:** 1

<div class="post-metadata">

**Author:** ![enkid0](https://dub1.discourse-cdn.com/flex017/user_avatar/in-thread.sonic-pi.net/enkid0/32/1275_2.png) [@enkid0](https://in-thread.sonic-pi.net/u/enkid0)\
**Post date:** [November 23, 2020, 8:03pm UTC](https://in-thread.sonic-pi.net/t/export-to-wav-with-command-line/4674/1 "2020-11-23T20:03:59Z")

</div>

Hello!  
is there a way to “play” a .rb file with a command line tool and have it directly stored in a wav file? I mean, without having to hear it and press a key at some point.

I’ve seen [https://github.com/lpil/sonic-pi-tool](https://github.com/lpil/sonic-pi-tool) with is pretty neat, but it doesn’t seem to have the function I’m talking about. Did someone do that or know a way to do it? Is it even possible with the actual Sonic Pi architecture?

---

<div class="post-metadata">

**Author:** ![nlb](https://dub1.discourse-cdn.com/flex017/user_avatar/in-thread.sonic-pi.net/nlb/32/997_2.png) [@nlb](https://in-thread.sonic-pi.net/u/nlb)\
**Post date:** [November 24, 2020, 6:13am UTC](https://in-thread.sonic-pi.net/t/export-to-wav-with-command-line/4674/2 "2020-11-24T06:13:42Z")

</div>

Hi

What OS do you use ? On Linux maybe have a look to Jack tools or something like that.

> **[Record & Play Audio on Linux](https://medium.com/@YihuiXiong/record-play-audio-on-linux-8f59adf93710)**
>
> As I want to make a smart speaker from scratch, the first thing to do in terms of software is to learn how to record & play audio.
> Most of…

---

<div class="post-metadata">

**Author:** ![enkid0](https://dub1.discourse-cdn.com/flex017/user_avatar/in-thread.sonic-pi.net/enkid0/32/1275_2.png) [@enkid0](https://in-thread.sonic-pi.net/u/enkid0)\
**Post date:** [November 24, 2020, 8:37am UTC](https://in-thread.sonic-pi.net/t/export-to-wav-with-command-line/4674/3 "2020-11-24T08:37:42Z")

</div>

Oh, yeah, good question. I’m on Windows mainly, but I can use Linux distribs when needed.  
Thx for the suggestion but these tools seem to record what’s happening realtime on the machine.

I’d like to save a 5+ minutes sonic pi finite song (no live\_loop) in a few seconds (just the length of the calculation).

---

<div class="post-metadata">

**Author:** ![samaaron](https://dub1.discourse-cdn.com/flex017/user_avatar/in-thread.sonic-pi.net/samaaron/32/7_2.png) [@samaaron](https://in-thread.sonic-pi.net/u/samaaron)\
**Post date:** [November 24, 2020, 9:16am UTC](https://in-thread.sonic-pi.net/t/export-to-wav-with-command-line/4674/4 "2020-11-24T09:16:43Z")

</div>

> [@enkid0](#):
>
> I’d like to save a 5+ minutes sonic pi finite song (no live\_loop) in a few seconds (just the length of the calculation).

Hi, sorry this is something that Sonic Pi wasn’t designed to do. Whilst, in theory, the SuperCollider audio engine can work in so-called “non-realtime mode” this is currently completely inaccessible from Sonic Pi and would require significant design reworking to make possible.

Also, there’s no official support for working directly with the command line and bypassing the GUI. Whilst this is something that would be nice to have - it’s not been high on my priority list - mainly because Sonic Pi aims to target people learning to program rather than people already familiar with a command line. There are already more than enough challenges making things sufficiently simple, friendly and intuitive 🙂

However, it’s cool that people have found ways round that and I always encourage end-user innovation 🙂

---

<div class="post-metadata">

**Author:** ![enkid0](https://dub1.discourse-cdn.com/flex017/user_avatar/in-thread.sonic-pi.net/enkid0/32/1275_2.png) [@enkid0](https://in-thread.sonic-pi.net/u/enkid0)\
**Post date:** [November 24, 2020, 9:20am UTC](https://in-thread.sonic-pi.net/t/export-to-wav-with-command-line/4674/5 "2020-11-24T09:20:27Z")

</div>

Ok, thx for your answer!

---

<div class="post-metadata">

**Author:** ![nlb](https://dub1.discourse-cdn.com/flex017/user_avatar/in-thread.sonic-pi.net/nlb/32/997_2.png) [@nlb](https://in-thread.sonic-pi.net/u/nlb)\
**Post date:** [November 24, 2020, 9:26am UTC](https://in-thread.sonic-pi.net/t/export-to-wav-with-command-line/4674/6 "2020-11-24T09:26:11Z")

</div>

> [@enkid0](#):
>
> I’d like to save a 5+ minutes sonic pi finite song (no live\_loop) in a few seconds (just the length of the calculation).

ok so i was off topic. Sorry 🙂
