MaixPy-v1_scripts icon indicating copy to clipboard operation
MaixPy-v1_scripts copied to clipboard

speaker sample

Open mhama opened this issue 6 years ago • 7 comments

It would be better to have some samples to use the speaker, as Maix Go have a good-looking speaker hardware.

mhama avatar Apr 08 '19 14:04 mhama

https://github.com/sipeed/MaixPy_scripts/blob/master/multimedia/audio/play_wav.py

https://maixpy.sipeed.com/zh/libs/Maix/i2s.html

https://maixpy.sipeed.com/zh/libs/Maix/audio.html

Neutree avatar May 09 '19 01:05 Neutree

I test play_wav.py and got the below error. Pls advise. thanks!

wav_info = player.play_process(wav_dev)

[MAIXPY]: wav error code : 7 Traceback (most recent call last): File "", line 1, in OSError: wav init error

And for player.volume(40), I got error: Traceback (most recent call last): File "", line 1, in AttributeError: 'AUDIO' object has no attribute 'volume'

linycm avatar May 11 '19 08:05 linycm

@linycm wait for the new release or build yourself firmware

Neutree avatar May 11 '19 11:05 Neutree

@Neutree I build firmware again but still got error when

wav_info = player.play_process(wav_dev) [MAIXPY]: wav error code : 7 Traceback (most recent call last): File "", line 1, in OSError: wav init error

core dump: fault store Cause 0x0000000000000007, EPC 0x00000000800c2a44 .......

linycm avatar May 12 '19 14:05 linycm

@linycm The header of wav file you used have some problem, please send me your wav file, so I can check the header, or just convert to wav file maixpy support. here for example

Neutree avatar May 13 '19 01:05 Neutree

radio.wav.tar.gz

@Neutree pls help to check. thanks!

linycm avatar May 21 '19 13:05 linycm

@linycm This audio file uses ADPCM encoding. MaixPy only supports PCM 16bit little endian encoding. Please find a way to convert to such a format. There is no plan to support ADPCM.

image

MaixPy support like this one:

image

Neutree avatar May 22 '19 01:05 Neutree