[R] Limitations of audio processing in R
Ken
vicvoncastle at gmail.com
Wed Sep 21 23:15:42 CEST 2011
Also with Linux you can add more swap memory(which I'm pretty sure R spills into if it hasn't reached it's internal limits on 32 bit installations). Windows pagefile is kind of obnoxious.
Ken Hutchison
On Sep 21, 2554 BE, at 5:05 PM, (Ted Harding) <ted.harding at wlandres.net> wrote:
> Hi Ulisses!
> Yes, "get more creative" -- or "get more memory"!
>
> On the "creative" side, it may be worth thinking about
> using an independent (non-R) audio file editor. I'm
> writing from the standpoint of a Linux/Unixoid user
> here -- I wouldn;t know how to set ebout this in WIndows.
>
> You could use R to create a shell script which would run
> the editor in such a way as to extract your 6 random samples,
> and save them, where the script would be fed with the
> randomly-chosen 5-minute intervals decided by R. This
> could be done under the control of R, so you could set
> it up for your 1500 or so sets of samples, which (with
> the right editing program) could be done quite quickly.
>
> On Linux (also available for Windows) a flexible audio
> editor is 'sox' -- see:
>
> http://en.wikipedia.org/wiki/SoX
>
> To take, say, a 5-minute sample starting at 1 hour,
> 10 min and 35sec into the audio file "infile.wav",
> and save this as "outfile.wav", you can execute
>
> sox infile.wav outfile.wav trim 01:10:35 00:05:00
>
> and such a command could easily be generated by R and
> fed to a shell script (or simply executed from R by
> using the system() command). My test just now with
> a 5-minute long sample from a .wav file was completed
> in about 5 seconds, so it is quite efficient.
>
> There is a huge number of options for 'sox', allowing
> you to manipulate almost any aspect of the editing.
>
> Hoping this helps,
> Ted.
>
>
> On 21-Sep-11 19:55:22, R. Michael Weylandt wrote:
>> If you are running Windows it may be as simple as using
>> memory.limit() to allow R more memory -- if you are on
>> another OS, it may be possible to get the needed memory
>> by deleting various things in your workspace and running
>> gc()
>>
>> Of course, if your computer's memory is <3GB, you are
>> probably going to have trouble with R's keeping all objects
>> in memory and will have to get more creative.
>>
>> Michael
>>
>> On Wed, Sep 21, 2011 at 3:43 PM, Ulisses.Camargo <
>> moliterno.camargo at gmail.com> wrote:
>>
>>> Hello everybody
>>>
>>> I am trying to process audio files in R and had some problems
>>> with files size. I´m using R packages 'audio' and 'sound'.
>>> I´m trying a really simple thing and it is working well with
>>> small sized .wav files. When I try to open huge audio files
>>> I received this error message: "cannot allocate vector of
>>> size 2.7 Gb". My job is open in R a 3-hour .wav file, make six
>>> 5-minute random audio subsamples, and than save these new files.
>>> I have to do the same process +1500 times. My problems is not
>>> in build the function to do the job, but in oppening the 3-hour
>>> files. Does anybody knows how to handle big audio files in R?
>>> Another package that allows me to do this work? I believe
>>> this is a really simple thing, but I really don´t know what
>>> to do to solve that memory problem.
>>>
>>> Thank you very much for your answers,
>>> all the best!
>>>
>>> Ulisses
>
> --------------------------------------------------------------------
> E-Mail: (Ted Harding) <ted.harding at wlandres.net>
> Fax-to-email: +44 (0)870 094 0861
> Date: 21-Sep-11 Time: 22:05:55
> ------------------------------ XFMail ------------------------------
>
> ______________________________________________
> R-help at r-project.org mailing list
> https://stat.ethz.ch/mailman/listinfo/r-help
> PLEASE do read the posting guide http://www.R-project.org/posting-guide.html
> and provide commented, minimal, self-contained, reproducible code.
More information about the R-help
mailing list