INNER CODE UNIT · Swift

totalFrames

pa-jesusf/KikoFlu · ios/Runner/AppDelegate.swift:484

            let totalFrames = min(frames, maxFloatSamples / channels)
            for frameIndex in 0..<totalFrames {
                if let maxEnergyFrames, energies.count >= maxEnergyFrames {
                    break
                }

                let sampleOffset = frameIndex * channels
                for channel in 0..<channels {
                    let sample = Double(samples[sampleOffset + channel])
                    pendingSumSquares += sample * sample
                }
                pendingSampleCount += channels
                pendingFrameSamples += 1

                if pendingFrameSamples >= frameLength {
                    let rms = pendingSampleCount > 0
                        ? sqrt(pendingSumSquares / Double(pendingSampleCount))
                        : 0

View source record →

📰 Research Paper
Loading…
⏳ Fetching content…