This is a way to play and record directly using files in WAV format rather than having to copy the data between the file and the Prosody channel.
Note: the library which provides this API is equivalent to the
Prosody high level WAV BFILE API
library except that instead of using the
bfile library it uses the
C standard library, stdio.
Under Solaris, stdio is crippled by the limitation that it
only works when fewer than 256 file descriptors are opened (it stores
the file descriptor in a char field). On other systems,
there is no particular need to use either in preference to the other.
If files for replay and record have the appropriate standard WAV file headers as explained in Prosody application note: WAV files then sm_replay_wav_start(), sm_replay_wav_close(), sm_record_wav_start(), sm_record_wav_close(), and sm_record_wav_trim_close() may be used to set up replay and record parameter structures.
These are used in conjunction with the Prosody high level play/record API .
The declarations for this library are in highapi/smwavlib.h
and applications using this library must be linked with:
highapi/gen-LINUX_V6/smwavlib.o
(Linux),
highapi/gen-QNX/smwavlib.o
(QNX),
highapi/gen-SOL_32_V6/smwavlib.o
(Solaris),
highapi/gen-WINNT_V6/smwavlib.obj
(Windows).
From time to time new features are added to this API. This may require new fields to be added to structures. A mechanism is available to ensure that this does not cause any problems for code developed prior to the addition. This is achieved by defining all new fields such that the value zero selects backward compatible behaviour. To take advantage of this, structures should be cleared before use. For example,
SM_CHANNEL_ALLOC_PLACED_PARMS ap; memset(&ap, 0, sizeof(ap)); ap.type = kSMChannelTypeFullDuplex; ... etc
This ensures that if a new field is ever added to this structure the new field is not left uninitialised.
The list of error codes that a function can return is only a list of typical errors. If a function is described as returning a standard error then it can return any such error. Also, when the description of a function says that it can return a particular error code (for example, ERR_SM_FIRMWARE_NOT_RUNNING), this does not mean that the function guarantees to detect this error condition in all circumstances. It merely means that if it does detect this error condition, then this is the code it will return.
This API is part of Prosody.