DSP_PlayShutterSound

Syntax


BOOL DSP_PlayShutterSound(const void *src, u32 len);

Arguments

src Wave format shutter sound data.
You can only specify the 32730-Hz and 47610-Hz data below the $TwlSDK/data/shutter_sound and $TwlSDK/data/videorec_sound directories. The sampling rate must match the I2S operating frequency obtained with the SNDEX_GetI2SFrequency function.
The specified buffer has the same restrictions as a 16-bit DMA transfer. See Note below for more details.
len Byte size of the wave data.

Return Values

Returns FALSE if the specified shutter sound does not match the I2S operating frequency or if invalid data have been specified.

Description

Plays the shutter sound from the DSP.
Playing the sound specified by this function has priority over all other sound output. Internally it is exclusively controlled as follows.

This function can be used if any of the DSP components have been loaded.

This function performs preprocessing using the SNDEX library.
Thus, depending on how the program is pieced together, the preprocessing may in some cases fail because of exclusive control of the SNDEX library.
If preprocessing fails, retry inside the function until it succeeds.
The OS_Sleep function is called from inside the retry process.
To unfailingly play the shutter sound without performing this internal retry process, you need to use the method below to eliminate the possibility of preprocess failure.

Notes

See Also

DSP_IsShutterSoundPlaying
DSP_LoadG711

Revision History

2009/01/07 Changed description to retry inside the function until the shutter sound plays successfully.
2008/11/26 Deleted the stereo, monaural specification.
2008/11/14 Added description of the kinds of shutter sounds that can be specified.
2008/11/07 Added mention that SNDEX functions cannot be used during shutter sound playback, and information about how to unfailingly play the shutter sound.
2008/10/23 Added description of the function to use to wait for shutter sound playback to end.
2008/09/26 Added mention that IIR filter is disabled during shutter sound playback.
2008/09/25 Added mention that sound output is controlled exclusively.
2008/07/09 Changed the size accepted as an argument from half-words to bytes.
2008/06/24 Initial version.


CONFIDENTIAL