BOOL DSP_PlayShutterSound(const void *src, u32 len);
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. |
Returns FALSE
if the specified shutter sound does not match the I2S operating frequency or if invalid data has been specified.
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.
SNDEX_GetI2SFrequency
function is called to confirm that the sample rate of the shutter sound matches the I2S operating frequency, and then playback is set so that only DSP sound plays from the speaker. After playback, the original setting is restored.DSP_PlaySound
function is ignored if it is called during play.SNDEX
function runs, it returns SNDEX_RESULT_EXCLUSIVE
and does nothing until playback ends. (There are some exceptions, however.)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 written, the preprocessing may in some cases fail because of exclusive control of the SNDEX library.
If preprocessing fails, this function retries until it succeeds.
The OS_Sleep
function is called from inside the retry process.
To always play the shutter sound without performing this internal retry process, you need to use the method below to eliminate the possibility of preprocess failure.
OS_LockMutex
function to run this function exclusively so that there is no overlap with processes of other SNDEX functions.SNDEX_SetIirFilter[Async]
is disabled.
DSP_IsShutterSoundPlaying
function to determine whether playback of the shutter sound has completed.
DSP_IsShutterSoundPlaying
DSP_LoadG711
2009/09/02 Deleted a note stating that this cannot be used together with other component features.
2009/07/16 Added an explanation about using this together with other component features.
2009/01/07 Changed descriptions to say that internal function processing retries until the shutter sound is played successfully.
2008/11/26 Deleted the stereo and monaural specifications.
2008/11/14 Added a description of the kinds of shutter sounds that can be specified.
2008/11/07 Mentioned that SNDEX functions cannot be used during shutter sound playback, and added information for correctly playing the shutter sound.
2008/10/23 Added a description about the function to use to wait for shutter sound playback to end.
2008/09/26 Mentioned that IIR filters are disabled during shutter sound playback.
2008/09/25 Mentioned 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