Closed el-tocino closed 4 years ago
what about
output = StringIO.StringIO()
sound.export(output, format="mp3")
note: You can pass in a file-like object to .export() such as StringIO if you prefer, but you should know that internally pydub will still create a temporary file on disk (which is given to ffmpeg as path to store output when transcoding).
https://github.com/el-tocino/localcroft/blob/02c8d8aae0a4d79e810328e684811b8473f38e6d/mycroft-core/mycroft/stt/__init__.py#L307 https://github.com/el-tocino/localcroft/blob/02c8d8aae0a4d79e810328e684811b8473f38e6d/mycroft-core/mycroft/stt/__init__.py#L308 There's got to be a way to skip writing a temp file just to read it back in.