<?xml version="1.0" encoding="UTF-8"?><rss xmlns:dc="http://purl.org/dc/elements/1.1/" xmlns:content="http://purl.org/rss/1.0/modules/content/" xmlns:atom="http://www.w3.org/2005/Atom" version="2.0"><channel><title><![CDATA[質問：M5stackへのPythonモジュールのインストール方法]]></title><description><![CDATA[<p dir="auto">多分大変初歩的なとこだとは思うのですが、分かる方教えてください。</p>
<h2>やりたいこと</h2>
<p dir="auto">wav|mp3を流しながら(バックグラウンド再生しながら)、別の動作(画面遷移|servo動作)させたい<br />
　　このために、m5stackにpythonの外部モジュールpyaudioをインストールして使いたい</p>
<h2>環境</h2>
<p dir="auto">windows10/m5stack core2<br />
　　普段はUIFlowからblocky/micropythonを書いているが、<br />
　　Teratermとarduino-ideも使用可能</p>
<h2>やってみたこと①</h2>
<p dir="auto">/flash/res/pyaudio.py を追加して import pyaudio でやってみたが、<br />
　　pyaudioの依存元portaudioがないため動作しない</p>
<h2>やってみたこと②</h2>
<p dir="auto"><a href="https://stackoverflow.com/questions/48135955/installation-of-pyaudio-on-raspberry-pi-3-fails-with-gcc-error" target="_blank" rel="noopener noreferrer nofollow ugc">https://stackoverflow.com/questions/48135955/installation-of-pyaudio-on-raspberry-pi-3-fails-with-gcc-error</a><br />
　　<a href="https://qiita.com/Nyanpy/items/cb4ea8dc4dc01fe56918" target="_blank" rel="noopener noreferrer nofollow ugc">https://qiita.com/Nyanpy/items/cb4ea8dc4dc01fe56918</a><br />
　　<a href="https://qiita.com/yukky-k/items/0d18ec22420e8b35d0ac" target="_blank" rel="noopener noreferrer nofollow ugc">https://qiita.com/yukky-k/items/0d18ec22420e8b35d0ac</a><br />
　　を参考に、sudo pip install pyaudioでインストールできそうなことは分かったが、<br />
　　TeratermからUSB接続したm5stackを見ても、micropython(uiflow)として動いており<br />
　　sudo pip install pyaudioのコマンドが通せない</p>
]]></description><link>https://community.m5stack.com/topic/5056/質問-m5stackへのpythonモジュールのインストール方法</link><generator>RSS for Node</generator><lastBuildDate>Wed, 29 Apr 2026 01:54:43 GMT</lastBuildDate><atom:link href="https://community.m5stack.com/topic/5056.rss" rel="self" type="application/rss+xml"/><pubDate>Wed, 15 Feb 2023 06:01:37 GMT</pubDate><ttl>60</ttl><item><title><![CDATA[Reply to 質問：M5stackへのPythonモジュールのインストール方法 on Fri, 17 Feb 2023 10:45:46 GMT]]></title><description><![CDATA[<p dir="auto">おっしゃる通り、_threadsで渡すようにしたら<br />
バックグラウンド再生しつつサーボ制御できました！</p>
<pre><code>from m5stack import *
from m5stack_ui import *
from uiflow import *

import module
import time
import math
import _thread



def chika_led():
  speaker.playWAV('/sd/head2.wav')

def chika_scr():
  i = 0
  while i &lt; 15 :
    servo2.position(7,150)
    wait_ms(100)
    servo2.position(7,158)
    wait_ms(100)
    i = i + 1



screen = M5Screen()
screen.clean_screen()
screen.set_screen_bg_color(0)
servo2 = module.get(module.SERVO2)

_thread.start_new_thread(chika_led,())
_thread.start_new_thread(chika_scr,())```</code></pre>
]]></description><link>https://community.m5stack.com/post/20112</link><guid isPermaLink="true">https://community.m5stack.com/post/20112</guid><dc:creator><![CDATA[[[global:former-user]]]]></dc:creator><pubDate>Fri, 17 Feb 2023 10:45:46 GMT</pubDate></item><item><title><![CDATA[Reply to 質問：M5stackへのPythonモジュールのインストール方法 on Thu, 16 Feb 2023 23:38:52 GMT]]></title><description><![CDATA[<p dir="auto">情報ありがとうございます！<br />
_threadを使用する方向でも検討してみます。</p>
]]></description><link>https://community.m5stack.com/post/20107</link><guid isPermaLink="true">https://community.m5stack.com/post/20107</guid><dc:creator><![CDATA[[[global:former-user]]]]></dc:creator><pubDate>Thu, 16 Feb 2023 23:38:52 GMT</pubDate></item><item><title><![CDATA[Reply to 質問：M5stackへのPythonモジュールのインストール方法 on Thu, 16 Feb 2023 08:39:54 GMT]]></title><description><![CDATA[<p dir="auto">TwitterでA_P_Delchiさんという方がMicroPythonでサーボの動作と別の処理をスレッドで実現しています。（WAV/MP3再生はしていません。）<br />
こちらが参考になると思います。</p>
<p dir="auto"><a href="https://twitter.com/A_P_Delchi/status/1609525689342119938" target="_blank" rel="noopener noreferrer nofollow ugc">https://twitter.com/A_P_Delchi/status/1609525689342119938</a></p>
<p dir="auto"><a href="https://github.com/apdelchi/sign-chan" target="_blank" rel="noopener noreferrer nofollow ugc">https://github.com/apdelchi/sign-chan</a></p>
]]></description><link>https://community.m5stack.com/post/20096</link><guid isPermaLink="true">https://community.m5stack.com/post/20096</guid><dc:creator><![CDATA[mongonta555]]></dc:creator><pubDate>Thu, 16 Feb 2023 08:39:54 GMT</pubDate></item><item><title><![CDATA[Reply to 質問：M5stackへのPythonモジュールのインストール方法 on Thu, 16 Feb 2023 07:40:54 GMT]]></title><description><![CDATA[<p dir="auto">ESP32はラズパイのようにLinuxOSはないので、パッケージを入れることはできません。サウンド制御の部分も独自のドライバでUIFlowからは使えるようになっています。</p>
<p dir="auto">恐らくなのですが、portaudio部分を自分で実装しないとpyaudioは使用できないと考えます。（そのままでは動かすのは不可。）</p>
<p dir="auto">Pythonで完結するように_threadを使用してサーボ制御と音声の再生を行う方法を模索するしかないでしょう。（UIFlowのMicroPythonでは細かいタスクやスレッドの優先度の制御はできないのでかなり難しいと思います。）</p>
]]></description><link>https://community.m5stack.com/post/20095</link><guid isPermaLink="true">https://community.m5stack.com/post/20095</guid><dc:creator><![CDATA[mongonta555]]></dc:creator><pubDate>Thu, 16 Feb 2023 07:40:54 GMT</pubDate></item></channel></rss>