自建音乐服务器Navidrome之二

开源音乐服务器

自建音乐服务器Navidrome之一


自建音乐服务器Navidrome之二

  • 开源音乐服务器
  • 6 准备音乐资源 可选
    • Last.fm
    • Spotify
  • 7 安装 Docker
    • 启动 docker
  • 8 安装音乐服务器
  • 9 音乐上传
  • 使用miserver上传
  • 启动音乐服务器
  • 浏览器访问:账号
  • 10 Navidrome 第三方客户端
    • Substreamer
    • Subtracks
    • Subsonic


6 准备音乐资源 可选

Last.fm

Last·fm是 Audioscrobbler 音乐引擎设计团队的旗舰产品,以英国为总部的网络电台和音乐社区。有遍布232个国家超过1500万的活跃听众。据说有6亿音乐资源。
docker-compose.yml 配置 Navidrome 可以从 Last.fm 和 Spotify 获取专辑信息和图像。
Last.fm。首先需要一个Last.fm 免费帐户,其次你要能访问Last.fm。转到 https://www.last.fm/api/account/create 并创建一个 API 帐户。只有 应用程序名称 字段是强制性的。
账号信息

XXX: XXX

[图片]

提交表单后,可以从 API account Created 页面获取 API Key 和 Shared Secret,将上面的值复制到 Docker 的环境变量。

ND_LASTFM_ENABLED    设置 false 为完全禁用 Last.fm 集成
ND_LASTFM_APIKEY     Last.fm 获取的 API Key
ND_LASTFM_SECRET     Last.fm 获取的 Shared Secret
ND_LASTFM_LANGUAGE   用于从 Last.fm 检索的语言的两个字母代码,简体中文为 zh
Application name音狗
API key80b1d5a74507f809b98e5c0223e297d9
Shared secret98f492aae5f595f2880b674977e0efd9
Registered toxiaolaifeng

Spotify

Spotify,中文名称声田或声破天,是一个全球范围的正版音乐服务平台,于2008年10月在瑞典首都斯德哥尔摩正式上线。Spotify是目前是全球最大的流音乐服务商之一,与环球音乐集团、索尼音乐娱乐、华纳音乐集团三大唱片公司及其它唱片公司合作授权、由数字版权管理保护的音乐。
截止2020年第一季度的报告,Spotify 在全球拥有2.86亿月活跃用户,其中1.3亿为Spotify Premium付费用户。Spotify支持PC/Android安卓/苹果iOS系统,你可以在线查找最新歌曲,也可以搜索关键词,还可以建立属于自己的试听曲库。此外,Spotify还支持在线社区功能,可以参与歌曲评分互动。Spotify的全部客户端资源通用,只要一个账号就能在不同设备上共享音乐资源,让音乐试听播放变得更加轻松便利。Spotify为免费用户在Spotify听音乐时插播广告,而付费用户没有,且能享受更出色的音质。
Spotify。在 Spotify 中创建一个免费帐户,单击 Spotify 的开发者仪表板中的CREATE AN APP 按钮:https://developer.spotify.com/dashboard/applications。
填写所有字段并单击 CREATE 按钮,将值复制到 Docker 的环境变量。

ND_SPOTIFY_ID        Spotify 客户端 ID
ND_SPOTIFY_SECRET    Spotify 客户端 Secret

7 安装 Docker

安装 Docker 过程网上教程很多,下面只简单记录。
Ubuntu 系统为了安装软件速度更快,可以先更换软件源为国内软件源。
编辑文件:

sudo vim /etc/apt/sources.list

使用下面的阿里云软件源配置进行内容替换。

deb https://mirrors.aliyun.com/debian/ bullseye main non-free contrib
deb-src https://mirrors.aliyun.com/debian/ bullseye main non-free contrib
deb https://mirrors.aliyun.com/debian-security/ bullseye-security main
deb-src https://mirrors.aliyun.com/debian-security/ bullseye-security main
deb https://mirrors.aliyun.com/debian/ bullseye-updates main non-free contrib
deb-src https://mirrors.aliyun.com/debian/ bullseye-updates main non-free contrib
deb https://mirrors.aliyun.com/debian/ bullseye-backports main non-free contrib
deb-src https://mirrors.aliyun.com/debian/ bullseye-backports main non-free contrib

安装 Dokcer,直接使用一句话脚本安装。

