🤖Have you ever tried Chat.M5Stack.com before asking??😎
    M5Stack Community
    • Categories
    • Recent
    • Tags
    • Popular
    • Users
    • Groups
    • Search
    • Register
    • Login

    No files ever work with the Speaker

    UIFlow
    1
    2
    26
    Loading More Posts
    • Oldest to Newest
    • Newest to Oldest
    • Most Votes
    Reply
    • Reply as topic
    Log in to reply
    This topic has been deleted. Only users with topic management privileges can see it.
    • M
      michael.koppelman
      last edited by

      I've loaded a small, mono, 16-bit, 44.1kHz audio file into flash in UFlow 2.0. It plays fine within UFlow. No matter what I do, I get an ENOENT error trying to read the file.

      Traceback (most recent call last):
      File "<stdin>", line 26, in <module>
      File "<stdin>", line 18, in loop
      OSError: [Errno 2] ENOENT
      

      a snippet of the code from the Python side of things:

      def setup():
        global rgb
      
        M5.begin()
        Widgets.setRotation(1)
        Widgets.fillScreen(0x222222)
      
        rgb = RGB()
        Speaker.begin()
        Speaker.setVolumePercentage(0.5)
      
      
      def loop():
        global rgb
        M5.update()
        Speaker.playWavFile('/flash/res/audio/test1.wav')
        if Speaker.isPlaying():
          rgb.fill_color(0xffffff)
        time.sleep(2)
      
      

      No code I've downloaded from other people works either! I can play tones out of the speaker, I can read images out of flash. I cannot read audio files out of flash.

      1 Reply Last reply Reply Quote 0
      • M
        michael.koppelman
        last edited by michael.koppelman

        This is because UIFlow2.0 sucks with the M5Go. Almost no hardware works. I would abandon all the silly BS and go right to PlatformIO if you want to avoid pulling your hair out.

        This ecosystem is so convoluted. I thought I might buy these for presents for kids. No way. Your average parent could not make this shit work ever.

        1 Reply Last reply Reply Quote 0
        • First post
          Last post