跳到正文

CC: Jukebox

作者:diggydwarff

Turn your jukebox into a live radio station with CC: Tweaked

收藏

介绍

中文介绍正在准备中,下面暂时显示原文。

CC: Jukebox lets ComputerCraft computers broadcast music from a playing jukebox to remote CC speakers.

 

Listeners join at the current point in the song. Removing the disc stops playback.

  • Includes a ready-to-use jukebox_radio program
  • Broadcast to multiple receiving computers
  • Designed for server-side installation or singleplayer

Run jukebox_radio broadcast on a computer beside the jukebox, then jukebox_radio receive <sender-ID> on a computer with a speaker. Both computers need modems.

Lua API

 

Find a connected jukebox with peripheral.find("jukebox"). Direct connections and wired modem networks are supported.

  • hasRecord() – checks whether a disc is inserted.
  • isPlaying() – checks whether the jukebox is playing
  • getRecord() – returns the disc’s item ID, sound ID, title, duration, playback state, and elapsed time
  • readAudio(cursor?, token?) – reads audio chunks from the current playback position

readAudio() returns a table with a status: loading, audio, waiting, stopped, ended, or error. Audio results include audio, token, cursor, and next. Pass next and token into the following call to continue smoothly.

Audio is a binary string of 48 kHz mono PCM bytes. Convert each byte with audio:byte(i) - 128 before passing the sample table to speaker.playAudio(). Custom programs can relay these chunks over Rednet.

 

Ready-made radio commands

jukebox_radio broadcast
jukebox_radio receive <senderComputerID> [volume]
jukebox_radio local

Receivers join the current part of the song. The jukebox and participating computers must remain loaded.

常见问题

CC: Jukebox 支持哪些 Minecraft 版本?

CC: Jukebox 支持 Minecraft Java 版 1.20.1–1.21.1,共 2 个版本,可用的加载器:Forge / NeoForge。下载时注意选择和你游戏版本一致的文件。

CC: Jukebox 怎么安装?

先用 PCL2 或 HMCL 启动器安装对应版本的 Forge / NeoForge,再把下载的 .jar 文件放进游戏目录的 mods 文件夹,重新启动游戏即可。开启了版本隔离的,mods 文件夹在 versions/版本名 下面。

评论

登录后评论和评分

diggydwarff 的其他作品

查看全部 →