Giter VIP home page Giter VIP logo

Comments (7)

junhuanchen avatar junhuanchen commented on September 25, 2024

在提 issue 前能先看文档 wiki.sipeed.com 吗?

from maixpy-v1_scripts.

junfengzh avatar junfengzh commented on September 25, 2024

Can you be more specific and link the sample code or config for MaixCube? I looked at wiki.sipeed.com but have no idea. Help appreiciated.

from maixpy-v1_scripts.

junhuanchen avatar junhuanchen commented on September 25, 2024

https://wiki.sipeed.com/soft/maixpy/en/course/media/audio.html

from maixpy-v1_scripts.

junhuanchen avatar junhuanchen commented on September 25, 2024

https://wiki.sipeed.com/soft/maixpy/zh/course/media/audio.html

from maixpy-v1_scripts.

junfengzh avatar junfengzh commented on September 25, 2024

谢谢回复。我正是按照这些例程来试的。如下是我的代码,和record_wav.py一模一样只是去掉了写文件环节。
打印出来的音频数据全是0。我怀疑是GPIO的端口和MaixCube的不一致?

import image, lcd, time
import audio
from Maix import GPIO, I2S
from fpioa_manager import fm

# user setting
sample_rate   = 16000
record_time   = 4  #s
# default seting
sample_points = 2048
wav_ch        = 2

fm.register(8,  fm.fpioa.GPIO0, force=True)
wifi_en = GPIO(GPIO.GPIO0, GPIO.OUT)
wifi_en.value(0)

fm.register(20,fm.fpioa.I2S0_IN_D0, force=True)
fm.register(19,fm.fpioa.I2S0_WS, force=True)    # 19 on Go Board and Bit(new version)
fm.register(18,fm.fpioa.I2S0_SCLK, force=True)  # 18 on Go Board and Bit(new version)

rx = I2S(I2S.DEVICE_0)
rx.channel_config(rx.CHANNEL_0, rx.RECEIVER, align_mode=I2S.STANDARD_MODE)
rx.set_sample_rate(sample_rate)
print(rx)

frame_cnt = record_time*sample_rate//sample_points

for i in range(frame_cnt):
    tmp = rx.record(sample_points*wav_ch)
    print(tmp.to_bytes())

from maixpy-v1_scripts.

junhuanchen avatar junhuanchen commented on September 25, 2024

D3A89BDB-A62E-45D3-87CB-ABBF32B530ED

from maixpy-v1_scripts.

junfengzh avatar junfengzh commented on September 25, 2024

https://github.com/sipeed/MaixPy_scripts/blob/master/modules/others/es8374/es8374.py 能用,多谢。

from maixpy-v1_scripts.

Related Issues (20)

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.