Skip to content

Conversation

@wanhhe
Copy link

@wanhhe wanhhe commented Jan 23, 2026

Create 'saves' directory if it does not exist before saving audio when running example infer_s2s.py

Problem:
Since torchaudio.save() does not automatically create directories, running the example script examples/infer_s2s.py directly will result in an error.

  File "/root/miniconda3/lib/python3.12/site-packages/soundfile.py", line 343, in write
    with SoundFile(file, 'w', samplerate, channels,
         ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^
  File "/root/miniconda3/lib/python3.12/site-packages/soundfile.py", line 658, in __init__
    self._file = self._open(file, mode_int, closefd)
                 ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^
  File "/root/miniconda3/lib/python3.12/site-packages/soundfile.py", line 1216, in _open
    raise LibsndfileError(err, prefix="Error opening {0!r}: ".format(self.name))
soundfile.LibsndfileError: Error opening 'saves/output_audio_xxx.wav': System error.

Create 'saves' directory if it does not exist before saving audio when running example `infer_s2s.py`
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

1 participant