[linux-audio-dev] strange issue with libsndfile

martin rumori lists at rumori.de
Sat May 15 12:08:59 UTC 2004


hi *,

i've got a strange issue with libsndfile.

in foo (http://foo.sf.net) the SFM_RDWR mode is used, because target
soundfiles are created independently of the write process before, then
the file gets opened with SFM_RDWR to determine the target soundfile's
parameters (samplerate, channels...).

with SF_FORMAT_AIFF | SF_FORMAT_FLOAT (and SF_FORMAT_DOUBLE, btw., 2
channels) i notice a strange behavior: directly after creating the
file (without sf_writing anything) the number of frames of the file is
4 (SF_FORMAT_DOUBLE: 2 frames).  this doesn't happen neither with the
SF_FORMAT_PCM_* things, nor with SF_FORMAT_WAV.  with just 1 channel
the values are 6 resp. 3.

when reopening the file for writing (SFM_RDWR mode), there is no
difference between seeking to (0, SEEK_SET) and (0, SEEK_END), both
seek to 0.  surprisingly, seeking to (4, SEEK_SET) doesn't return an
error.

after writing 512 frames after seeking (in all three cases) and having
closed the file, the number of frames is now 511 (1022 with 1
channel).

am i missing something, or is this a bug in libsndfile?  attached my
test prog.

bests,

martin



-------------- next part --------------
A non-text attachment was scrubbed...
Name: soundfile.c
Type: text/x-csrc
Size: 3100 bytes
Desc: not available
URL: <http://lists.linuxaudio.org/pipermail/linux-audio-dev/attachments/20040515/fe0f0933/attachment.c>


More information about the Linux-audio-dev mailing list