I have placed two sounds files here:
https://www.dropbox.com/sh/hby9gzy5ko546vx/AAAY5p2hAR9oNdkRdAE6rmr8a
bat3.wav is 1 second in duration and bat5.wav is 5 seconds in duration.
Import works for both files; it is the List3DPlot where I get the "no more memory available" error (or sometimes the Pi just freezes).
This is the output when processing bat5.wav:
In[1]:= snd = Import["/home/pi/bat5.wav"];
ByteCount[snd]
MaxMemoryUsed[]
MemoryInUse[]
Out[2]= 7680224
Out[3]= 45122908
Out[4]= 27782692
In[5]:= sndData=snd[[1,1,1]];
In[6]:= sndSampleRate=snd[[1,2]];
In[7]:= min=Min[Abs[Fourier[sndData]]];
MaxMemoryUsed[]
MemoryInUse[]
Out[8]= 74466116
Out[9]= 28197612
In[10]:= partSize=250;
In[11]:= offset=250;
In[12]:= spectroGramData=Take[20*Log10[Abs[Fourier[#]]/min],{2,partSize/2//Floor}]&/@Partition[sndData,partSize,offset];
MaxMemoryUsed[]
MemoryInUse[]
Out[13]= 74466116
Out[14]= 32447044
In[15]:= ListPlot3D[spectroGramData?,ColorFunction->"SolarColors",DataRange->Round[{{0,Length[sndData]/sndSampleRate},{18000,sndSampleRate/2}},0.1],ImageSize->800,BaseStyle->{FontFamily->"Arial",FontWeight->Bold,12}, PerformanceGoal -> "Quality"]
MaxMemoryUsed[]
MemoryInUse[]
During evaluation of In[15]:=
No more memory available.
Mathematica kernel has shut down.
Try quitting other applications and then retry.
bat3.wav works OK with the partSize and offset values shown. Increasing them causes the Pi to freeze. I will experiment to see how far I can push them.
Hope this helps.