Git Product home page Git Product logo

kids_reading's Introduction

kids_reading

An app that allows kids to scan the book's and read the book.

Getting Started

Prerequisites

Install FFmpeg for Eleven Labs' Play Audio Function

from elevenlabs import generate, play

audio = generate(text, voice="DPsqCHWEBVTyO9962K8u")
play(audio)

Download ffmpeg (Window version)

  1. Download the appropriate version for Windows (Go to the FFmpeg Download Page).

  2. Extract the files to a directory (e.g., C:\ffmpeg). And add ffmpeg to the System Path. alt text

  3. Verify Installation:

    ffmpeg --version

Add key in environment variables

alt text

Bugfix for pydub

  1. Open the file pydub\utils.py in the pydub package directory. alt text

  2. Add line " f.close() # close the file stream" in the _play_with_ffplay function.

    def _play_with_ffplay(seg):
      PLAYER = get_player_name()
      with NamedTemporaryFile("w+b", suffix=".wav") as f:
          f.close()  # close the file stream
          seg.export(f.name, "wav")
          subprocess.call([PLAYER, "-nodisp", "-autoexit", "-hide_banner", f.name])

发布Toga应用到iOS App Store

开发阶段

1. 安装必要工具

  • 确保安装了Python(版本3.5及以上)。
  • 安装Briefcase和Toga:
pip install briefcase toga

2. 创建应用

使用Briefcase创建Toga应用:

briefcase new

3. 开发应用

编辑src/<app_name>/app.py,开发应用逻辑和UI。示例代码:

import toga
from toga.style import Pack
from toga.style.pack import COLUMN, CENTER

def on_button_press(widget):
    print("Hello world!")

def build(app):
    button = toga.Button(
        'Press me!',
        on_press=on_button_press,
        style=Pack(padding=20)
    )
    return toga.Box(
        children=[button],
        style=Pack(direction=COLUMN, alignment=CENTER, flex=1)
    )

def main():
    return toga.App(
        'First Toga App',
        'org.beeware.helloworld',
        startup=build
    )

if __name__ == '__main__':
    main().main_loop()

4. 本地测试

在应用目录下运行应用进行测试:

briefcase dev

kids_reading's People

Contributors

hrsxz avatar

Watchers

 avatar

Recommend Projects

  • React photo React

    A declarative, efficient, and flexible JavaScript library for building user interfaces.

  • Vue.js photo Vue.js

    🖖 Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.

  • Typescript photo Typescript

    TypeScript is a superset of JavaScript that compiles to clean JavaScript output.

  • TensorFlow photo TensorFlow

    An Open Source Machine Learning Framework for Everyone

  • Django photo Django

    The Web framework for perfectionists with deadlines.

  • D3 photo D3

    Bring data to life with SVG, Canvas and HTML. 📊📈🎉

Recommend Topics

  • javascript

    JavaScript (JS) is a lightweight interpreted programming language with first-class functions.

  • web

    Some thing interesting about web. New door for the world.

  • server

    A server is a program made to process requests and deliver data to clients.

  • Machine learning

    Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.

  • Game

    Some thing interesting about game, make everyone happy.

Recommend Org

  • Facebook photo Facebook

    We are working to build community through open source technology. NB: members must have two-factor auth.

  • Microsoft photo Microsoft

    Open source projects and samples from Microsoft.

  • Google photo Google

    Google ❤️ Open Source for everyone.

  • D3 photo D3

    Data-Driven Documents codes.