This is basic2nextsnd.c in view mode; [Download] [Up]
#import <stddef.h>
#import <sound/soundstruct.h>
#import <streams/streams.h>
NXStream *basic2next( NXStream *inStream)
{
SNDSoundStruct outSound = {SND_MAGIC, 0, 0, SND_FORMAT_MULAW_8,
SND_RATE_CODEC, 1, '0'};
NXStream *outStream;
int len,max;
char *buff;
outSound.dataLocation = 28;
NXSeek(inStream, (long)0, NX_FROMEND);
outSound.dataSize = NXTell(inStream);
outStream = NXOpenMemory(NULL, 0, NX_READWRITE);
NXWrite(outStream, (const void *)&outSound, outSound.dataLocation);
NXGetMemoryBuffer(inStream, &buff, &len, &max);
NXWrite(outStream, (const void *)buff, outSound.dataSize);
return(outStream);
}
NXStream *next2basic( NXStream *inStream)
{
SNDSoundStruct *inSound;
NXStream *outStream;
int len,i,max;
char *buff;
NXGetMemoryBuffer(inStream, (char **)&inSound, &len, &max);
NXGetMemoryBuffer(inStream, &buff, &i, &max);
outStream = NXOpenMemory(NULL, 0, NX_READWRITE);
for( i = inSound->dataLocation; i < len ; i++)
NXWrite(outStream, (const void *)buff+i, sizeof(char));
NXSeek(outStream, (long)0, NX_FROMSTART);
return(outStream);
}
These are the contents of the former NiCE NeXT User Group NeXTSTEP/OpenStep software archive, currently hosted by Netfuture.ch.