Re: [linux-audio-dev] libsndfile: type combinations and string data

New Message Reply About this list Date view Thread view Subject view Author view Other groups

Subject: Re: [linux-audio-dev] libsndfile: type combinations and string data
From: Erik de Castro Lopo (erikd-lad_AT_mega-nerd.com)
Date: Tue Aug 31 2004 - 14:33:44 EEST


On Mon, 30 Aug 2004 22:30:41 -0600
martin rumori <lists_AT_rumori.de> wrote:

> but, with 1.0.10 and 1.0.11pre4,
>
> SF_INFO info;
>
> info.format = SF_FORMAT_AIFF | SF_FORMAT_PCM_16 | SF_ENDIAN_LITTLE;
> if (! sf_format_check(&info))
> {
> printf("AIFF | LITTLE invalid\n");
> }
>
> info.format = SF_FORMAT_AIFF | SF_FORMAT_PCM_16 | SF_ENDIAN_BIG;
> if (! sf_format_check(&info))
> {
> printf("AIFF | BIG invalid\n");
> }
>
> yields me both an error. is that supposed to return true?

For sf_format_check() to return TRUE, you MUST also set the sample
rate, channel count and number of channels.

<snip>

> i don't know too much about the data organisation in .aiff and .wav,
> but if the comment is located in the head of the file, it could still
> be possible to write/change the data section in SFM_RDWR.

Yes, and that should be possible. What is not possible is
openning the file RDWR and modifying the string data in the
header.

> what do you
> think about letting sf_set_string() fail in any other mode than
> SFM_WRITE,

Yes, thats sound pretty sensible.

> but still allowing to open files with comments in SF_RDWR
> and to use the sf_writex_*() calls? (currently possible with AIFF,
> but not with WAV).

Are you sure?

Erik

-- 
+-----------------------------------------------------------+
  Erik de Castro Lopo  nospam_AT_mega-nerd.com (Yes it's valid)
+-----------------------------------------------------------+
"Linux is produced to be used, whereas the others are produced
to be sold"  -- Bobby D. Bryant


New Message Reply About this list Date view Thread view Subject view Author view Other groups

This archive was generated by hypermail 2b28 : Tue Aug 31 2004 - 14:39:22 EEST