1. 1 The Motivation




Download 0.89 Mb.
bet24/32
Sana22.07.2021
Hajmi0.89 Mb.
#15652
1   ...   20   21   22   23   24   25   26   27   ...   32
6.1 Audio Subsystem
The Audio Subsystem utilizes the Microsoft Waveform API to communicate with both the Audio input and output drivers. The Audio subsystem has a number off public functions;


  • audio_open() initialises both the audio input and audio output drivers, at the same time a circular queue structure of 64 empty audio blocks is initialised for each of the audio drivers.




  • audio_close() closes both the audio input and output drivers, at the same time the circular queue structure for each driver is torn down and the allocated memory is freed.




  • audio_play_block(unsigned char *block) passes the audio block parameter to the output driver for playback. After the first call of this function if the device becomes starved off blocks, which is where all available blocks are played, then to prevent clicks where the audio output driver stops playing, the call back function which is called after each successfully played block, checks the status of the queue and if empty, passes an empty block to the audio driver to play white noise.




  • audio_record() starts the input device recording blocks, as a block is filled a call back function is executed which passes the block to the codec subsystem for processing, the block within the queue once copied is cleared to be refilled later.




  • audio_stop() stops both the input and output drivers from playing/recording successive blocks, then clears and re-initialises the circular queue ready for the next call.

There where a number of problems faced with the implementation of the audio subsystem, first it was only discovered that the Arcom x86 Windows CE boards was not capable of recording sound after the initial 5 weeks of the project. This meant that the application had to be developed directly upon the Compaq IPAQ Pocket PC; this set the implementation back 3 weeks whilst attempting to find updates for the Arcom Board before moving on to the Pocket PC. Developing for the Pocket PC hindered the implementation since their where no easy methods available to output data to the screen without programming a user interface which made debugging difficult.


The lack off documentation and developer support for windows CE made developing the Audio subsystem difficult and examples of this was the late discovery that most of the win32 API can not be utilized from within a call back method, once this was pointed out a lot of issues where solved.



Download 0.89 Mb.
1   ...   20   21   22   23   24   25   26   27   ...   32




Download 0.89 Mb.