Museum

Home

Lab Overview

Retrotechnology Articles

Online Manuals

⇒ DoTransFormat(3x) — NEWS-os 4.1C

Media Vault

Software Library

Restoration Projects

Artifacts Sought

Related Articles

sb(4)

sbconv(1)

CHECKSBPARAM(3x)  —  NEWS-OS Programmer’s Manual

NAME

CheckSbparam, GetTransFormatLength, DoTransFormat, InitTransFormat, GetBaseLength − To handle sound data formats. 

SYNOPSIS

#include <newsiodev/sound.h>
#include <soundlib.h>
 result = CheckSbparam( sb_param )
intresult;
struct sbparam  ∗sb_param;

newLength = GetTransFormatLength( oldSB, newSB, oldLength )
struct sbparam∗oldSB, ∗newSB;
intnewLength, oldLength;

newLength = DoTransFormat( oldSB, newSB, oldSound, newSound, oldLength )
struct sbparam∗oldSB, ∗newSB;
charoldSound[ oldLength ], newSound[ LONG_ENOUGH ];
intnewLength, oldLength;

InitTransFormat()

baseLength = GetBaseLength( oldSB, newSB )
intbaseLength;
struct sbparam∗oldSB, newSB;

DESCRIPTION

CheckSbparam checks the sound data format being used.  sb_param returns 0 if the sound format is one of those described in sb(4) and returns −1 otherwise.  The fields sb_compress and sb_format are only checked when either the LOGPCM or ADPCM format has been selected. 

GetTransFormatLength gets the data length after a format conversion.  It returns the new byte length for audio data of original byte length oldLength in the original format oldSB after that data has been converted to audio data of the new format newSB.  CheckSbparam is executed on both oldSBandnewSB and returns −1 (error) if either are undefined. 

DoTransFormat performs the actual format conversion of sound data files.  Sound data stored in oldSound of the length oldLength and of the format represented by oldSB is converted to the format represented by newSB and stored in newSound.  The length of the sound data is returned if it was converted successfully. 

InitTransFormat initialized filters used internally by DoTransFormat.  InitTransFormat must be called once before calling DoTransFormat.  This routine must also be called any time a data conversion differing from the previous one is going to be made. 

GetBaseLength gets the value of the maximum length of data which can be passed to the format conversion routine.  Due to the fact that there are size restrictions on the internal filters used, there are also restrictions on the length of data that DoTransFormat can convert with one call.  Actually, depending on the old and new data formats specified, only data of a certain length, or integral multiple of that length, can be converted at a time.  GetBaseLength gets the constant representing this length.  Use the format before conversion as the first argument and the format after conversion as the second.  The value of this constant can get very large if ADPCM is specified as the format before or after conversion when making a frequency conversion. 

FILES

/usr/sony/lib/libsound.a, /sys/newsiodev/sound.h, /usr/sony/include/soundlib.h

SEE ALSO

sb(4), sbconv(1)

NEWS-OSRelease 4.1C

Typewritten Software • bear@typewritten.org • Edmonds, WA 98026