Re: [Flac-dev] Support for CAF in flac command-line?

2011-03-07 Thread Paul Davis
On Mon, Mar 7, 2011 at 11:25 AM, Brian Willoughby bri...@sounds.wa.com wrote:
 All professional tools use conversion factors such as 0x8000 for
 float-to-int and int-to-float because it has a single significant
 bit, and thus this factor does not increase the bit depth of the
 samples passing through.

i'm not sure what all means, but i don't think its remotely as clear
cut as you insist:

   http://blog.bjornroche.com/2009/12/int-float-int-its-jungle-out-there.html

moreover, its critically important to note that this issue arises
primarily for float=16 bit int conversions, where generally
dithering should be done anyway. the noise introduced by dithering
will be at least on the same order of magnitude as the 0.005% error
caused by different choices in the conversion factor. conversions to
other bit depths don't face (precisely) the same issue.

its great that you're absolutely convinced that your view of this is
right. i generally have a lot of respect for your opinions. the
problem is that there are 4 other people whose opinions i respect
equally, and when i've discussed it with them, my only conclusion in
aggregate has to be it depends.

--p
___
Flac-dev mailing list
Flac-dev@xiph.org
http://lists.xiph.org/mailman/listinfo/flac-dev


Re: [Flac-dev] Support for CAF in flac command-line?

2011-03-07 Thread Brian Willoughby

On Mar 7, 2011, at 08:46, Paul Davis wrote:
 On Mon, Mar 7, 2011 at 11:25 AM, Brian Willoughby  
 bri...@sounds.wa.com wrote:
 All professional tools use conversion factors such as 0x8000 for
 float-to-int and int-to-float because it has a single significant
 bit, and thus this factor does not increase the bit depth of the
 samples passing through.

 i'm not sure what all means, but i don't think its remotely as clear
 cut as you insist:

http://blog.bjornroche.com/2009/12/int-float-int-its-jungle-out- 
 there.html

 moreover, its critically important to note that this issue arises
 primarily for float=16 bit int conversions, where generally
 dithering should be done anyway. the noise introduced by dithering
 will be at least on the same order of magnitude as the 0.005% error
 caused by different choices in the conversion factor. conversions to
 other bit depths don't face (precisely) the same issue.

 its great that you're absolutely convinced that your view of this is
 right. i generally have a lot of respect for your opinions. the
 problem is that there are 4 other people whose opinions i respect
 equally, and when i've discussed it with them, my only conclusion in
 aggregate has to be it depends.

Thanks.

I should qualify my statements by explaining that I'm talking about  
real music that comes from an A/D, with the understanding that 24-bit  
integers in twos-complement format are the standard.  I should also  
point out that my goal is to preserve the original bits unless an  
operation other than format conversion is specifically enabled.  In  
the context of FLAC - a lossless audio codec - this is entirely  
compatible.

My statements would not be appropriate for synthesized waveforms that  
did not originate in the real world by way of A/D converters.  In  
that world, there is freedom to deviate from the specific limitations  
of A/D converters, and thus there might be some hesitance to apply a  
default conversion that might clip certain synthesized waveforms that  
were created without concern for the realities of analog conversion.   
In that case, I would suggest that those who create such entirely  
synthetic waveforms should take the extra steps necessary to  
condition their signals for actual D/A converters, and then a  
transparent float-to-int conversion would not cause any additional  
problems.  It's only when the synthetic algorithms rely on side  
effects of a lossy conversion that things get hairy.

Brian

___
Flac-dev mailing list
Flac-dev@xiph.org
http://lists.xiph.org/mailman/listinfo/flac-dev


Re: [Flac-dev] Support for CAF in flac command-line?

2011-03-07 Thread Erik de Castro Lopo
Brian Willoughby wrote:

 
 On Mar 6, 2011, at 01:22, Erik de Castro Lopo wrote:
  Brian Willoughby wrote:
  Hopefully, libsndfile no longer uses the incorrect 0x7FFF (32767)
  factor for float to 16-bit integer conversions, because that would
  make it unacceptable for lossless file conversions.
 
  That is a statement of opinion rather than fact but I won't go into
  that here.
 
 
 It is a statement of mathematical fact, not opinion.