curl -sSL https://get.daocloud.io/docker | sh

安装过程:

linux@darcy:~ $ curl -sSL https://get.daocloud.io/docker | sh
# Executing docker install script, commit: 4f282167c425347a931ccfd95cc91fab041d414f
+ sudo -E sh -c apt-get update -qq >/dev/null
+ sudo -E sh -c DEBIAN_FRONTEND=noninteractive apt-get install -y -qq apt-transport-https ca-certificates curl >/dev/null
+ sudo -E sh -c mkdir -p /etc/apt/keyrings && chmod -R 0755 /etc/apt/keyrings
+ sudo -E sh -c curl -fsSL "https://download.docker.com/linux/debian/gpg" | gpg --dearmor --yes -o /etc/apt/keyrings/docker.gpg
+ sudo -E sh -c chmod a+r /etc/apt/keyrings/docker.gpg
+ sudo -E sh -c echo "deb [arch=arm64 signed-by=/etc/apt/keyrings/docker.gpg] https://download.docker.com/linux/debian bullseye stable" > /etc/apt/sources.list.d/docker.list
+ sudo -E sh -c apt-get update -qq >/dev/null
+ sudo -E sh -c DEBIAN_FRONTEND=noninteractive apt-get install -y -qq --no-install-recommends docker-ce docker-ce-cli containerd.io docker-compose-plugin >/dev/null
+ version_gte 20.10
+ [ -z  ]
+ return 0
+ sudo -E sh -c DEBIAN_FRONTEND=noninteractive apt-get install -y -qq docker-ce-rootless-extras >/dev/null
+ sudo -E sh -c docker version
Client: Docker Engine - CommunityVersion:           20.10.21API version:       1.41Go version:        go1.18.7Git commit:        baeda1fBuilt:             Tue Oct 25 18:01:19 2022OS/Arch:           linux/arm64Context:           defaultExperimental:      trueServer: Docker Engine - CommunityEngine:Version:          20.10.21API version:      1.41 (minimum version 1.12)Go version:       go1.18.7Git commit:       3056208Built:            Tue Oct 25 17:59:41 2022OS/Arch:          linux/arm64Experimental:     falsecontainerd:Version:          1.6.10GitCommit:        770bd0108c32f3fb5c73ae1264f7e503fe7b2661runc:Version:          1.1.4GitCommit:        v1.1.4-0-g5fd4c4ddocker-init:Version:          0.19.0GitCommit:        de40ad0================================================================================To run Docker as a non-privileged user, consider setting up the
Docker daemon in rootless mode for your user:dockerd-rootless-setuptool.sh installVisit https://docs.docker.com/go/rootless/ to learn about rootless mode.To run the Docker daemon as a fully privileged service, but granting non-root
users access, refer to https://docs.docker.com/go/daemon-access/WARNING: Access to the remote API on a privileged Docker daemon is equivalentto root access on the host. Refer to the 'Docker daemon attack surface'documentation for details: https://docs.docker.com/go/attack-surface/================================================================================darcy@darcy:~ $

安装 docker-compose.

