1
0
mirror of https://github.com/SquidDev-CC/CC-Tweaked synced 2025-01-08 08:20:29 +00:00

Fixed linting

This commit is contained in:
MCJack123 2024-08-08 00:42:19 -04:00
parent b04914065a
commit 3686d2ddc9
No known key found for this signature in database
GPG Key ID: 1D99413F734AA894
2 changed files with 9 additions and 9 deletions

View File

@ -14,7 +14,7 @@ This function takes in the binary data from a WAV file, and outputs a more
usable table format with all the metadata and file audio inside. It also has a
[`readWAVFile`] function to simplify reading from a single file.
@see cc.audio.play To play the chunk decoded by this module.
@see speaker.playAudio To play the chunks decoded by this module.
@since 1.113.0
@usage Reads "data/example.wav" into a table, prints its codec, sample rate,
and length in seconds, and plays the audio on a speaker.
@ -53,7 +53,7 @@ local wavExtensible = {
alaw = uuidBytes "06000000-0000-1000-8000-00aa00389b71",
ulaw = uuidBytes "07000000-0000-1000-8000-00aa00389b71",
adpcm = uuidBytes "11000000-0000-1000-8000-00aa00389b71",
pcm_float = uuidBytes "03000000-0000-1000-8000-00aa00389b71"
pcm_float = uuidBytes "03000000-0000-1000-8000-00aa00389b71",
}
local wavMetadata = {
@ -77,7 +77,7 @@ local wavMetadata = {
IGNR = "genre",
ICMT = "comment",
ICOP = "copyright",
ILNG = "language"
ILNG = "language",
}
--[[- Read WAV data into a table.
@ -99,7 +99,7 @@ Channel data is in the same format as `speaker.playAudio` takes: 8-bit signed nu
]]
local function readWAV(data)
expect(1, data, "string")
local bitDepth, length, dataType, blockAlign, coefficients
local bitDepth, dataType, blockAlign
local temp, pos = str_unpack("c4", data)
if temp ~= "RIFF" then error("bad argument #1 (not a WAV file)", 2) end
pos = pos + 4
@ -159,7 +159,7 @@ local function readWAV(data)
return table.unpack(res)
end
else
local format = (dataType == "unsigned" and "I" .. (bitDepth / 8) or (dataType == "signed" and "i" .. (bitDepth / 8) or "f"))
local format = dataType == "unsigned" and "I" .. (bitDepth / 8) or (dataType == "signed" and "i" .. (bitDepth / 8) or "f")
local transform
if dataType == "unsigned" then
function transform(n) return n - 128 end