2 * Copyright (c) 2015 - 2018 Samsung Electronics Co., Ltd All Rights Reserved
4 * Licensed under the Apache License, Version 2.0 (the "License");
5 * you may not use this file except in compliance with the License.
6 * You may obtain a copy of the License at
8 * http://www.apache.org/licenses/LICENSE-2.0
10 * Unless required by applicable law or agreed to in writing, software
11 * distributed under the License is distributed on an "AS IS" BASIS,
12 * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
13 * See the License for the specific language governing permissions and
14 * limitations under the License.
17 #ifndef __TIZEN_MEDIA_SOUND_MANAGER_INTERNAL_H__
18 #define __TIZEN_MEDIA_SOUND_MANAGER_INTERNAL_H__
26 * @file sound_manager_internal.h
27 * @brief This file contains the Sound Manager Internal API.
31 * @addtogroup CAPI_MEDIA_SOUND_MANAGER_MODULE
35 #define SOUND_TYPE_NUM SOUND_TYPE_VOICE + 1
39 * @brief Virtual sound stream handle.
42 typedef struct virtual_sound_stream_s* virtual_sound_stream_h;
46 * @brief Enumeration for Native API.
50 NATIVE_API_SOUND_MANAGER, /**< Sound-manager Native API */
51 NATIVE_API_PLAYER, /**< Player Native API */
52 NATIVE_API_WAV_PLAYER, /**< Wav-player Native API */
53 NATIVE_API_TONE_PLAYER, /**< Tone-player Native API */
54 NATIVE_API_AUDIO_IO, /**< Audio-io Native API */
55 NATIVE_API_RECORDER, /**< Recorder Native API */
60 * @brief Enumeration for sound stream type for internal.
64 SOUND_STREAM_TYPE_RINGTONE_CALL = 100, /**< Sound stream type for ringtone for call */
65 SOUND_STREAM_TYPE_RINGBACKTONE_CALL, /**< Sound stream type for ringback tone for call */
66 SOUND_STREAM_TYPE_VOICE_CALL, /**< Sound stream type for voice-call */
67 SOUND_STREAM_TYPE_VIDEO_CALL, /**< Sound stream type for video-call */
68 SOUND_STREAM_TYPE_RADIO, /**< Sound stream type for radio */
69 SOUND_STREAM_TYPE_LOOPBACK, /**< Sound stream type for loopback */
70 SOUND_STREAM_TYPE_LOOPBACK_MIRRORING, /**< Sound stream type for loopback-mirroring */
71 SOUND_STREAM_TYPE_SOLO, /**< Sound stream type for solo */
72 SOUND_STREAM_TYPE_VOICE_RECOGNITION_SERVICE, /**< Sound stream type for voice recognition by service (Since 4.0) */
73 SOUND_STREAM_TYPE_MEDIA_COMPRESSED, /**< Sound stream type for compressed media (Since 4.0) */
74 SOUND_STREAM_TYPE_MEDIA_NETWORK_SOURCE, /**< Sound stream type for network source media (Since 5.5) */
75 } sound_stream_type_internal_e;
79 * @brief Enumeration for sound filters.
83 SOUND_FILTER_LOW_PASS = 0,
84 SOUND_FILTER_HIGH_PASS,
86 SOUND_FILTER_SOUNDALIVE,
91 * @brief Enumeration for filter preset.
95 SOUND_FILTER_PRESET_LOW_PASS_NONE = 0, /**< Filter preset for SOUND_FILTER_LOW_PASS none */
96 SOUND_FILTER_PRESET_LOW_PASS_UNDER_240HZ, /**< Filter preset for SOUND_FILTER_LOW_PASS under 240hz */
97 SOUND_FILTER_PRESET_LOW_PASS_UNDER_480HZ, /**< Filter preset for SOUND_FILTER_LOW_PASS under 480hz */
98 SOUND_FILTER_PRESET_HIGH_PASS_NONE, /**< Filter preset for SOUND_FILTER_HIGH_PASS none */
99 SOUND_FILTER_PRESET_HIGH_PASS_OVER_240HZ, /**< Filter preset for SOUND_FILTER_HIGH_PASS over 240hz */
100 SOUND_FILTER_PRESET_HIGH_PASS_OVER_480HZ, /**< Filter preset for SOUND_FILTER_HIGH_PASS over 480hz */
101 SOUND_FILTER_PRESET_DELAY_NONE, /**< Filter preset for SOUND_FILTER_DELAY none */
102 SOUND_FILTER_PRESET_DELAY_1SEC, /**< Filter preset for SOUND_FILTER_DELAY 1 second */
103 SOUND_FILTER_PRESET_DELAY_2SEC, /**< Filter preset for SOUND_FILTER_DELAY 2 seconds */
104 SOUND_FILTER_PRESET_SOUNDALIVE_NORMAL, /**< Filter preset for SOUND_FILTER_SOUNDALIVE normal */
105 SOUND_FILTER_PRESET_SOUNDALIVE_TUBE, /**< Filter preset for SOUND_FILTER_SOUNDALIVE tube */
106 SOUND_FILTER_PRESET_SOUNDALIVE_VIRT71, /**< Filter preset for SOUND_FILTER_SOUNDALIVE virtual7.1 */
107 SOUND_FILTER_PRESET_SOUNDALIVE_STUDIO, /**< Filter preset for SOUND_FILTER_SOUNDALIVE studio */
108 SOUND_FILTER_PRESET_SOUNDALIVE_CLUB, /**< Filter preset for SOUND_FILTER_SOUNDALIVE club */
109 SOUND_FILTER_PRESET_SOUNDALIVE_CONCERT_HALL, /**< Filter preset for SOUND_FILTER_SOUNDALIVE concert hall */
110 } sound_filter_preset_e;
114 * @brief Gets the maximum master volume level.
116 * @param[out] max_level The maximum volume level
117 * @return @c 0 on success,
118 * otherwise a negative error value
119 * @retval #SOUND_MANAGER_ERROR_NONE Success
120 * @retval #SOUND_MANAGER_ERROR_INVALID_PARAMETER Invalid parameter
121 * @retval #SOUND_MANAGER_ERROR_INTERNAL Internal error inside the sound system
122 * @see sound_manager_set_master_volume()
123 * @see sound_manager_get_master_volume()
125 int sound_manager_get_max_master_volume(int *max_level);
129 * @brief Sets the master volume level.
131 * @param[in] level The volume level to be set
132 * @return @c 0 on success,
133 * otherwise a negative error value
134 * @retval #SOUND_MANAGER_ERROR_NONE Success
135 * @retval #SOUND_MANAGER_ERROR_INVALID_PARAMETER Invalid parameter
136 * @retval #SOUND_MANAGER_ERROR_INTERNAL Internal error inside the sound system
137 * @see sound_manager_get_max_master_volume()
138 * @see sound_manager_get_master_volume()
140 int sound_manager_set_master_volume(int level);
144 * @brief Gets the master volume level.
146 * @param[out] level The current master volume level
147 * @return @c 0 on success,
148 * otherwise a negative error value
149 * @retval #SOUND_MANAGER_ERROR_NONE Success
150 * @retval #SOUND_MANAGER_ERROR_INVALID_PARAMETER Invalid parameter
151 * @retval #SOUND_MANAGER_ERROR_INTERNAL Internal error inside the sound system
152 * @see sound_manager_get_max_master_volume()
153 * @see sound_manager_set_master_volume()
155 int sound_manager_get_master_volume(int *level);
159 * @brief Sets the mute specified for a particular sound type.
162 * @privilege %http://tizen.org/privilege/volume.set
163 * @param[in] type The sound type
164 * @param[in] mute The mute state to be set: (@c true = mute, @c false = unmute)
165 * @return @c 0 on success,
166 * otherwise a negative error value
167 * @retval #SOUND_MANAGER_ERROR_NONE Success
168 * @retval #SOUND_MANAGER_ERROR_INVALID_PARAMETER Invalid parameter
169 * @retval #SOUND_MANAGER_ERROR_PERMISSION_DENIED Permission denied
170 * @retval #SOUND_MANAGER_ERROR_INTERNAL Internal error inside the sound system
171 * @see sound_manager_get_mute()
173 int sound_manager_set_mute(sound_type_e type, bool mute);
177 * @brief Gets the mute specified for a particular sound type.
179 * @param[in] type The sound type
180 * @param[out] muted The current mute state: (@c true = muted, @c false = unmuted)
181 * @return @c 0 on success,
182 * otherwise a negative error value
183 * @retval #SOUND_MANAGER_ERROR_NONE Success
184 * @retval #SOUND_MANAGER_ERROR_INVALID_PARAMETER Invalid parameter
185 * @retval #SOUND_MANAGER_ERROR_INTERNAL Internal error inside the sound system
186 * @see sound_manager_set_mute()
188 int sound_manager_get_mute(sound_type_e type, bool *muted);
192 * @brief Creates a handle for stream information.
195 * @remarks Do not call this API within sound_stream_focus_state_changed_cb() and sound_stream_focus_state_watch_cb(),\n
196 * otherwise SOUND_MANAGER_ERROR_INVALID_OPERATION will be returned.\n
197 * To apply the stream policy according to this stream information, this handle should be passed to other APIs\n
198 * related to playback or recording.(e.g. player, wav-player, audio-io, etc.)
200 * @param[in] stream_type The type of stream for internal usage
201 * @param[in] callback The focus state change callback function
202 * @param[in] user_data The user data to be passed to the callback function
203 * @param[out] stream_info The handle of stream information
204 * @return @c 0 on success,
205 * otherwise a negative error value
206 * @retval #SOUND_MANAGER_ERROR_NONE Success
207 * @retval #SOUND_MANAGER_ERROR_INVALID_PARAMETER Invalid parameter
208 * @retval #SOUND_MANAGER_ERROR_INVALID_OPERATION Invalid operation
209 * @retval #SOUND_MANAGER_ERROR_INTERNAL Internal error inside the sound system
210 * @see sound_manager_destroy_stream_information()
211 * @see sound_manager_add_device_for_stream_routing()
212 * @see sound_manager_remove_device_for_stream_routing()
213 * @see sound_manager_remove_all_devices_for_stream_routing()
214 * @see sound_manager_apply_stream_routing()
215 * @see sound_manager_acquire_focus()
216 * @see sound_manager_destroy_focus()
217 * @see sound_manager_get_focus_state()
219 int sound_manager_create_stream_information_internal(sound_stream_type_internal_e stream_type, sound_stream_focus_state_changed_cb callback, void *user_data, sound_stream_info_h *stream_info);
223 * @brief Sets the stream routing option.
226 * @remarks If the stream has not been made yet, this setting will be applied when the stream starts to play.
228 * @param[in] stream_info The handle of stream information
229 * @param[in] name The name of option
230 * @param[in] value The value of option
231 * @return @c 0 on success,
232 * otherwise a negative error value
233 * @retval #SOUND_MANAGER_ERROR_NONE Success
234 * @retval #SOUND_MANAGER_ERROR_INVALID_PARAMETER Invalid parameter
235 * @retval #SOUND_MANAGER_ERROR_INVALID_STATE Invalid state
236 * @retval #SOUND_MANAGER_ERROR_INTERNAL Internal error inside the sound system
237 * @pre Call sound_manager_create_stream_information() before calling this function.
238 * @see sound_manager_create_stream_information()
239 * @see sound_manager_create_stream_information_internal()
240 * @see sound_manager_destroy_stream_information()
242 int sound_manager_set_stream_routing_option(sound_stream_info_h stream_info, const char *name, int value);
246 * @brief Queries if this stream information handle is available for the API.
248 * @param[in] stream_info The handle of stream information
249 * @param[in] api_name The native API name
250 * @param[out] is_available If @c true the api_name is available, @c false the api_name is not available for this strema_info
251 * @return @c 0 on success,
252 * otherwise a negative error value
253 * @retval #SOUND_MANAGER_ERROR_NONE Success
254 * @retval #SOUND_MANAGER_ERROR_INVALID_PARAMETER Invalid parameter
255 * @see sound_manager_create_stream_information()
256 * @see sound_manager_destroy_stream_information()
258 int sound_manager_is_available_stream_information(sound_stream_info_h stream_info, native_api_e api_name, bool *is_available);
262 * @brief Gets stream type from the stream information handle.
264 * @param[in] stream_info The handle of stream information
265 * @param[out] type The stream type
266 * @return @c 0 on success,
267 * otherwise a negative error value
268 * @retval #SOUND_MANAGER_ERROR_NONE Success
269 * @retval #SOUND_MANAGER_ERROR_INVALID_PARAMETER Invalid parameter
270 * @see sound_manager_create_stream_information()
271 * @see sound_manager_destroy_stream_information()
273 int sound_manager_get_type_from_stream_information(sound_stream_info_h stream_info, char **type);
277 * @brief Gets the index of the stream information handle.
279 * @param[in] stream_info The handle of stream information
280 * @param[out] index The unique index
282 * @return @c 0 on success,
283 * otherwise a negative error value
284 * @retval #SOUND_MANAGER_ERROR_NONE Success
285 * @retval #SOUND_MANAGER_ERROR_INVALID_PARAMETER Invalid parameter
286 * @see sound_manager_create_stream_information()
287 * @see sound_manager_destroy_stream_information()
289 int sound_manager_get_index_from_stream_information(sound_stream_info_h stream_info, int *index);
293 * @brief Adds the device id to the stream information for the stream routing.
296 * @remarks Use sound_manager_get_device_list(), sound_manager_get_next_device() and sound_manager_get_device_id()\n
297 * to get the device id.\n
298 * #SOUND_MANAGER_ERROR_POLICY could be returned according to the stream type of the @a stream_info.\n
299 * The available types of the @a stream_info for this function are #SOUND_STREAM_TYPE_VOIP and #SOUND_STREAM_TYPE_MEDIA_EXTERNAL_ONLY.
301 * @param[in] stream_info The handle of stream information
302 * @param[in] device_id The device id
303 * @return @c 0 on success,
304 * otherwise a negative error value
305 * @retval #SOUND_MANAGER_ERROR_NONE Success
306 * @retval #SOUND_MANAGER_ERROR_INVALID_PARAMETER Invalid parameter
307 * @retval #SOUND_MANAGER_ERROR_POLICY Noncompliance with the sound system policy
308 * @pre Call sound_manager_create_stream_information() before calling this function.
309 * @post You can apply this setting by calling sound_manager_apply_stream_routing().
310 * @see sound_manager_create_stream_information()
311 * @see sound_manager_destroy_stream_information()
312 * @see sound_manager_remove_device_id_for_stream_routing()
313 * @see sound_manager_remove_all_devices_for_stream_routing()
314 * @see sound_manager_apply_stream_routing()
316 int sound_manager_add_device_id_for_stream_routing(sound_stream_info_h stream_info, int device_id);
320 * @brief Removes the device id to the stream information for the stream routing.
323 * @remarks Use sound_manager_get_device_list(), sound_manager_get_next_device() and sound_manager_get_device_id()\n
324 * to get the device id.\n
326 * @param[in] stream_info The handle of stream information
327 * @param[in] device The device id
328 * @return @c 0 on success,
329 * otherwise a negative error value
330 * @retval #SOUND_MANAGER_ERROR_NONE Success
331 * @retval #SOUND_MANAGER_ERROR_INVALID_PARAMETER Invalid parameter
332 * @pre Call sound_manager_create_stream_information() and sound_manager_add_device_for_stream_routing() before calling this function.
333 * @post You can apply this setting by calling sound_manager_apply_stream_routing().
334 * @see sound_manager_create_stream_information()
335 * @see sound_manager_destroy_stream_information()
336 * @see sound_manager_add_device_id_for_stream_routing()
337 * @see sound_manager_remove_all_devices_for_stream_routing()
338 * @see sound_manager_apply_stream_routing()
340 int sound_manager_remove_device_id_for_stream_routing(sound_stream_info_h stream_info, int device_id);
344 * @brief Gets the state of the device by id.
346 * @param[in] device_id The device id
347 * @param[out] state The state of the device
348 * @return @c 0 on success,
349 * otherwise a negative error value
350 * @retval #SOUND_MANAGER_ERROR_NONE Success
351 * @retval #SOUND_MANAGER_ERROR_INVALID_PARAMETER Invalid parameter
352 * @see sound_manager_get_device_list()
353 * @see sound_manager_get_next_device()
354 * @see sound_manager_get_prev_device()
355 * @see sound_manager_get_device_id()
356 * @see sound_manager_free_device_list()
358 int sound_manager_get_device_state_by_id(int device_id, sound_device_state_e *state);
362 * @brief Checks if the device is running.
364 * @param[in] device_id The device id
365 * @param[out] is_running Whether the device is running or not: (@c true = running, @c false = not running)
366 * @return @c 0 on success,
367 * otherwise a negative error value
368 * @retval #SOUND_MANAGER_ERROR_NONE Success
369 * @retval #SOUND_MANAGER_ERROR_INVALID_PARAMETER Invalid parameter
370 * @see sound_manager_get_device_list()
371 * @see sound_manager_get_next_device()
372 * @see sound_manager_get_prev_device()
373 * @see sound_manager_get_device_id()
374 * @see sound_manager_free_device_list()
376 int sound_manager_is_device_running_by_id(int device_id, bool *is_running);
380 * @brief Gets the device's supported sample formats.
383 * @remarks @a device_id should be #SOUND_DEVICE_USB_AUDIO type and an output device,\n
384 * otherwise #SOUND_MANAGER_ERROR_INVALID_OPERATION will be returned.\n
385 * Use sound_manager_get_device_io_direction() to check if it is an output device or not.\n
386 * The @a formats should be released using free().
388 * @param[in] device_id The device id
389 * @param[out] formats The supported sample format list
390 * @param[out] num_of_elems The number of elements in the sample format list
391 * @return @c 0 on success,
392 * otherwise a negative error value
393 * @retval #SOUND_MANAGER_ERROR_NONE Success
394 * @retval #SOUND_MANAGER_ERROR_INVALID_PARAMETER Invalid parameter
395 * @retval #SOUND_MANAGER_ERROR_INVALID_OPERATION Invalid operation
396 * @retval #SOUND_MANAGER_ERROR_INTERNAL Internal error inside the sound system
397 * @see sound_manager_set_sample_format_by_id()
398 * @see sound_manager_get_sample_format_by_id()
400 int sound_manager_get_supported_sample_formats_by_id(int device_id, sound_sample_format_e **formats, unsigned int *num_of_elems);
404 * @brief Sets the device's sample format.
407 * @remarks @a device_id should be #SOUND_DEVICE_USB_AUDIO type and an output device.\n
408 * @a format should be one of the values received from sound_manager_get_supported_sample_formats_by_id(),\n
409 * otherwise #SOUND_MANAGER_ERROR_INVALID_OPERATION will be returned.\n
410 * Use sound_manager_get_device_io_direction() to check if it is an output device or not.
412 * @param[in] device_id The device id
413 * @param[in] format The sample format
414 * @return @c 0 on success,
415 * otherwise a negative error value
416 * @retval #SOUND_MANAGER_ERROR_NONE Success
417 * @retval #SOUND_MANAGER_ERROR_INVALID_PARAMETER Invalid parameter
418 * @retval #SOUND_MANAGER_ERROR_INVALID_OPERATION Invalid operation
419 * @retval #SOUND_MANAGER_ERROR_INTERNAL Internal error inside the sound system
420 * @see sound_manager_get_supported_sample_formats_by_id()
421 * @see sound_manager_get_sample_format_by_id()
423 int sound_manager_set_sample_format_by_id(int device_id, sound_sample_format_e format);
427 * @brief Gets the device's sample format.
430 * @remarks @a device_id should be #SOUND_DEVICE_USB_AUDIO type and an output device,\n
431 * otherwise #SOUND_MANAGER_ERROR_INVALID_OPERATION will be returned.\n
432 * Use sound_manager_get_device_io_direction() to check if it is an output device or not.
434 * @param[in] device_id The device id
435 * @param[out] format The sample format
436 * @return @c 0 on success,
437 * otherwise a negative error value
438 * @retval #SOUND_MANAGER_ERROR_NONE Success
439 * @retval #SOUND_MANAGER_ERROR_INVALID_PARAMETER Invalid parameter
440 * @retval #SOUND_MANAGER_ERROR_INVALID_OPERATION Invalid operation
441 * @retval #SOUND_MANAGER_ERROR_INTERNAL Internal error inside the sound system
442 * @see sound_manager_get_supported_sample_formats_by_id()
443 * @see sound_manager_set_sample_format_by_id()
445 int sound_manager_get_sample_format_by_id(int device_id, sound_sample_format_e *format);
449 * @brief Gets the device's supported sample rates.
452 * @remarks @a device_id should be #SOUND_DEVICE_USB_AUDIO type and an output device,\n
453 * otherwise #SOUND_MANAGER_ERROR_INVALID_OPERATION will be returned.\n
454 * Use sound_manager_get_device_io_direction() to check if it is an output device or not.\n
455 * The @a rates should be released using free().
457 * @param[in] device_id The device id
458 * @param[out] rates The supported sample rate list
459 * @param[out] num_of_elems The number of elements in the sample rate list
460 * @return @c 0 on success,
461 * otherwise a negative error value
462 * @retval #SOUND_MANAGER_ERROR_NONE Success
463 * @retval #SOUND_MANAGER_ERROR_INVALID_PARAMETER Invalid parameter
464 * @retval #SOUND_MANAGER_ERROR_INVALID_OPERATION Invalid operation
465 * @retval #SOUND_MANAGER_ERROR_INTERNAL Internal error inside the sound system
466 * @see sound_manager_set_sample_rate_by_id()
467 * @see sound_manager_get_sample_rate_by_id()
469 int sound_manager_get_supported_sample_rates_by_id(int device_id, sound_sample_rate_e **rates, unsigned int *num_of_elems);
473 * @brief Sets the device's sample rate.
476 * @remarks @a device_id should be #SOUND_DEVICE_USB_AUDIO type and an output device.\n
477 * @a rate should be one of the values received from sound_manager_get_supported_sample_rates(),\n
478 * otherwise #SOUND_MANAGER_ERROR_INVALID_OPERATION will be returned.\n
479 * Use sound_manager_get_device_io_direction() to check if it is an output device or not.
481 * @param[in] device_id The device id
482 * @param[in] rate The sample rate
483 * @return @c 0 on success,
484 * otherwise a negative error value
485 * @retval #SOUND_MANAGER_ERROR_NONE Success
486 * @retval #SOUND_MANAGER_ERROR_INVALID_PARAMETER Invalid parameter
487 * @retval #SOUND_MANAGER_ERROR_INVALID_OPERATION Invalid operation
488 * @retval #SOUND_MANAGER_ERROR_INTERNAL Internal error inside the sound system
489 * @see sound_manager_get_supported_sample_rates_by_id()
490 * @see sound_manager_get_sample_rate_by_id()
492 int sound_manager_set_sample_rate_by_id(int device_id, sound_sample_rate_e rate);
496 * @brief Gets the device's sample rate.
499 * @remarks @a device_id should be #SOUND_DEVICE_USB_AUDIO type and an output device,\n
500 * otherwise #SOUND_MANAGER_ERROR_INVALID_OPERATION will be returned.\n
501 * Use sound_manager_get_device_io_direction() to check if it is an output device or not.
503 * @param[in] device_id The device id
504 * @param[out] rate The sample rate
505 * @return @c 0 on success,
506 * otherwise a negative error value
507 * @retval #SOUND_MANAGER_ERROR_NONE Success
508 * @retval #SOUND_MANAGER_ERROR_INVALID_PARAMETER Invalid parameter
509 * @retval #SOUND_MANAGER_ERROR_INVALID_OPERATION Invalid operation
510 * @retval #SOUND_MANAGER_ERROR_INTERNAL Internal error inside the sound system
511 * @see sound_manager_get_supported_sample_rates_by_id()
512 * @see sound_manager_set_sample_rate_by_id()
514 int sound_manager_get_sample_rate_by_id(int device_id, sound_sample_rate_e *rate);
518 * @brief Sets the device's 'avoid resampling' property.
521 * @remarks @a device_id should be #SOUND_DEVICE_USB_AUDIO type and an output device,\n
522 * otherwise #SOUND_MANAGER_ERROR_INVALID_OPERATION will be returned.\n
523 * Use sound_manager_get_device_io_direction() to check if it is an output device or not.\n
524 * The 'avoid resampling' property is not enabled as default. With this enabled, the device will\n
525 * use the first stream's original sample format and rate without resampling if supported.
527 * @param[in] device_id The device id
528 * @param[in] enable The 'avoid resampling' property value to set: (@c true = enable, @c false = disable)
529 * @return @c 0 on success,
530 * otherwise a negative error value
531 * @retval #SOUND_MANAGER_ERROR_NONE Success
532 * @retval #SOUND_MANAGER_ERROR_INVALID_PARAMETER Invalid parameter
533 * @retval #SOUND_MANAGER_ERROR_INVALID_OPERATION Invalid operation
534 * @retval #SOUND_MANAGER_ERROR_INTERNAL Internal error inside the sound system
535 * @see sound_manager_get_avoid_resampling_by_id()
537 int sound_manager_set_avoid_resampling_by_id(int device_id, bool enable);
541 * @brief Gets the device's 'avoid resampling' property.
544 * @remarks @a device_id should be #SOUND_DEVICE_USB_AUDIO type and an output device,\n
545 * otherwise #SOUND_MANAGER_ERROR_INVALID_OPERATION will be returned.\n
546 * Use sound_manager_get_device_io_direction() to check if it is an output device or not.\n
547 * The default value of 'avoid resampling' is false.
549 * @param[in] device_id The device id
550 * @param[in] enabled The value of 'avoid resampling' property: (@c true = enabled, @c false = disabled)
551 * @return @c 0 on success,
552 * otherwise a negative error value
553 * @retval #SOUND_MANAGER_ERROR_NONE Success
554 * @retval #SOUND_MANAGER_ERROR_INVALID_PARAMETER Invalid parameter
555 * @retval #SOUND_MANAGER_ERROR_INVALID_OPERATION Invalid operation
556 * @retval #SOUND_MANAGER_ERROR_INTERNAL Internal error inside the sound system
557 * @see sound_manager_set_avoid_resampling_by_id()
559 int sound_manager_get_avoid_resampling_by_id(int device_id, bool *enabled);
563 * @brief Sets the restriction of stream type only for media.
566 * @remarks @a device_id should be #SOUND_DEVICE_USB_AUDIO type and an output device,\n
567 * otherwise #SOUND_MANAGER_ERROR_INVALID_OPERATION will be returned.\n
568 * Use sound_manager_get_device_io_direction() to check if it is an output device or not.\n
569 * This property is not enabled as default. With this enabled, no other stream types\n
570 * except #SOUND_STREAM_TYPE_MEDIA is not allowed to @a device.
572 * @param[in] device_id The device id
573 * @param[in] enable The 'media stream only' property value to set: (@c true = enable, @c false = disable)
574 * @return @c 0 on success,
575 * otherwise a negative error value
576 * @retval #SOUND_MANAGER_ERROR_NONE Success
577 * @retval #SOUND_MANAGER_ERROR_INVALID_PARAMETER Invalid parameter
578 * @retval #SOUND_MANAGER_ERROR_INVALID_OPERATION Invalid operation
579 * @retval #SOUND_MANAGER_ERROR_INTERNAL Internal error inside the sound system
580 * @see sound_manager_get_media_stream_only_by_id()
582 int sound_manager_set_media_stream_only_by_id(int device_id, bool enable);
586 * @brief Gets the restriction of stream type only for media.
589 * @remarks @a device_id should be #SOUND_DEVICE_USB_AUDIO type and an output device,\n
590 * otherwise #SOUND_MANAGER_ERROR_INVALID_OPERATION will be returned.\n
591 * Use sound_manager_get_device_io_direction() to check if it is an output device or not.\n
592 * The property is not enabled as default.
594 * @param[in] device_id The device id
595 * @param[out] enabled The value of 'media stream only' property: (@c true = enabled, @c false = disabled)
596 * @return @c 0 on success,
597 * otherwise a negative error value
598 * @retval #SOUND_MANAGER_ERROR_NONE Success
599 * @retval #SOUND_MANAGER_ERROR_INVALID_PARAMETER Invalid parameter
600 * @retval #SOUND_MANAGER_ERROR_INVALID_OPERATION Invalid operation
601 * @retval #SOUND_MANAGER_ERROR_INTERNAL Internal error inside the sound system
602 * @see sound_manager_set_media_stream_only_by_id()
604 int sound_manager_get_media_stream_only_by_id(int device_id, bool *enabled);
608 * @brief Creates a virtual stream handle.
610 * @param[in] stream_info The handle of stream information
611 * @param[out] virtual_stream The handle of virtual stream
612 * @return @c 0 on success,
613 * otherwise a negative error value
614 * @retval #SOUND_MANAGER_ERROR_NONE Success
615 * @retval #SOUND_MANAGER_ERROR_INVALID_PARAMETER Invalid parameter
616 * @retval #SOUND_MANAGER_ERROR_INTERNAL Internal error inside the sound system
617 * @retval #SOUND_MANAGER_ERROR_NOT_SUPPORTED Not supported
618 * @see sound_manager_create_stream_information()
619 * @see sound_manager_destroy_stream_information()
620 * @see sound_manager_destroy_virtual_stream()
621 * @see sound_manager_start_virtual_stream()
622 * @see sound_manager_stop_virtual_stream()
624 int sound_manager_create_virtual_stream(sound_stream_info_h stream_info, virtual_sound_stream_h *virtual_stream);
628 * @brief Destroys the virtual stream handle.
630 * @param[in] virtual_stream The handle of virtual stream
631 * @return @c 0 on success,
632 * otherwise a negative error value
633 * @retval #SOUND_MANAGER_ERROR_NONE Success
634 * @retval #SOUND_MANAGER_ERROR_INVALID_PARAMETER Invalid parameter
635 * @retval #SOUND_MANAGER_ERROR_INVALID_STATE Invalid state
636 * @see sound_manager_create_virtual_stream()
637 * @see sound_manager_start_virtual_stream()
638 * @see sound_manager_stop_virtual_stream()
640 int sound_manager_destroy_virtual_stream(virtual_sound_stream_h virtual_stream);
644 * @brief Starts the virtual stream.
646 * @param[in] virtual_stream The handle of virtual stream
647 * @return @c 0 on success,
648 * otherwise a negative error value
649 * @retval #SOUND_MANAGER_ERROR_NONE Success
650 * @retval #SOUND_MANAGER_ERROR_INVALID_PARAMETER Invalid parameter
651 * @retval #SOUND_MANAGER_ERROR_INVALID_STATE Invalid state
652 * @retval #SOUND_MANAGER_ERROR_INTERNAL Internal error inside the sound system
653 * @see sound_manager_create_virtual_stream()
654 * @see sound_manager_destroy_virtual_stream()
655 * @see sound_manager_stop_virtual_stream()
657 int sound_manager_start_virtual_stream(virtual_sound_stream_h virtual_stream);
661 * @brief Stops the virtual stream.
663 * @param[in] virtual_stream The handle of virtual stream
664 * @return @c 0 on success,
665 * otherwise a negative error value
666 * @retval #SOUND_MANAGER_ERROR_NONE Success
667 * @retval #SOUND_MANAGER_ERROR_INVALID_PARAMETER Invalid parameter
668 * @retval #SOUND_MANAGER_ERROR_INVALID_STATE Invalid state
669 * @see sound_manager_create_virtual_stream()
670 * @see sound_manager_destroy_virtual_stream()
671 * @see sound_manager_start_virtual_stream()
673 int sound_manager_stop_virtual_stream(virtual_sound_stream_h virtual_stream);
677 * @brief Sets the virtual stream volume.
679 * @param[in] virtual_stream The handle of virtual stream
680 * @param[in] ratio The volume ratio to be set (Min.:0.0 ~ Max.:1.0, default:1.0)
681 * @return @c 0 on success,
682 * otherwise a negative error value
683 * @retval #SOUND_MANAGER_ERROR_NONE Success
684 * @retval #SOUND_MANAGER_ERROR_INVALID_PARAMETER Invalid parameter
685 * @retval #SOUND_MANAGER_ERROR_INVALID_STATE Invalid state
686 * @retval #SOUND_MANAGER_ERROR_INTERNAL Internal error inside the sound system
687 * @see sound_manager_create_virtual_stream()
688 * @see sound_manager_destroy_virtual_stream()
689 * @see sound_manager_start_virtual_stream()
691 int sound_manager_set_virtual_stream_volume(virtual_sound_stream_h virtual_stream, double ratio);
695 * @brief Set sound filter and apply to audio streams given selected stream type.
697 * @param[in] stream_type stream type to apply
698 * @param[in] filter sound filter to apply
699 * @return @c 0 on success,
700 * otherwise a negative error value
701 * @retval #SOUND_MANAGER_ERROR_NONE Success
702 * @retval #SOUND_MANAGER_ERROR_INVALID_PARAMETER Invalid parameter
703 * @retval #SOUND_MANAGER_ERROR_INTERNAL Internal error inside the sound system
704 * @retval #SOUND_MANAGER_ERROR_NOT_SUPPORTED Not supported
705 * @see sound_manager_unset_filter()
707 int sound_manager_set_filter(sound_stream_type_e stream_type, sound_filter_e filter);
711 * @brief Unset sound filter and remove from audio streams given selected stream type.
713 * @param[in] stream_type stream type to remove
714 * @return @c 0 on success,
715 * otherwise a negative error value
716 * @retval #SOUND_MANAGER_ERROR_NONE Success
717 * @retval #SOUND_MANAGER_ERROR_INVALID_PARAMETER Invalid parameter
718 * @retval #SOUND_MANAGER_ERROR_INTERNAL Internal error inside the sound system
719 * @retval #SOUND_MANAGER_ERROR_NOT_SUPPORTED Not supported
720 * @see sound_manager_set_filter()
722 int sound_manager_unset_filter(sound_stream_type_e stream_type);
726 * @brief Apply preset configuration to the filter according to selected stream type.
728 * @param[in] stream_type given stream type
729 * @param[in] filter given sound filter
730 * @param[in] preset filter preset to apply
731 * @return @c 0 on success,
732 * otherwise a negative error value
733 * @retval #SOUND_MANAGER_ERROR_NONE Success
734 * @retval #SOUND_MANAGER_ERROR_INVALID_PARAMETER Invalid parameter
735 * @retval #SOUND_MANAGER_ERROR_INTERNAL Internal error inside the sound system
736 * @retval #SOUND_MANAGER_ERROR_NOT_SUPPORTED Not supported
737 * @see sound_manager_set_filter()
739 int sound_manager_set_filter_preset(sound_stream_type_e stream_type, sound_filter_e filter, sound_filter_preset_e preset);
743 * @brief Gets the vendor id of the device.
746 * @remarks It works only with USB audio device. Otherwise, #SOUND_MANAGER_ERROR_NOT_SUPPORTED will be returned.\n
748 * @param[in] device The device item
749 * @param[out] vendor_id The vendor id of the device
750 * @return @c 0 on success,
751 * otherwise a negative error value
752 * @retval #SOUND_MANAGER_ERROR_NONE Success
753 * @retval #SOUND_MANAGER_ERROR_INVALID_PARAMETER Invalid parameter
754 * @retval #SOUND_MANAGER_ERROR_NOT_SUPPORTED Not supported
755 * @see sound_manager_get_device_list()
756 * @see sound_manager_get_next_device()
757 * @see sound_manager_get_prev_device()
758 * @see sound_manager_get_device_type()
759 * @see sound_manager_get_device_io_direction()
760 * @see sound_manager_get_device_name()
761 * @see sound_manager_get_device_state()
762 * @see sound_manager_get_device_id()
763 * @see sound_manager_get_device_product_id()
764 * @see sound_manager_free_device_list()
766 int sound_manager_get_device_vendor_id(sound_device_h device, int *vendor_id);
770 * @brief Gets the product id of the device.
773 * @remarks It works only with USB audio device. Otherwise, #SOUND_MANAGER_ERROR_NOT_SUPPORTED will be returned.\n
775 * @param[in] device The device item
776 * @param[out] product_id The product id of the device
777 * @return @c 0 on success,
778 * otherwise a negative error value
779 * @retval #SOUND_MANAGER_ERROR_NONE Success
780 * @retval #SOUND_MANAGER_ERROR_INVALID_PARAMETER Invalid parameter
781 * @retval #SOUND_MANAGER_ERROR_NOT_SUPPORTED Not supported
782 * @see sound_manager_get_device_list()
783 * @see sound_manager_get_next_device()
784 * @see sound_manager_get_prev_device()
785 * @see sound_manager_get_device_type()
786 * @see sound_manager_get_device_io_direction()
787 * @see sound_manager_get_device_name()
788 * @see sound_manager_get_device_state()
789 * @see sound_manager_get_device_id()
790 * @see sound_manager_get_device_vendor_id()
791 * @see sound_manager_free_device_list()
793 int sound_manager_get_device_product_id(sound_device_h device, int *product_id);
796 * @brief Checks if the stream information is using the device.
799 * @param[in] stream_info The handle of stream information
800 * @param[in] device_id The device id
801 * @param[out] is_on Whether the stream info is using the device or not: (@c true = use, @c false = not use)
802 * @return @c 0 on success,
803 * otherwise a negative error value
804 * @retval #SOUND_MANAGER_ERROR_NONE Success
805 * @retval #SOUND_MANAGER_ERROR_INVALID_PARAMETER Invalid parameter
806 * @retval #SOUND_MANAGER_ERROR_INTERNAL Internal error inside the sound system
807 * @see sound_manager_create_stream_information()
808 * @see sound_manager_destroy_stream_information()
809 * @see sound_manager_get_device_list()
810 * @see sound_manager_get_next_device()
811 * @see sound_manager_get_prev_device()
812 * @see sound_manager_get_device_id()
813 * @see sound_manager_get_device_name()
814 * @see sound_manager_free_device_list()
816 int sound_manager_is_stream_on_device_by_id(sound_stream_info_h stream_info, int device_id, bool *is_on);
820 * @brief Sets ACM master mode.
823 * @remarks The master mode is not enabled as default.
825 * @param[in] enable The master mode to be set: (@c true = master, @c false = slave)
826 * @return @c 0 on success,
827 * otherwise a negative error value
828 * @retval #SOUND_MANAGER_ERROR_NONE Success
829 * @retval #SOUND_MANAGER_ERROR_INTERNAL Internal error inside the sound system
831 int sound_manager_set_acm_master_mode(bool enable);
841 #endif /* __TIZEN_MEDIA_SOUND_MANAGER_INTERNAL_H__ */