# Recording audio without Pyo

**URL:** <https://discourse.psychopy.org/t/recording-audio-without-pyo/1620>\
**Category:** Coding\
**Tags:** sound\
**Created:** [December 9, 2016, 2:18am UTC](https://discourse.psychopy.org/t/recording-audio-without-pyo/1620 "2016-12-09T02:18:44Z")\
**Posts on this page:** 5\
**Page:** 1

<div class="post-metadata">

**Author:** ![kla](https://avatars.discourse-cdn.com/v4/letter/k/b3f665/32.png) [@kla](https://discourse.psychopy.org/u/kla)\
**Post date:** [December 9, 2016, 2:18am UTC](https://discourse.psychopy.org/t/recording-audio-without-pyo/1620/1 "2016-12-09T02:18:44Z")

</div>

Is there any option to record audio without pyo installed? It seems like pyo is imported when calling microphone.switchOn() and that seems to be the only way to use a microphone object.

I would love to just use pyo but have been unable to get it working, see this post for more info:

> [@PYO and basic import problem](http://discourse.psychopy.org/t/pyo-and-basic-import-problem/1339/13):
>
> I’m having trouble with pyo as well. Using standalone psychopy (1.84.2) on Windows 10. I installed pyo and chose C:\Program Files (x86)\PsychoPy2 as the installation directory. This created a few folders in PsychoPy2\Lib\site-packages\. Here is the output from trying to import pyo from the PsychoPy shell: \>\>\> import pyo Traceback (most recent call last): File "\<input\>", line 1, in \<module\> File "C:\Program Files (x86)\PsychoPy2\lib\site-packages\pyo.py", line 21, in \<module\> import pyo…

---

<div class="post-metadata">

**Author:** ![jon](https://sea2.discourse-cdn.com/flex002/user_avatar/discourse.psychopy.org/jon/32/22_2.png) [@jon](https://discourse.psychopy.org/u/jon)\
**Post date:** [December 9, 2016, 12:15pm UTC](https://discourse.psychopy.org/t/recording-audio-without-pyo/1620/2 "2016-12-09T12:15:35Z")

</div>

No other system is provided out-of-the-box but we are packaging pysoundcard and will be packaging sounddevice, which make it possible if you want to write your own code for those libs.

---

<div class="post-metadata">

**Author:** ![daniel.riggs1](https://sea2.discourse-cdn.com/flex002/user_avatar/discourse.psychopy.org/daniel.riggs1/32/8103_2.png) [@daniel.riggs1](https://discourse.psychopy.org/u/daniel.riggs1)\
**Post date:** [December 9, 2016, 2:12pm UTC](https://discourse.psychopy.org/t/recording-audio-without-pyo/1620/3 "2016-12-09T14:12:08Z")

</div>

Several months ago I posted some code that I’ve been using to successfully record short audio clips. [Here’s the link.](http://discourse.psychopy.org/t/microphone-recording-not-ending-properly/1039/10?u=daniel.riggs1)

---

<div class="post-metadata">

**Author:** ![kla](https://avatars.discourse-cdn.com/v4/letter/k/b3f665/32.png) [@kla](https://discourse.psychopy.org/u/kla)\
**Post date:** [December 9, 2016, 7:35pm UTC](https://discourse.psychopy.org/t/recording-audio-without-pyo/1620/4 "2016-12-09T19:35:22Z")

</div>

Thanks @daniel.riggs1. I resorted to using a command-line program, but your solution is better. Too bad pyo is such a PITA.

---

<div class="post-metadata">

**Author:** ![daniel.riggs1](https://sea2.discourse-cdn.com/flex002/user_avatar/discourse.psychopy.org/daniel.riggs1/32/8103_2.png) [@daniel.riggs1](https://discourse.psychopy.org/u/daniel.riggs1)\
**Post date:** [December 9, 2016, 7:51pm UTC](https://discourse.psychopy.org/t/recording-audio-without-pyo/1620/5 "2016-12-09T19:51:30Z")

</div>

Yeah, thankfully the psychopy developers are moving toward their own solution, so this will soon not be a problem.