There are at least three different suboptimal solutions to this
problem. The FAQ here:

http://www.mega-nerd.com/libsndfile/FAQ.html#Q010

explains my choice of sub-optimal solutin.

That FAQ question also provides two ways of using libsndfile that 
avoid all suboptimal solutions.

Erik
-- 
--
Erik de Castro Lopo
http://www.mega-nerd.com/
___
Flac-dev mailing list
Flac-dev@xiph.org
http://lists.xiph.org/mailman/listinfo/flac-dev


Re: [Flac-dev] Support for CAF in flac command-line?

2011-03-06 Thread Erik de Castro Lopo
Brian Willoughby wrote:
 
 Hopefully, libsndfile no longer uses the incorrect 0x7FFF (32767)  
 factor for float to 16-bit integer conversions, because that would  
 make it unacceptable for lossless file conversions.

That is a statement of opinion rather than fact but I won't go into
that here.

However, there is a way avoid that feature of libsndfile by avoiding
the use of floats during the conversion. For instance, when convering
from one format to another, sndfile-convert does this:

if ((outfileminor == SF_FORMAT_DOUBLE) || (outfileminor == 
SF_FORMAT_FLOAT)
|| (infileminor == SF_FORMAT_DOUBLE) || (infileminor == 
SF_FORMAT_FLOAT)
|| (infileminor == SF_FORMAT_VORBIS) || (outfileminor 
== SF_FORMAT_VORBIS))
sfe_copy_data_fp (outfile, infile, sfinfo.channels) ;
else
sfe_copy_data_int (outfile, infile, sfinfo.channels) ;

That is the second path (sfe_copy_data_int) would be used for FLAC
- CAF and CAF - FLAC conversions.

Erik
-- 
--
Erik de Castro Lopo
http://www.mega-nerd.com/
___
Flac-dev mailing list
Flac-dev@xiph.org
http://lists.xiph.org/mailman/listinfo/flac-dev


Re: [Flac-dev] Support for CAF in flac command-line?

2009-01-06 Thread Josh Coalson
new tracker item here:
https://sourceforge.net/tracker2/?func=detailaid=2491177group_id=13478atid=363478



  
___
Flac-dev mailing list
Flac-dev@xiph.org
http://lists.xiph.org/mailman/listinfo/flac-dev


Re: [Flac-dev] Support for CAF in flac command-line?

2008-11-29 Thread Josh Coalson
--- Martin Leese [EMAIL PROTECTED] wrote:

 Brian Willoughby [EMAIL PROTECTED] wrote:
  Hello all,
 
  Is anyone here potentially up to the task of adding support for CAF
  (the CoreAudio Format) into the flac command-line?
 ...
  I've already made some recordings
  that are so long that they cannot be uncompressed from FLAC to WAV
 or
  AIFF because they would exceed 4 GB - the maximum file size for
 those
  formats.  CAF does not have the same 4 GB limitations.
 
 Erik de Castro Lopo [EMAIL PROTECTED] wrote:
 ...
  Whats more, the sndfile-convert program can also convert
  from FLAC to the following file formats that support 63 bit
  file offsets:
 
 Au, Caf, rf64, w64
 
 I am glad somebody mentioned RF64.
 Supporting RF64 instead of CAF would solve
 Brian's problem equally well, and would be the
 natural extension to supporting WAVE.

BTW current flac in CVS supports RF64 and wave64; they will be
in the next release.  I'll have to look into CAF.



  
___
Flac-dev mailing list
Flac-dev@xiph.org
http://lists.xiph.org/mailman/listinfo/flac-dev


Re: [Flac-dev] Support for CAF in flac command-line?