linux@darcy:~/music $ sudo apt install docker-compose
Reading package lists... Done
Building dependency tree... Done
Reading state information... Done
The following packages were automatically installed and are no longer required:libslirp0 slirp4netns
Use 'sudo apt autoremove' to remove them.
The following additional packages will be installed:apparmor cgroupfs-mount containerd docker.io git git-man liberror-perl libintl-perl libintl-xs-perl libmodule-find-perl libmodule-scandeps-perl libproc-processtable-perl libsort-naturally-perl libterm-readkey-perlneedrestart Python3-attr python3-cached-property python3-distutils python3-docker python3-dockerpty python3-docopt python3-importlib-metadata python3-jsonschema python3-lib2to3 python3-more-itertools python3-pyrsistentpython3-setuptools python3-texttable python3-websocket python3-yaml python3-zipp runc tini
Suggested packages:apparmor-profiles-extra apparmor-utils containernetworking-plugins docker-doc aufs-tools btrfs-progs debootstrap rinse rootlesskit xfsprogs zfs-fuse | zfsutils-linux git-daemon-run | git-daemon-sysvinit git-doc git-elgit-email git-gui gitk gitweb git-cvs git-mediawiki git-svn needrestart-session | libnotify-bin iucode-tool python-attr-doc python-jsonschema-doc python-setuptools-doc
Recommended packages:criu
The following packages will be REMOVED:containerd.io docker-ce docker-ce-cli docker-ce-rootless-extras
The following NEW packages will be installed:apparmor cgroupfs-mount containerd docker-compose docker.io git git-man liberror-perl libintl-perl libintl-xs-perl libmodule-find-perl libmodule-scandeps-perl libproc-processtable-perl libsort-naturally-perllibterm-readkey-perl needrestart python3-attr python3-cached-property python3-distutils python3-docker python3-dockerpty python3-docopt python3-importlib-metadata python3-jsonschema python3-lib2to3python3-more-itertools python3-pyrsistent python3-setuptools python3-texttable python3-websocket python3-yaml python3-zipp runc tini
0 upgraded, 34 newly installed, 4 to remove and 39 not upgraded.
Need to get 55.9 MB of archives.
After this operation, 45.4 MB disk space will be freed.
Do you want to continue? [Y/n] y
Get:1 https://mirrors.aliyun.com/debian bullseye/main arm64 runc arm64 1.0.0~rc93+ds1-5+deb11u2 [2,078 kB]
Get:2 https://mirrors.aliyun.com/debian bullseye/main arm64 containerd arm64 1.4.13~ds1-1~deb11u2 [14.7 MB]
Get:3 https://mirrors.aliyun.com/debian bullseye/main arm64 tini arm64 0.19.0-1 [209 kB]
Get:4 https://mirrors.aliyun.com/debian bullseye/main arm64 docker.io arm64 20.10.5+dfsg1-1+deb11u2 [28.8 MB]
Get:5 https://mirrors.aliyun.com/debian bullseye/main arm64 apparmor arm64 2.13.6-10 [601 kB]
Get:6 https://mirrors.aliyun.com/debian bullseye/main arm64 cgroupfs-mount all 1.4 [6,276 B]
Get:7 https://mirrors.aliyun.com/debian bullseye/main arm64 python3-cached-property all 1.5.2-1 [12.5 kB]
Get:8 https://mirrors.aliyun.com/debian bullseye/main arm64 python3-lib2to3 all 3.9.2-1 [77.8 kB]
Get:9 https://mirrors.aliyun.com/debian bullseye/main arm64 python3-distutils all 3.9.2-1 [143 kB]
Get:10 https://mirrors.aliyun.com/debian bullseye/main arm64 python3-websocket all 0.57.0-1 [34.3 kB]
Get:11 https://mirrors.aliyun.com/debian bullseye/main arm64 python3-docker all 4.1.0-1.2 [85.2 kB]
Get:12 https://mirrors.aliyun.com/debian bullseye/main arm64 python3-dockerpty all 0.4.1-2 [11.1 kB]
Get:13 https://mirrors.aliyun.com/debian bullseye/main arm64 python3-docopt all 0.6.2-3 [26.6 kB]
Get:14 https://mirrors.aliyun.com/debian bullseye/main arm64 python3-attr all 20.3.0-1 [52.9 kB]
Get:15 https://mirrors.aliyun.com/debian bullseye/main arm64 python3-more-itertools all 4.2.0-3 [42.7 kB]
Get:16 https://mirrors.aliyun.com/debian bullseye/main arm64 python3-zipp all 1.0.0-3 [6,060 B]
Get:17 https://mirrors.aliyun.com/debian bullseye/main arm64 python3-importlib-metadata all 1.6.0-2 [10.3 kB]
Get:18 https://mirrors.aliyun.com/debian bullseye/main arm64 python3-setuptools all 52.0.0-4 [366 kB]
Get:19 https://mirrors.aliyun.com/debian bullseye/main arm64 python3-pyrsistent arm64 0.15.5-1+b3 [58

启动 docker

# 查看docker服务是否启动
sudo systemctl status docker
# 如果没有启动
sudo systemctl start docker

8 安装音乐服务器

Navidrome是一款完全开源免费的音乐服务器,且有很多开源客户端可以直接使用,十分方便。
在这里插入图片描述

Navidrome 音乐服务器
官方也给出了如何使用 Docker 安装 Navidrome 的教程,可以点击查看。
链接:Docker 安装 Navidrome 音乐服务器

cd /home/index/server/music

编写 docker-compose.yml 文件,配置中使用 volumes 指定了配置文件夹 data,歌曲存放文件夹 folder.

