4 * Copyright (c) 2000 - 2011 Samsung Electronics Co., Ltd. All rights reserved.
6 * Contact: Seungbae Shin <seungbae.shin@samsung.com>
8 * Licensed under the Apache License, Version 2.0 (the "License");
9 * you may not use this file except in compliance with the License.
10 * You may obtain a copy of the License at
12 * http://www.apache.org/licenses/LICENSE-2.0
14 * Unless required by applicable law or agreed to in writing, software
15 * distributed under the License is distributed on an "AS IS" BASIS,
16 * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
17 * See the License for the specific language governing permissions and
18 * limitations under the License.
24 * @brief Application interface library for sound module.
28 * Application interface library for sound module.
31 #ifndef __MM_SOUND_PRIVATE_H__
32 #define __MM_SOUND_PRIVATE_H__
44 @addtogroup SOUND_PRIVATE
49 #define MM_SOUND_VOLUME_CONFIG_TYPE(vol) (vol & 0x00FF)
50 #define MM_SOUND_VOLUME_CONFIG_GAIN(vol) (vol & 0xFF00)
53 const char *filename; /**< filename to play */
54 bool skip_session; /**< skip session control */
55 int volume; /**< relative volume level */
56 int loop; /**< loop count */
57 mm_sound_stop_callback_func callback; /**< callback function when playing is terminated */
58 void *data; /**< user data to callback */
59 void *mem_ptr; /**< memory buffer to play */
60 int mem_size; /**< size of memory buffer */
61 int volume_config; /**< volume type & volume gain */
65 * This function is to play system sound with specified parameters.
67 * @param param [in] Reference pointer to MMSoundPlayParam structure
68 * @param handle [out] Handle of sound play.
70 * @return This function returns MM_ERROR_NONE on success, or negative value
72 * @remark When the stop callback is set, it will be called when system sound is
73 * terminated. If mm_sound_stop_sound() is called apparently before
74 * system sound is terminated, stop_callback will not be called.
75 * This function can use various sound route path with mm_sound_set_path
76 * @see mm_sound_stop_sound mm_sound_set_path
80 int mm_sound_play_sound_ex(MMSoundPlayParam *param, int *handle);
82 int mm_sound_play_sound_with_stream_info(const char *filename, char *stream_type, int stream_id, unsigned int loop, mm_sound_stop_callback_func _completed_cb, void *data, int *handle);
85 * This function is to play key sound.
87 * @param filename [in] keytone filename to play
88 * @param volume_config [in] Volume type & volume gain
90 * @return This function returns MM_ERROR_NONE on success, or negative value
93 * @remark This function provide low latency sound play (such as dialer keytone)
94 * using fixed spec of wave file (44100Hz, mono channel)
95 * @see volume_type_t volume_gain_t mm_sound_volume_set_value
97 int mm_sound_play_keysound(const char *filename, int volume_config);
99 int mm_sound_boot_ready(int timeout_sec);
101 int mm_sound_boot_play_sound(char* path);
111 #endif /* __MM_SOUND_H__ */