writeToFile

suspend fun AudioFlow.writeToFile(format: AudioFileFormat, path: Path)

Collects this flow and writes the PCM data to a file at path.

format selects the container and header (WAV, AIFF, or AU). The file content reflects this flow's AudioFlow.format, encoded in that container.