Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

sf.write crash in Windows with Hi-Fi data #243

Open
Vichoko opened this issue Oct 26, 2019 · 1 comment
Open

sf.write crash in Windows with Hi-Fi data #243

Vichoko opened this issue Oct 26, 2019 · 1 comment

Comments

@Vichoko
Copy link

Vichoko commented Oct 26, 2019

I'm working with some high-quality audio data with 10,000,000 samples and a bitrate of 44,100 samples/sec.
When i do sf.write in .ogg format it crashes without an exception.

Specs

SO: Windows 10
RAM: 8 GB
CPU: i5-8 gen
Python: 3.7.3
Installed with:

conda install cffi numpy
pip install pysoundfile

Reproduce

import numpy as np
import soundfile as sf

wav = np.asarray([
    np.random.normal(size=10000000), 
    np.random.normal(size=10000000)]
    )
# normalize from max_to_min to 1_to_-1
wav = wav - np.amin(wav)
wav = wav / np.amax(wav)
wav = wav * 2 -1
wav = np.swapaxes(wav, 0, 1) # shape (9000000, 2)
sf.write('fote.ogg', wav, 44100)

What happens

The program crashes without exception.
Python just closes with errno -1073741571
No .ogg file is exported.

If i lower the samples to 100,000 the export works fine:


import numpy as np
import soundfile as sf

wav = np.asarray([
    np.random.normal(size=100000), 
    np.random.normal(size=100000)]
    )
# normalize from max_to_min to 1_to_-1
wav = wav - np.amin(wav)
wav = wav / np.amax(wav)
wav = wav * 2 -1
wav = np.swapaxes(wav, 0, 1) # shape (9000000, 2)
sf.write('fote.ogg', wav, 44100)
print('success')
# this works successfully

Expectation

I expect the function exports the data as an .ogg format because is light.
Note that with .wav and .flac files works fine, but the file size is too big for the scale i'm working.

Any ideas?

PD: I've been trying to export as .mp3 too without success.

@mgeier
Copy link
Contributor

mgeier commented Oct 30, 2019

This sounds very similar to #233.

Another open issue (probably unrelated) with OGG files is described in #130.

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

No branches or pull requests

2 participants