Revert speaker play argument fix

Already cherry-picked in a version of this.
This commit is contained in:
Jonathan Coates 2024-03-29 09:49:35 +00:00
parent f9c9b6b119
commit deda0bb2ec
No known key found for this signature in database
GPG Key ID: B9E431FF07C98D06
1 changed files with 3 additions and 6 deletions

View File

@ -49,10 +49,6 @@ elseif cmd == "play" then
local speaker = get_speakers(name)[1]
if not file then
error("Usage: speaker play <file or url> [speaker]", 0)
end
local handle, err
if http and file:match("^https?://") then
print("Downloading...")
@ -167,8 +163,9 @@ elseif cmd == "sound" then
local speaker = get_speakers(name)[1]
if speaker.playSound(sound, volume, pitch) then
print(("Played sound %q on speaker %q with volume %s and pitch %s."):format(sound, peripheral.getName(speaker),
volume or 1, pitch or 1))
print(("Played sound %q on speaker %q with volume %s and pitch %s."):format(
sound, peripheral.getName(speaker), volume or 1, pitch or 1
))
else
error(("Could not play sound %q"):format(sound), 0)
end