Open a sample file read for playback

=> R0 pointer to file name
R1 sample format
R2 frame rate
R3,R4 range of sample data
R5 auxiliary parameter (only used by ADPCM formats)



or if bits 8-11 of R1 (the channel) are zero:

R0 pointer to file name
R1 auto-detect mode (0=normal)
R3 file offset to look for header (if R1=1)

<= For non auto-detect; R1-R5 preserved.
For auto-detect ok; R1-R5 are updated to reflect the detected format.
For auto-detect error; R0=error, R1=partial format (see below)
If no error occurs R0 points to PlayIt's internal copy of the filename



For ADPCM modes (&1x), R5 contains the total number of frames per ADPCM block. R5 is unused in the other modes.



If either the number of channels in the format word or frame rate (or both) is zero then all parameters other than R0 are ignored and an attempt is made to auto-detect all the required parameters. The auto-identifier, although not as rigorous as SoundCon recognises quite a number of formats reliably. If auto-detection is requested and the format is not recognised, and error is generated.



Note that prior to 1.36 auto-detect required that the format word was zero whereas now only the number of channels (bits 8-11) need be zero. This is so that bits 0-7 of the format word can be used as an auto-detect parameter:

0 normal auto-detect (as in previous versions)
1 format header is at the offset contained in R3



All other values are undefined and must not be used. From 1.36 auto-detect mode may be used to identify sample files contained within a larger file (R1=1) in which case R3 is interpreted as the file offset to treat as the start (which is normally zero).



If an error occurs trying to open the file (either a filing error or type-detection error) then any previously open sample is preserved.



From v1.59, if an error is returned when using auto-detect then the format word (R1) will give partial information. If the file is not recognised at all then R1 will be zero otherwise the xx field (bits 24-31) will indicate the format. Other fields may be filled in too (eg yy, channels) depending on how far it got before encountering a problem.



Once the file has been opened PlayIt is effectively in pause mode at the first frame in the file. Playback can be started with PlayIt_Play or calls like PlayIt_BeginEnd , PlayIt_PauseAt , PlayIt_SetPtr can be used to set up things before playing.


[ Parent ] [ Manual root ]


Created by SHtoHTML v1.20