Closed
Description
Hi,
I'm still seeing IOError: [Errno 24] Too many open files: even though I think the issue was resolved in #798 and #791. Should I still be getting this issue on linux? Is my usage incorrect or is there still an underlying issue?
Info:
Centos 5.8 (Final) - 2.6.18-308.16.1.el5 #1 SMP Tue Oct 2 22:01:37 EDT 2012 i686 i686 i386 GNU/Linux
Python 2.7.3 (default, Nov 1 2012, 08:11:26) - Compiled from source
Matplotlib version = '1.1.1'
version__numpy = '1.4'
Traceback:
Traceback (most recent call last):
File "voicetest.py", line 702, in <module>
File "voicetest.py", line 698, in main
File "voicetest.py", line 106, in controller
File "voicetest.py", line 649, in run
File "voicetest.py", line 508, in recordResults
File "/root/workspaces/voicetest/voiceanalysis.py", line 116, in PlotVoice
File "/usr/local/lib/python2.7/site-packages/matplotlib/pyplot.py", line 471, in savefig
File "/usr/local/lib/python2.7/site-packages/matplotlib/figure.py", line 1185, in savefig
File "/usr/local/lib/python2.7/site-packages/matplotlib/backend_bases.py", line 2021, in print_figure
File "/usr/local/lib/python2.7/site-packages/matplotlib/backends/backend_agg.py", line 474, in print_png
IOError: [Errno 24] Too many open files: 'logs/20121108_175128/test_1011/origcall.png'
Code Snippet:
Gets call many times during runtime. Voice stream hands back 160*s16s for each iteration.
def PlotVoice(voice, prefix, samplefreq=8000.0):
# Organise the voice stream
v = []
for f in voice.voiceStream(-1):
v.extend(f)
# Amplitude vs. time
figure(figsize=(16.0, 10.0))
subplot(221)
title('Amplitude vs. Time')
xlabel('Time (s)')
ylabel('Amplitude (s16)')
ylim([-8000, 8000])
tm = arange(len(v))/samplefreq
plot(tm, v)
# Spectragram
subplot(222)
title('Spectragram')
specgram(v)
# FFT
subplot(223)
title('FFT')
n = len(v) # length of the signal
k = arange(n)
T = n/samplefreq
frq = k/T # two sides frequency range
frq = frq[range(n/2)] # one side frequency range
Y = fft(v)/n # fft computing and normalization
Y = Y[range(n/2)]
plot(frq,abs(Y),'r') # plotting the spectrum
xlabel('Freq (Hz)')
ylabel('|Y(freq)|')
savefig(prefix)
close()
Metadata
Metadata
Assignees
Labels
No labels