[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]
[Octave-bug-tracker] [bug #49927] audioread slow when extracting only pa
From: |
Rik |
Subject: |
[Octave-bug-tracker] [bug #49927] audioread slow when extracting only part of a file |
Date: |
Wed, 28 Dec 2016 00:32:27 +0000 (UTC) |
User-agent: |
Mozilla/5.0 (X11; Ubuntu; Linux x86_64; rv:43.0) Gecko/20100101 Firefox/43.0 |
Update of bug #49927 (project octave):
Status: Need Info => Confirmed
Release: 4.0.0 => dev
Operating System: Microsoft Windows => Any
Summary: wavread/audioread refuses to continue reading
wav-file => audioread slow when extracting only part of a file
_______________________________________________________
Follow-up Comment #12:
kbhit is a separate issue. That was fixed in 4.0.1, another reason why it's
important to run a supported version of Octave.
I think you're right that the problem is the straightforward, but
memory-intensive, strategy in audioread.cc of reading in the WHOLE file and
then extracting just the relevant bit.
This is the ine that does it
OCTAVE_LOCAL_BUFFER (float, data, info.frames * info.channels);
OCTAVE_LOCAL_BUFFER uses new or malloc underneath to try and get a contiguous
block of memory. Even if you have a fair amount of memory, it could be rare
to have a 575MB contiguous chunk.
The API for libsndfile is at http://www.mega-nerd.com/libsndfile/api.html. In
particular, it looks like the input parsing for the second input which
determines which samples to extract could be moved up earlier. Then the
OCTAVE_LOCAL_BUFFER call could be sized to a smaller value, the file pointer
could be advanced using sf_seek(), and sf_read_float() could be called with
only the number of items to read.
Re-titling bug report to reflect the underlying issue.
_______________________________________________________
Reply to this item at:
<http://savannah.gnu.org/bugs/?49927>
_______________________________________________
Message sent via/by Savannah
http://savannah.gnu.org/
- [Octave-bug-tracker] [bug #49927] wavread/audioread refuses to continue reading wav-file, (continued)
- [Octave-bug-tracker] [bug #49927] wavread/audioread refuses to continue reading wav-file, Philip Nienhuis, 2016/12/25
- [Octave-bug-tracker] [bug #49927] wavread/audioread refuses to continue reading wav-file, Rik, 2016/12/26
- [Octave-bug-tracker] [bug #49927] wavread/audioread refuses to continue reading wav-file, Kai-Michael, 2016/12/26
- [Octave-bug-tracker] [bug #49927] wavread/audioread refuses to continue reading wav-file, Rik, 2016/12/26
- [Octave-bug-tracker] [bug #49927] wavread/audioread refuses to continue reading wav-file, Philip Nienhuis, 2016/12/26
- [Octave-bug-tracker] [bug #49927] wavread/audioread refuses to continue reading wav-file, Kai-Michael, 2016/12/26
- [Octave-bug-tracker] [bug #49927] wavread/audioread refuses to continue reading wav-file, Kai-Michael, 2016/12/26
- [Octave-bug-tracker] [bug #49927] wavread/audioread refuses to continue reading wav-file, Philip Nienhuis, 2016/12/27
- [Octave-bug-tracker] [bug #49927] wavread/audioread refuses to continue reading wav-file, Kai-Michael, 2016/12/27
- [Octave-bug-tracker] [bug #49927] wavread/audioread refuses to continue reading wav-file, Mike Miller, 2016/12/27
- [Octave-bug-tracker] [bug #49927] audioread slow when extracting only part of a file,
Rik <=
- [Octave-bug-tracker] [bug #49927] audioread slow when extracting only part of a file, Kai-Michael, 2016/12/27
- [Octave-bug-tracker] [bug #49927] audioread slow when extracting only part of a file, Rik, 2016/12/27
- [Octave-bug-tracker] [bug #49927] audioread slow when extracting only part of a file, Philip Nienhuis, 2016/12/28