python适合做游戏的背景音乐_一个实现无缝和无休止地重复播放音乐的Python脚本,可用于视频游戏音乐...

Looper

A script for repeating music seamlessly and endlessly, designed with video game music in mind.

Installation

This script requires Python 3 to run, along with the NumPy and mpg123 packages. Once you have Python 3 installed, and this repository cloned or downloaded, you can install any needed packages using the following command:

pip install -r requirements.txt

This program also requires the external library mpg123, which is available here: https://www.mpg123.de/download.shtml

Usage

Looper is run from the command line as follows:

python3 loop.py track.mp3

If track.mp3 is a valid .mp3 file, then Looper will find as good a loop point as it can, and will then play the song on repeat, forever. (The program can be terminated using Ctrl+C.)

Limitations

At this point, Looper only supports .mp3 files. If you would like to see support for other audio formats, such as .ogg or .flac, let me know - or, better yet, feel free to send a pull request!

Looper currently requires an extended period of time (about 20 seconds) where the song already repeats itself, in order to confirm the precise loop point. If the song does not repeat, or it repeats less than that (or not at all), then it will loop, but it may do so at strange points (such as repeatedly looping over a few seconds.) If there is a song that you think Looper should be able to handle but find it cannot, please feel free to contact me (or, again, to fork this repository and improve upon it.)

  • 0
    点赞
  • 0
    收藏
    觉得还不错? 一键收藏
  • 0
    评论
评论
添加红包

请填写红包祝福语或标题

红包个数最小为10个

红包金额最低5元

当前余额3.43前往充值 >
需支付:10.00
成就一亿技术人!
领取后你会自动成为博主和红包主的粉丝 规则
hope_wisdom
发出的红包
实付
使用余额支付
点击重新获取
扫码支付
钱包余额 0

抵扣说明:

1.余额是钱包充值的虚拟货币,按照1:1的比例进行支付金额的抵扣。
2.余额无法直接购买下载,可以购买VIP、付费专栏及课程。

余额充值