PHPackages                             suifengtec/weather-forcast - PHPackages - PHPackages  [Skip to content](#main-content)[PHPackages](/)[Directory](/)[Categories](/categories)[Trending](/trending)[Leaderboard](/leaderboard)[Changelog](/changelog)[Analyze](/analyze)[Collections](/collections)[Log in](/login)[Sign up](/register)

1. [Directory](/)
2. /
3. suifengtec/weather-forcast

ActiveLibrary

suifengtec/weather-forcast
==========================

weather-forcast for Chinese

05PHP

Since Jan 11Pushed 8y ago1 watchersCompare

[ Source](https://github.com/suifengtec/weatherforcast)[ Packagist](https://packagist.org/packages/suifengtec/weather-forcast)[ RSS](/packages/suifengtec-weather-forcast/feed)WikiDiscussions master Synced 2mo ago

READMEChangelogDependenciesVersions (1)Used By (0)

weather
=======

[](#weather)

作用
--

[](#作用)

用心知天气免费的API接口,获取天气预报,然后使用百度语音合成语音放入本地文件,然后把天气预报播放出来,播放后删除生成的语音文件。

需求
--

[](#需求)

支持的操作系统: Linux(在Ubuntu 和 LinuxMint 上进行了测试) 或 Windows 10; 执行 PHP : PHP 5.3+; 编译命令行可用的 mp3 播放器: Windows 10 操作系统需要确保安装了 go 语言或者 gcc 可用;

获取项目代码
------

[](#获取项目代码)

```

git clone https://github.com/suifengtec/weatherforcast

```

准备
--

[](#准备)

登录[百度AI应用控制台](https://console.bce.baidu.com/ai/),创建个应用,记得点选" 百度语音",然后把应用相关的信息,放进 `config.php`;

到[心知天气](https://www.seniverse.com/)注册个免费账号,使用其免费接口,然后把应用相关信息,放进 `config.php`;

命令行播放语音文件
---------

[](#命令行播放语音文件)

Linux
-----

[](#linux)

以 Ubuntu 和 LinuxMint 为例:

```
sudo apt update
sudo apt upgrade
sudo apt  install sox libsox-fmt-all

```

### Windows 10

[](#windows-10)

需要有支持命令行播放的播放器,虽然可以用 start 命令,但是为了让这篇文章更加丰满,我就加点儿料吧,以下两种播放器方案,任选其一即可:

### Go 语言的mp3命令行播放器

[](#go-语言的mp3命令行播放器)

命令行执行

```
go get github.com/hajimehoshi/go-mp3
go get github.com/hajimehoshi/oto

```

在项目根目录执行:

```

go build playmp3go.go
playmp3go classic.mp3

```

能听到音乐就说明命令行播放器编译成功.

### C语言的mp3命令行播放器

[](#c语言的mp3命令行播放器)

确保 gcc 可用, 在项目根目录执行:

```
gcc playmp3c.c -lwinmm -o playmp3c.exe
playmp3c classic.mp3

```

能听到音乐就说明命令行播放器编译成功.

使用
--

[](#使用)

确保安装了 PHP, 在命令行执行:

```
php -S 127.0.0.1:8080

```

浏览器打开  , 就能听到了。

###  Health Score

19

—

LowBetter than 10% of packages

Maintenance20

Infrequent updates — may be unmaintained

Popularity4

Limited adoption so far

Community4

Small or concentrated contributor base

Maturity41

Maturing project, gaining track record

How is this calculated?**Maintenance (25%)** — Last commit recency, latest release date, and issue-to-star ratio. Uses a 2-year decay window.

**Popularity (30%)** — Total and monthly downloads, GitHub stars, and forks. Logarithmic scaling prevents top-heavy scores.

**Community (15%)** — Contributors, dependents, forks, watchers, and maintainers. Measures real ecosystem engagement.

**Maturity (30%)** — Project age, version count, PHP version support, and release stability.

### Community

Maintainers

![](https://www.gravatar.com/avatar/f2b72ecdba07b4d1e52452ad133cfb9ab791dffd21e6aaf622407f2a95aee36a?d=identicon)[suifengtec](/maintainers/suifengtec)

### Embed Badge

![Health badge](/badges/suifengtec-weather-forcast/health.svg)

```
[![Health](https://phpackages.com/badges/suifengtec-weather-forcast/health.svg)](https://phpackages.com/packages/suifengtec-weather-forcast)
```

PHPackages © 2026

[Directory](/)[Categories](/categories)[Trending](/trending)[Changelog](/changelog)[Analyze](/analyze)