version: "3"
services:navidrome:container_name: navidromeimage: deluan/navidrome:latestuser: 0:0 #0:0代表用root用户运行ports:- "4533:4533"restart: unless-stoppedenvironment:# Optional: put your config options customization here. Examples:ND_SCANSCHEDULE: 1hND_LASTFM_ENABLED:ND_LASTFM_APIKEY: key80b1d5a74507f809b98e5c0223e297d9# 修改成自己的APIKEYND_LASTFM_SECRET: secret98f492aae5f595f2880b674977e0efd9# 修改成自己的SECRETND_SPOTIFY_ID: 4cd036bsqd1594bd0b41bc8f94c46846d  # 修改成自己的IDND_SPOTIFY_SECRET: 249ca01a48be46fcb084523a6b267661bb1  # 修改成自己的SECRETND_LASTFM_LANGUAGE: zhND_LOGLEVEL: info  ND_SESSIONTIMEOUT: 24hND_BASEURL: ""ND_ENABLETRANSCODINGCONFIG: "true"ND_TRANSCODINGCACHESIZE: "4000M"ND_IMAGECACHESIZE: "1000M"volumes:- "/home/index/music/data:/data"- "/home/index/music/song:/music:ro"miniserve:image: svenstaro/miniserve:latestdepends_on:- navidromeports:- "4534:4534"volumes:- "/home/index/music/song:/downloads"  command: "-r -z -u -q -p 4534 -a dujin:www.dujin.org /downloads" restart: unless-stopped

下载 docker 镜像,等待 navidrome 镜像下载完成。

linux@darcy:~/music $ sudo docker-compose up -d
Creating network "music_default" with the default driver
Pulling navidrome (deluan/navidrome:latest)...
latest: Pulling from deluan/navidrome
9b18e9b68314: Extracting [==================================================>]  2.708MB/2.708MB
6faacaf0d83b: Downloading [=================>                                 ]  11.49MB/32.64MB
4f4fb700ef54: Download complete
e67430195958: Downloading [========>                                          ]  2.203MB/13.64MB

9 音乐上传

歌曲的来源这里不细说,本人百度云盘收藏n多音乐资源。部分整理已分享,请自取。 更多请加qq407737980,获取
链接: https://pan.baidu.com/s/124fGXC44QjTnJfubXf8CmA 提取码: jppg 复制这段内容后打开百度网盘手机App,操作更方便哦

