bastibe / python-soundfile

SoundFile is an audio library based on libsndfile, CFFI, and NumPy
BSD 3-Clause "New" or "Revised" License
676 stars 105 forks source link

soundfile crashes when trying to export long .ogg file #417

Closed humandream1 closed 8 months ago

humandream1 commented 8 months ago
import numpy as np
import soundfile as sf 

print(sf.__version__) 
# '0.12.1'

sr = 44100 
y = np.random.random((sr*10, 2)) 
sf.write('test.ogg', y, sr)  # fine

yy = np.random.random((sr*20, 2)) 
sf.write('test.wav', y, sr) # fine
sf.write('test.ogg', y, sr) # program crashes without any error message 

I found that soundfile suddenly crashes when trying to write audio of a certain length or longer. program terminates without producing any message. it seems to occur only when writing to an ogg format and for audio longer than a certain length.

Does anyone know the reason? My python is 3.11.6 and my OS is Windows 11.

humandream1 commented 8 months ago

I found that it is a duplicate of https://github.com/bastibe/python-soundfile/issues/396 .