2008-11-29 Thread Martin Leese
On Sat, Nov 29, 2008 at 2:20 PM, Josh Coalson [EMAIL PROTECTED] wrote:

 --- Martin Leese [EMAIL PROTECTED] wrote:

 Erik de Castro Lopo [EMAIL PROTECTED] wrote:
 ...
  Whats more, the sndfile-convert program can also convert
  from FLAC to the following file formats that support 63 bit
  file offsets:
 
 Au, Caf, rf64, w64

 I am glad somebody mentioned RF64.
 Supporting RF64 instead of CAF would solve
 Brian's problem equally well, and would be the
 natural extension to supporting WAVE.

 BTW current flac in CVS supports RF64 and wave64; they will be
 in the next release.  I'll have to look into CAF.

Core Audio Format (CAF) is from Apple, visit:
http://developer.apple.com/documentation/MusicAudio/CoreAudio-date.html

I have never tried to code CAF, but my guess
is that it will be a lot more work than the
successors to WAVE.

Regards,
Martin
-- 
Martin J Leese
E-mail: martin.leese  stanfordalumni.org
Web: http://members.tripod.com/martin_leese/
___
Flac-dev mailing list
Flac-dev@xiph.org
http://lists.xiph.org/mailman/listinfo/flac-dev


Re: [Flac-dev] Support for CAF in flac command-line?

2008-11-29 Thread Erik de Castro Lopo
Martin Leese wrote:

 Core Audio Format (CAF) is from Apple, visit:
 http://developer.apple.com/documentation/MusicAudio/CoreAudio-date.html
 
 I have never tried to code CAF, but my guess
 is that it will be a lot more work than the
 successors to WAVE.

I have coded CAF (as part of libsndfile) and IMO, CAf is no harder
than WAV.

Erik
-- 
-
Erik de Castro Lopo
-
Safety versus Expressiveness is a false dichotomy -- you can have both.
Compare ObjectiveCaml with CeePlusPlus: OCaml obtains expressiveness
without compromising safety, while C++ obtains it by throwing away
safety. The latter is just bad design. -- David Hopwood
___
Flac-dev mailing list
Flac-dev@xiph.org
http://lists.xiph.org/mailman/listinfo/flac-dev


Re: [Flac-dev] Support for CAF in flac command-line?

2008-10-14 Thread Erik de Castro Lopo
Brian Willoughby wrote:

 RF64 support sure would be nice, but it wouldn't really help to do  
 this instead of CAF.

This pre-release of libsndfile supports both:

http://www.mega-nerd.com/tmp/libsndfile-1.0.18pre24e.tar.gz

Erik
-- 
-
Erik de Castro Lopo
-
If trees could scream, would we be so cavalier about cutting them
down? We might, if they screamed all the time, for no good reason.
-- Jack Handey
___
Flac-dev mailing list
Flac-dev@xiph.org
http://lists.xiph.org/mailman/listinfo/flac-dev


Re: [Flac-dev] Support for CAF in flac command-line?

2008-10-13 Thread Paul Davis
On Sun, 2008-10-12 at 19:26 -0700, Brian Willoughby wrote:
 Hello all,
 
 Is anyone here potentially up to the task of adding support for CAF  
 (the CoreAudio Format) into the flac command-line?  This would  
 present minimal difficulty under OSX, due to the presence of the  
 CoreAudio API, but the real challenge would be to support CAF on Unix  
 and Windows - everywhere that flac is now available.
 
 Although the format is rather unknown, there are some very specific  
 advantages to adding CAF support. 

I am a little suprised that you don't know that CAF is already supported
by libsndfile, on every platform where libsndfile works (which includes
just about every unix and windows platforms i know of).


___
Flac-dev mailing list
Flac-dev@xiph.org
http://lists.xiph.org/mailman/listinfo/flac-dev


Re: [Flac-dev] Support for CAF in flac command-line?

2008-10-13 Thread Brian Willoughby
I will quote from the CAF spec:

This document is intended for anyone who needs to understand the  
structure of CAF files. You can use the information in this document,  
for example, to write a CAF parser or to extend the types of data  
stored in CAF files. Because CAF files offer many advantages over  
other audio file formats, anyone writing an application for Mac OS X  
that reads or writes audio files should read at least the overview  
chapter to gain an understanding of the features of CAF files. In  
addition, you need the information in this document if you want to use  
CAF files on other platforms.
End users of professional audio software may be interested in this  
document in order to learn more about the capabilities of software  
that supports CAF.

IANAL, but I sure hope Apple wouldn't sue someone who write[s] a CAF  
parser or want[s] to use CAF files on other platforms.  Hopefully,  
the existence of libsndfile support for CAF shows that the format is  
open.

Brian Willoughby
Sound Consulting


On Oct 12, 2008, at 22:27, Michael Crawford wrote:
 My hunch is that Apple does not want to encumber
 the format, but I'll let their public documents speak for them.  In
 any event, it's a very good issue to be aware of from the start.

I'm afraid AAC (MPEG-4 audio) has many, many patents. Unlike MP3, one
cannot even distribute the binary of an Open Source player.  AAC
stands for Apple Audio Codec - it's their lossy codec.

___
Flac-dev mailing list
Flac-dev@xiph.org
http://lists.xiph.org/mailman/listinfo/flac-dev


Re: [Flac-dev] Support for CAF in flac command-line?

2008-10-13 Thread Erik de Castro Lopo
Paul Davis wrote:

 I am a little suprised that you don't know that CAF is already supported
 by libsndfile, on every platform where libsndfile works (which includes
 just about every unix and windows platforms i know of).

Thanks Paul.

Yep, Caf support was added in July 2005.

Whats more, the sndfile-convert program can also convert
from FLAC to the following file formats that support 63 bit
file offsets:

Au, Caf, rf64, w64

Cheers,
Erik
-- 
-
Erik de Castro Lopo
-
It has been discovered that C++ provides a remarkable facility
for concealing the trival details of a program -- such as where
its bugs are. -- David Keppel
___
Flac-dev mailing list
Flac-dev@xiph.org
http://lists.xiph.org/mailman/listinfo/flac-dev


Re: [Flac-dev] Support for CAF in flac command-line?

2008-10-13 Thread Erik de Castro Lopo
Michael Crawford wrote:

 Unlike MP3, one
 cannot even distribute the binary of an Open Source player.

Even distributing an MP3 software player requires the payment
of license fees:

 http://www.mp3licensing.com/royalty/software.html

Erik
-- 
-
Erik de Castro Lopo
-
If I were on life-support, I'd rather have it run by a Gameboy
than a Windows box.
-- Cliff Wells in comp.lang.python
___
Flac-dev mailing list
Flac-dev@xiph.org
http://lists.xiph.org/mailman/listinfo/flac-dev


Re: [Flac-dev] Support for CAF in flac command-line?

2008-10-13 Thread Michael Crawford
On Sun, Oct 12, 2008 at 11:56 PM, Erik de Castro Lopo
[EMAIL PROTECTED] wrote:
 Even distributing an MP3 software player requires the payment
 of license fees:

 http://www.mp3licensing.com/royalty/software.html

Thanks for pointing that out - you might have just saved me a world of hurt.

However, there are many Open Source players - is there a license
exception for them, just for decoding?  Or can they only be
distributed from countries that don't recognize software patents?
That's the case with VLC, for example, it's from France.

Ogg Frog is GPL.

Mike
-- 
Michael David Crawford
mdcrawford at gmail dot com

   Enjoy my art, photography, music and writing at
http://www.geometricvisions.com/
--- Free Compact Disc ---
___
Flac-dev mailing list
Flac-dev@xiph.org
http://lists.xiph.org/mailman/listinfo/flac-dev


Re: [Flac-dev] Support for CAF in flac command-line?

2008-10-13 Thread Erik de Castro Lopo
Michael Crawford wrote:

 However, there are many Open Source players

Yep, I believe that the distributors of those MP3 players owe
the MP3 patent holders money.

 - is there a license exception for them, just for decoding?

Not that I know of.

  Or can they only be
 distributed from countries that don't recognize software patents?