这里直接使用 scp 命令进行上传,需要在歌曲所在文件夹下运行。

  • • ./* 表示上传当前目录所有文件。
  • • root@192.168.0.7 为服务器用户名和 IP.
  • • :/home/index/music/folder 为上传到的路径。
➜  folder scp ./* XX@1XX:/home/index/music/folder
XX@X's password:
GALA - 追梦赤子心.mp3                        100%   13MB   7.0MB/s   00:01
伍佰 - 晚风.mp3                              100% 4102KB   9.4MB/s   00:00
暗杠 - 狂草.mp3                              100% 9693KB   9.1MB/s   00:01
被动(Live).mp3                               100% 4463KB  10.4MB/s   00:00
刘德华 - 17岁 (Live).mp3                      100%   12MB  10.0MB/s   00:01
张雨生 - 我期待.mp3                            100%   14MB   6.8MB/s   00:02
赵英俊 - 方的言.ncm

使用miserver上传

打开浏览器,输入ip:4534,输入docker-compose.yaml文件末尾预先设置的用户名和密码(如果你没有改动的话,用户名dujin,密码www.dujin.org),就可以进入音乐上传页面了。
[图片]

当我们上传音乐文件之后,点击头像左边的图标(刷新&运行情况)可以快速扫描音乐文件。
[图片]

个人感觉宝塔的可视化上传更加方便,这也意味着还可以配置宝塔 FTP,甚至挂载网盘来进行扩容、保存、备份你的音乐文件。
注意: 上传完毕,在浏览器navidrome刷新
[图片]

启动音乐服务器

先使用 sudo docker ps -a 查看 Navidrome 是否已经启动了,如果没有启动可以使用 docker start id 进行启动。服务的默认端口是 4533。

linux@darcy:~ $ sudo docker ps -a
CONTAINER ID   IMAGE                     COMMAND            CREATED       STATUS                 PORTS                    NAMES
97a8a2681179   deluan/navidrome:latest   "/app/navidrome"   2 weeks ago   Up 6 hours (healthy)   0.0.0.0:4533->4533/tcp   music_navidrome_1
docker run 容器id
docker restart容器id

常见问题
docker 容器启动成功 外部访问不到原因 本机访问成功
Centos8 安装 Docker 后容器端口无法访问

centos8防火墙启动 systemctl start firewalld
防火墙启动 systemctl stop firewalld
查看状态 systemctl status firewalld
查看开放的端口  firewall-cmd --list-ports
查看需要开放的端口 netstat -lnpt
打开我们所需的端口 firewall-cmd --permanent --add-port=4533/tcp等
然后其他服务器telnet  ip  port  不通
永久开启 IP 地址转发 firewall-cmd --add-masquerade --permanent
刷新配置  firewall-cmd --reload
重新telnet,完成

浏览器访问:账号

IP:PORT 访问音乐服务,Navidrome 为 PC 端和手机端已经适配了不同的 UI 界面。
[图片]

配置 账号:密码
PC 浏览器:http://192.168.0.7:4533/
[图片]

navidrome pc 端
移动浏览器:
[图片]

navidrome 手机端
Navidrome 的管理功能尚可,点击右上角的头像,可以新增用户,可以为其他人创建一个登录账户。
使用 APP 访问

10 Navidrome 第三方客户端

Navidrome 除了网页界面,还支持各种第三方客户端:

  • iOS: play:Sub, substreamer, Amperfy and iSub
  • Android: DSub, Subtracks, substreamer, Ultrasonic and Audinaut,Subsonic
  • Web: Subplayer, Airsonic Refix, Aurial, Jamstash and Subfire
  • Desktop: Sublime Music (Linux) and Sonixd (Windows/Linux/macOS)
  • CLI: Jellycli (Windows/Linux) and STMP (Linux/macOS)
  • Connected Speakers:
    • Sonos: bonob
    • Alexa: AskSonic
  • Other:
    • Subsonic Kodi Plugin
    • Navidrome Kodi Plugin
    • HTTPDirFS
      感兴趣的同学可以先从在线 DEM

Substreamer

兼容 Navidrome 的 APP 有很多,这里我使用 Substreamer 这款 APP,界面算得上简洁,使用体验尚可。
[图片]

substreamer app
初次启动需要进行登录,可以使用刚刚新增的用户进行登录。
[图片]

歌曲界面:
[图片]

Subtracks

http://m.289.com/azrj/469481.html

Subsonic

https://subsonic-music-streamer.en.softonic.com/android/download?ex=DINS-635.0
外网访问
如果已经是使用云服务器进行部署,那么因为有相应的公网 IP,其实已经可以直接使用公网 IP 访问了。
但是如果使用的树莓派或者家里的其他机器进行部署的,因为没有公网 IP ,只能局限在家庭局域网内,就会让公网访问十分困难。这时有下面的几个方案。

  1. 如果你的宽带运营商每次会分配公网 IP,刚好你又有一个域名,那么可以使用 DNS 服务商提供的 API 进行动态 DNS 配置,让域名总能解析到运营商分配给你的公网 IP。
  2. 如果你有公网服务器,可以使用类似于 FRP 这样的内网穿透工具,借助公网服务器暴露局域网服务。
    FRP GitHub:https://github.com/fatedier/frp/releases
    FRP 通过自定义域名访问内网的 Web 服务:https://gofrp.org/docs/examples/vhost-http/

本文来自互联网用户投稿,该文观点仅代表作者本人,不代表本站立场。本站仅提供信息存储空间服务,不拥有所有权,不承担相关法律责任。如若转载,请注明出处:http://www.hqwc.cn/news/101353.html

如若内容造成侵权/违法违规/事实不符,请联系编程知识网进行投诉反馈email:809451989@qq.com,一经查实,立即删除!

相关文章

IDEA中Run/Debug Configurations添加VM options和Program arguments

1. 现象描述 我在我的IDEA当中打开配置模板后,发现没有VM options和Program arguments,也就是虚拟机选项和程序实参这两项,导致我不能配置系统属性参数和命令行参数!!!!!&#xff0…

Kotlin

函数命名 针对您目前为止学到的 Kotlin 知识,下面给出了一些相关样式指南: 函数名称应采用驼峰式大小写形式,并且应该是动词或动词短语。每个语句都应单独占一行。左花括号应出现在函数开始行的末尾。左花括号前应有一个空格。 变量声明 变…

2023全国大学生数学建模ABCDE选题建议,思路模型,小白要怎么选?难度怎么样

首先最重要的&#xff0c;难度C<B<A&#xff0c;D、E题推荐选E题 大家可以查看我们的视频讲解&#xff0c;在这里&#xff1a;【2023全国大学生数学建模竞赛选题建议&#xff0c;难度分析&#xff0c;小白应该怎么选】 https://b23.tv/S6O26uc 选题建议视频播放​b23.t…

2023高教社杯 国赛数学建模A题思路 - 定日镜场的优化设计

1 赛题 A 题 定日镜场的优化设计 构建以新能源为主体的新型电力系统&#xff0c; 是我国实现“碳达峰”“碳中和”目标的一项重要 措施。塔式太阳能光热发电是一种低碳环保的新型清洁能源技术[1]。 定日镜是塔式太阳能光热发电站(以下简称塔式电站)收集太阳能的基本组件&…

Linux系统中实现便捷运维管理和远程访问的1Panel部署方法解析

文章目录 前言 前言 1Panel 是一个现代化、开源的 Linux 服务器运维管理面板。高效管理,通过 Web 端轻松管理 Linux 服务器&#xff0c;包括主机监控、文件管理、数据库管理、容器管理等下面我们介绍在Linux 本地安装1Panel 并结合cpolar 内网穿透工具实现远程访问1Panel 管理…

OCR训练部署文档

Cuda安装 wget https://developer.download.nvidia.com/compute/cuda/11.6.0/local_installers/cuda_11.6.0_510.39.01_linux.run sh cuda_11.6.0_510.39.01_linux.run#可能会报错&#xff0c;查看/var/log/nvidia-installer.log &#xff0c;kill -9 [ID]可以解决vim ~/.bash…

grid弹性布局 设置宽高一致

效果图如下&#xff1a; 例子&#xff1a;设置每行四列的弹性布局&#xff0c;每个盒子宽高相同&#xff0c;间距为10px .left_list{display: grid;grid-gap: 10px 10px;grid-template-columns: repeat(4,1fr);.list_item{height: 0;padding-bottom:100%;/*高度设置为0&#…

c高级day2

整理思维导图 写一个1.sh脚本&#xff0c;将以下内容放到脚本中&#xff1a; 在家目录下创建目录文件&#xff0c;dir 在dir下创建dir1和dir2 把当前目录下的所有文件拷贝到dir1中&#xff0c; 把当前目录下的所有脚本文件拷贝到dir2中 把dir2打包并压缩为dir2.tar.xz 再…

Windows 操作系统下 Python 及其模块的管理

Python 是一款解释型语言&#xff0c;理论上一个.py文件可以当成一个稍微复杂一些的字符串指令集本文不涉及jupyter,VS,VScode,Pycharm 等集成开发环境&#xff0c;这不是我们这篇文章所关心的东西 这篇文章面向的是Python 的初学者 最近没有写太多长文章&#xff0c;多写几篇&…

2023全国大学生数学建模竞赛B题思路模型代码

目录 一.选题建议先发布&#xff0c;思路模型代码论文第一时间更新&#xff0c;获取见文末名片 二.选题建议&#xff0c;后续思路代码论文 B 题 多波束测线问题 各题分析 获取完整思路代码见此处名片 一.选题建议先发布&#xff0c;思路模型代码论文第一时间更新&#xff…

【javaweb】学习日记Day9 - Mybatis 基础操作

目录 一、删除 &#xff08;1&#xff09;在mapper接口执行sql删除语句 ① 注解后sql语句没有提示怎么办&#xff1f; &#xff08;2&#xff09;测试层 &#xff08;3&#xff09;开启mybatis日志 &#xff08;4&#xff09;预编译SQL 二、新增 &#xff08;1&#…

C++QT day2

作业 1> 封装一个结构体&#xff0c;结构体中包含一个私有数组&#xff0c;用来存放学生的成绩&#xff0c;包含一个私有变量&#xff0c;用来记录学生个数&#xff0c; 提供一个公有成员函数&#xff0c;void setNum(int num)用于设置学生个数 提供一个公有成员函数&…