4142 views|4 replies

1942

Posts

2

Resources
The OP
 

【Mil MYS-8MMX】Part 5: Download music online [Copy link]

1. Introduction

In the previous article, we talked about playing music with Bluetooth speakers. However, before that, the audio files were transferred to the development board through the PC, and then the development board used multimedia tools to play the music. This was very inconvenient, so we wanted the development board to download the audio files by itself and then play them.

2. Python environment preparation

This tool requires Python 3 support. The system comes with Python 3. The version is shown in Figure 1 below:

Figure 1

First, you need to install Python's third-party library [pymusic-dl]. When installing this, I encountered many problems. The first problem is that after entering the [pip3 install pymusic-dl] command, I was supposed to install the [pymusic-dl] tool, but an error message as shown in Figure 2 appeared.

【ERROR: Could not install packages due to an EnvironmentError: HTTPSConnectionPool(host='files.pythonhosted.org', port=443)】

Figure 2

Then I tried it online and added a "--user" attribute, which became [pip3 install --user pymusic-dl] command. It still didn't work. I continued to look for the problem and saw a solution on a foreign website. It should be caused by the mismatch between the current system time and the server time. So I started to modify the time, looked for the development board manual, and found the setting of system time, as shown in Figure 3 below.

Figure 3

Through the above data analysis, I set the system time to the current time, as shown in Figure 4 below.

Figure 4

The board can also set the power-off time. It uses an RTC peripheral, but the RTC peripheral needs to be powered. The power supply management is shown in Figure 5.

Figure 5

The system time has been set, but it is not over yet. The third-party library can be downloaded normally, but there is still an error during installation, as shown in Figure 6 below.

【ERROR: Command errored out with exit status 1】

Figure 6

After some testing, I felt that the version of pip was not new enough, so I used the command [pip3 install --upgrade pip] to upgrade pip, and there were no problems during the upgrade process.

Figure 7

Finally, enter the [pip3 install pymusic-dl] command to successfully download and install the third-party library. The "--user" attribute is not used here. If there are still problems with the installation, you can try adding the "--user" attribute.

Figure 8

3. Audio Download Tool

First, download the tool from GitHub, [https://github.com/0xHJK/music-dl], then move it to the development board and install it directly. In the tool root directory, enter the [python3 setup.py install] command to install it. The installation is shown in Figure 9.

Fig. 9

After successful installation, enter the [music-dl --help] command to view the tool's help information.

Fig.10

Let's search for songs by a certain author. The search results are shown in Figure 11 below.

Fig.11

Then enter 0 and press Enter to download the song with serial number 0. The download speed is quite fast.

Fig.12

Check the root directory of the tool to see if there is this song. As shown in Figure 13 below, there is this song. Finally, use the [gst-play-1.0] tool to play the music.

Fig.13

4. Summary

The system environment of MYS-8MMX is quite good, and no problems caused by the system environment were encountered during use. With the above tools, plus some graphical interfaces, you can actually design a networked music player. Customizing software is so easy~

This post is from Linux and Android

Latest reply

Very good, manual thumbs up   Details Published on 2021-10-4 00:11

2926

Posts

0

Resources
2
 

Very good, thumbs up to the OP.

This post is from Linux and Android
 
 

6547

Posts

0

Resources
3
 

Regarding the download and installation of third-party libraries, and error handling, it is detailed, otherwise these small pitfalls will make it difficult to deal with. Thank you for sharing

This post is from Linux and Android

Comments

Yes, share the pitfalls you have encountered so that others can avoid them.  Details Published on 2021-10-3 11:03
 
 
 

1942

Posts

2

Resources
4
 
Jacktang posted on 2021-10-2 17:17 Regarding the download and installation of third-party libraries, and error handling, it is detailed, otherwise these small pitfalls will make it difficult to deal with. Thank you for sharing

Yes, share the pitfalls you have encountered so that others can avoid them.

This post is from Linux and Android
 
 
 

8

Posts

0

Resources
5
 
tagetage posted on 2021-10-2 17:08 Not bad, give a thumbs up to the OP.

Very good, manual thumbs up

This post is from Linux and Android
 
 
 

Just looking around
Find a datasheet?

EEWorld Datasheet Technical Support

EEWorld
subscription
account

EEWorld
service
account

Automotive
development
circle

Copyright © 2005-2024 EEWORLD.com.cn, Inc. All rights reserved 京B2-20211791 京ICP备10001474号-1 电信业务审批[2006]字第258号函 京公网安备 11010802033920号
快速回复 返回顶部 Return list