I believe that these players are on shaky legal ground in
the US and in many other contries.

Erik
-- 
-
Erik de Castro Lopo
-
We respect the right of everyone to believe whatever they like. 
But there are two important limits to religious tolerance. First, I have no
right to legal protection against your scepticism, criticism or ridicule.
Religion is too powerful a force, and is too often a cause of injustice or
evil, for it to be immune from discussion and debate.
-- David Pannick QC

http://www.timesonline.co.uk/tol/life_and_style/career_and_jobs/legal/article729808.ece
___
Flac-dev mailing list
Flac-dev@xiph.org
http://lists.xiph.org/mailman/listinfo/flac-dev


Re: [Flac-dev] Support for CAF in flac command-line?

2008-10-13 Thread Brian Willoughby
RF64 support sure would be nice, but it wouldn't really help to do  
this instead of CAF.  For one thing, Logic Studio Pro does not seem  
to support RF64, because the manual states that WAVE and BWF are  
limited to 4 GB.  CAF may be a format which lacks universal support,  
but RF64 is also very limited in usefulness.  Treating either one as  
a substitute for the other is not going to help.

Personally, I'd welcome support for either or both.  With an open- 
source project like this, I'm not going to complain about any added  
features, so long as we all understand that there is no substitute  
for CAF.

Brian Willoughby
Sound Consulting


On Oct 13, 2008, at 08:59, Martin Leese wrote:

Brian Willoughby [EMAIL PROTECTED] wrote:
 Hello all,

 Is anyone here potentially up to the task of adding support for CAF
 (the CoreAudio Format) into the flac command-line?
...
 I've already made some recordings
 that are so long that they cannot be uncompressed from FLAC to WAV or
 AIFF because they would exceed 4 GB - the maximum file size for those
 formats.  CAF does not have the same 4 GB limitations.

Erik de Castro Lopo [EMAIL PROTECTED] wrote:
...
 Whats more, the sndfile-convert program can also convert
 from FLAC to the following file formats that support 63 bit
 file offsets:

Au, Caf, rf64, w64

I am glad somebody mentioned RF64.
Supporting RF64 instead of CAF would solve
Brian's problem equally well, and would be the
natural extension to supporting WAVE.

Regards,
Martin

___
Flac-dev mailing list
Flac-dev@xiph.org
http://lists.xiph.org/mailman/listinfo/flac-dev


Re: [Flac-dev] Support for CAF in flac command-line?

2008-10-12 Thread Michael Crawford
On Sun, Oct 12, 2008 at 7:26 PM, Brian Willoughby [EMAIL PROTECTED] wrote:
 Is anyone here potentially up to the task of adding support for CAF
 (the CoreAudio Format) into the flac command-line?  This would
 present minimal difficulty under OSX, due to the presence of the
 CoreAudio API, but the real challenge would be to support CAF on Unix
 and Windows - everywhere that flac is now available.

I expect I could do it as part of my work on Ogg Frog:

http://www.oggfrog.com/free-music-software

In the short term, I would do it by accessing the QuickTime APIs -
which *are* available on Windows, if you install either iTunes or
QuickTime for Windows.  (The iTunes install includes QuickTime.)

In the long term, I could write a codec for it that would be
straightforward to integrate into the flac command-line tool.  That
would allow its use on UNIX.

HOWEVER!

Is the CoreAudio file format or its associated algorithms patented?
QuickTime in general has many patents.

A patent wouldn't stop me from writing the source code, but a binary
couldn't be provided by anyone in a country that recognizes software
patents.

Mike
-- 
Michael David Crawford
mdcrawford at gmail dot com

   Enjoy my art, photography, music and writing at
http://www.geometricvisions.com/
--- Free Compact Disc ---
___
Flac-dev mailing list
Flac-dev@xiph.org
http://lists.xiph.org/mailman/listinfo/flac-dev


Re: [Flac-dev] Support for CAF in flac command-line?

2008-10-12 Thread Brian Willoughby
Thanks for the interest, Michael.

