| [Home] [Tutorials] |
|
|
| Previous | Contents | Next |
Sweep provides some basic types which are useful for audio handling. It is important to use these types where appropriate, as this allows the sourcecode to be reconfigured for different environments.
Individual sample values of audio data are represented by the types sw_audio_t and sw_audio_intermediate_t. These are floating point values ranging between SW_AUDIO_T_MIN and SW_AUDIO_T_MAX. For most data storage and moving operations you should use sw_audio_t, and where more precision is required (eg. when mixing sounds together) use sw_audio_intermediate_t.
Blocks of audio data are stored in consecutive frames, where a frame is a collection of the data values corresponding to the same instant of time in each channel. That is, multichannel audio data is interleaved, for example stereo data is stored:
where L and R are sample values of type sw_audio_t, and (LR) is a single frame of data.
Frame counts are given as sw_framecount_t, and time is represented by sw_time_t in a floating point format in units of seconds.
More complex types include the sampling format and the list of selected regions in a sound.
| Previous | Contents | Next |
|