savePcmToWav

fun savePcmToWav(pcmData: ByteArray, filePath: String, sampleRate: Float, channels: Int)

Saves PCM byte array as a WAV file.

Parameters

pcmData

Raw PCM data

filePath

Path to save the WAV file (e.g., "output.wav")

sampleRate

Sampling rate (e.g., 24000.0f or 44100.0f)

channels

Number of channels (1 for mono, 2 for stereo)