I don't use Ogg, so I'm a little wary that standard FLAC would be  
left out of any Ogg Frog implementation.  But I say that mostly out  
of ignorance.  I have noticed that there seem to be two worlds for  
FLAC, inside Ogg and outside.  It's important to be aware of the fact  
that many hardware devices support the FLAC format directly, without  
the Ogg container/wrapper.  I would want the ability to convert FLAC  
to CAF directly, hopefully without an intermediate Ogg file (since  
I'm talking about file sizes where each is over 4 GB).

QuickTime is a very good suggestion, and gets two platforms supported  
rather than one, as the AudioFile API in CoreAudio would do.   
However, QuickTime tends to be rather limited, and when developers  
run into those limitations, Apple engineers tend to recommend that  
folks turn to CoreAudio for full support.  Also, I really would like  
to support Unix, assuming that there are as many Unix folks using  
FLAC as there are Windows users taking advantage of this underground  
format.

As for the patent question, it's a very smart question, but I think  
as soon as any interested developer looks at the CAF specification  
from Apple, it should be readily apparent what the legal  
ramifications are.  My hunch is that Apple does not want to encumber  
the format, but I'll let their public documents speak for them.  In  
any event, it's a very good issue to be aware of from the start.

Thanks again for the comments, and be sure to keep us informed if you  
do anything.

Brian Willoughby
Sound Consulting


On Oct 12, 2008, at 21:25, Michael Crawford wrote:

On Sun, Oct 12, 2008 at 7:26 PM, Brian Willoughby  
[EMAIL PROTECTED] wrote:
 Is anyone here potentially up to the task of adding support for CAF
 (the CoreAudio Format) into the flac command-line?  This would
 present minimal difficulty under OSX, due to the presence of the
 CoreAudio API, but the real challenge would be to support CAF on Unix
 and Windows - everywhere that flac is now available.

I expect I could do it as part of my work on Ogg Frog:

http://www.oggfrog.com/free-music-software

In the short term, I would do it by accessing the QuickTime APIs -
which *are* available on Windows, if you install either iTunes or
QuickTime for Windows.  (The iTunes install includes QuickTime.)

In the long term, I could write a codec for it that would be
straightforward to integrate into the flac command-line tool.  That
would allow its use on UNIX.

HOWEVER!

Is the CoreAudio file format or its associated algorithms patented?
QuickTime in general has many patents.

A patent wouldn't stop me from writing the source code, but a binary
couldn't be provided by anyone in a country that recognizes software
patents.

Mike

___
Flac-dev mailing list
Flac-dev@xiph.org
http://lists.xiph.org/mailman/listinfo/flac-dev


Re: [Flac-dev] Support for CAF in flac command-line?

2008-10-12 Thread Michael Crawford
 Thanks for the interest, Michael.

I hope I really can be of help.

 I don't use Ogg, so I'm a little wary that standard FLAC would be
 left out of any Ogg Frog implementation.

Ogg Frog already supports native FLAC as a player.  Version 1.0 will
only support playing and decoding, but version 1.1 will support
encoding, and I'll be sure to support FLAC with and without Ogg.

I must hasten to point out that I don't offer any downloads yet - the
UI is in a very primitive state.

  My hunch is that Apple does not want to encumber
 the format, but I'll let their public documents speak for them.  In
 any event, it's a very good issue to be aware of from the start.

I'm afraid AAC (MPEG-4 audio) has many, many patents. Unlike MP3, one
cannot even distribute the binary of an Open Source player.  AAC
stands for Apple Audio Codec - it's their lossy codec.

 Thanks again for the comments, and be sure to keep us informed if you
 do anything.

Of course.

Mike
-- 
Michael David Crawford
mdcrawford at gmail dot com

   Enjoy my art, photography, music and writing at
http://www.geometricvisions.com/
--- Free Compact Disc ---
___
Flac-dev mailing list
Flac-dev@xiph.org
http://lists.xiph.org/mailman/listinfo/flac-dev