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

Erik de Castro Lopo erikd-lad at mega-nerd.com
Tue Aug 31 11:33:44 UTC 2004


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



More information about the Linux-audio-dev mailing list