twardoch / audiostretchy

AudioStretchy is a Python wrapper around the `audio-stretch` C library, which performs fast, high-quality time-stretching of WAV/MP3 files without changing their pitch. Works well for speech, can time-stretch silence separately.
https://pypi.org/project/audiostretchy/
BSD 3-Clause "New" or "Revised" License
31 stars 2 forks source link

OSError: exception: access violation writing 0x00000284C1557000 #4

Open musakhawaja opened 1 year ago

musakhawaja commented 1 year ago

hello, i keep getting this error when using audiostretchy for a wav to wav speedup. any help would be appreciated. I am running it on windows

code: from audiostretchy.stretch import stretch_audio stretch_audio("input.wav", "output.wav", ratio=1.1)

error: OSError Traceback (most recent call last) ~\AppData\Local\Temp\ipykernel_16828\3037458555.py in 1 from audiostretchy.stretch import stretch_audio 2 ----> 3 stretch_audio("input.wav", "output.wav", ratio=1.1)

~\anaconda3\lib\site-packages\audiostretchy\stretch.py in stretch_audio(input_path, output_path, ratio, gap_ratio, upper_freq, lower_freq, buffer_ms, threshold_gap_db, double_range, fast_detection, normal_detection, sample_rate) 354 audio_stretch = AudioStretch() 355 audio_stretch.open(input_path) --> 356 audio_stretch.stretch( 357 ratio, 358 gap_ratio,

~\anaconda3\lib\site-packages\audiostretchy\stretch.py in stretch(self, ratio, gap_ratio, upper_freq, lower_freq, buffer_ms, threshold_gap_db, double_range, fast_detection, normal_detection) 314 stretcher.output_capacity(self.nframes, ratio), dtype=np.int16 315 ) --> 316 num_samples = stretcher.process_samples( 317 self.in_samples, len(self.in_samples), self.samples, ratio 318 )

~\anaconda3\lib\site-packages\audiostretchy\interface\tdhs.py in process_samples(self, samples, num_samples, output, ratio) 114 :return: The number of processed samples. 115 """ --> 116 return self.stretch_samples(self.handle, samples, num_samples, output, ratio) 117 118 def flush(self, output: np.ndarray) -> int:

OSError: exception: access violation writing 0x00000284C17F7000

musakhawaja commented 1 year ago

The code is running fine on a linux machine but the audio being produced has white noise after about 5 seconds, any suggestions on how to fix it?

ducktailcat commented 11 months ago

I'm getting a similar error on Windows 11

It's the same for wav and mp3 files using the stretch_audio() or the AudioStretch() method

File "d:\Python\Pydub\main.py", line 3, in stretch_audio("alabama-jam.wav", "output.wav", ratio=1.1) File "D:\Python\Pydub\venv-speed\lib\site-packages\audiostretchy\stretch.py", line 356, in stretch_audio audio_stretch.stretch( File "D:\Python\Pydub\venv-speed\lib\site-packages\audiostretchy\stretch.py", line 316, in stretch num_samples = stretcher.process_samples( File "D:\Python\Pydub\venv-speed\lib\site-packages\audiostretchy\interface\tdhs.py", line 116, in process_samples return self.stretch_samples(self.handle, samples, num_samples, output, ratio) OSError: exception: access violation writing 0x00000156A6664000

MASSKAgithub commented 7 months ago

Will this bug be ever fixed? i have the exact same bug

Worked PERFECTLY first 3 minutes then this started to happen, rebooted PC, reinstalled the module, NOTHING HELPS wtf

shawn-mek commented 4 months ago

Same OSError. Would love a fix.