sndfileio.sndwrite_chunked_like(outfile, likefile, sr=None, metadata=None)[source]

Create a SndWriter with samplerate/format/encoding of the source file

  • outfile (str) – the file to open for writing

  • likefile (str) – the file to use as reference

  • sr (Optional[int]) – samplerate can be overridden

  • metadata (Optional[dict[str, str]]) – a dict {str: str}, overrides metadata in likefile. Metadata is not merged, so if metadata is given, it substitutes the metadata in likefile completely. In order to merge it, do that beforehand If None is passed, the metadata in likefile is written to outfile

Return type:



a SndWriter. Call write() on it to write to the file