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

Memory Error for large audio files #16

Open
nicolls1 opened this issue Apr 5, 2016 · 3 comments
Open

Memory Error for large audio files #16

nicolls1 opened this issue Apr 5, 2016 · 3 comments

Comments

@nicolls1
Copy link

nicolls1 commented Apr 5, 2016

22 minute audio file
mfcc(signal, samplerate=16000, numcep=26, lowfreq=300, highfreq=4000, appendEnergy=True)

File "/vagrant/dossier/gsapi/memo/features/base.py", line 54, in mfcc
feat,energy = fbank(signal,samplerate,winlen,winstep,nfilt,nfft,lowfreq,highfreq,preemph)
File "/vagrant/dossier/gsapi/memo/features/base.py", line 80, in fbank
frames = sigproc.framesig(signal, winlen_samplerate, winstep_samplerate)
File "/vagrant/dossier/gsapi/memo/features/sigproc.py", line 55, in framesig
return frames*win
MemoryError

I am just calling it in batches for now to avoid this problem but might be something the library should better handle.

@philipperemy
Copy link

philipperemy commented Nov 14, 2016

Are there any strong reasons why you cannot split this file into smaller files?
How big is your 22-minute file in MB?
Thanks

@ainy
Copy link

ainy commented Mar 1, 2017

You can replace the line that ate your RAM:
return frames*win
with
return frames

This multiplication does nothing, just a wast of RAM. No one seems to use this window function. It is called once with only one argument - frame_len which is a parameter to the calling function. So there is no need for this to be a function.

@ainy
Copy link

ainy commented Mar 1, 2017

It would be best to make the default value winfunc=lambda frame_len, numframes: 1 and the last lines:

   win = winfunc(frame_len, numframes)
    return frames*win

To use window function in old way you pass winfunc=lambda frame_len, numframes: numpy.ones((numframes,frame_len))

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

3 participants