moduleSound.Sox.Frame(C(..),Frame.withSignal,Frame.numberOfChannels,)whereimportqualifiedSound.FrameasFrameimportqualifiedSound.Frame.StereoasStereoimportqualifiedSound.Frame.MuLawasMuLawimportqualifiedSound.Sox.FormatasFormatimportData.Word(Word8,Word16,Word32,)importData.Int(Int8,Int16,Int32,)classFrame.Cy=>Cywhereformat::y->Format.TinstanceCWord8whereformat_=Format.unsignedByteinstanceCInt8whereformat_=Format.signedByteinstanceCWord16whereformat_=Format.unsignedWordinstanceCInt16whereformat_=Format.signedWordinstanceCWord32whereformat_=Format.unsignedLonginstanceCInt32whereformat_=Format.signedLong{- |
The floating point instances are dangerous,
because Storable Float may not use IEEE format
that sox uses according to its man page.
This is strange since sox uses the host's endianess for multi-byte values.
So, why does it not use the machine's floating point format?
-}instanceCFloatwhereformat_=Format.ieeeSinglePrecisioninstanceCDoublewhereformat_=Format.ieeeDoublePrecisioninstanceCMuLaw.Twhereformat_=Format.muLaw{-
Shall we add instances for Float and Double?
Sox requires floating point numbers in IEEE formats,
but we cannot warrant that the Storable instances uses those formats.
-}instanceCa=>C(Stereo.Ta)whereformaty=format(Stereo.lefty)