| Tizen Native API
    7.0
    | 
The WAV Player API provides functions for playing the waveform audio file format(*.wav).
Required Header
#include <wav_player.h>
Overview
The WAV Player API allows you to simply play and stop a wav file. To play a certain wav file, call wav_player_start_new() with a path to the .wav file. When playing a wav file is finished, wav_player_playback_completed_cb() will be invoked.
| Functions | |
| int | wav_player_start_new (const char *path, sound_stream_info_h stream_info, wav_player_playback_completed_cb callback, void *user_data, int *id) | 
| Plays a WAV file with stream information of sound-manager. | |
| int | wav_player_start_loop (const char *path, sound_stream_info_h stream_info, unsigned int loop_count, wav_player_playback_completed_cb callback, void *user_data, int *id) | 
| Plays a WAV file multiple times. | |
| int | wav_player_stop (int id) | 
| Stops playing the WAV file. | |
| Typedefs | |
| typedef void(* | wav_player_playback_completed_cb )(int id, void *user_data) | 
| Called when a WAV file has finished playing. | |
Typedef Documentation
| typedef void(* wav_player_playback_completed_cb)(int id, void *user_data) | 
Called when a WAV file has finished playing.
This callback is not invoked by calling wav_player_stop().
- Since :
- 2.3.1
- Parameters:
- 
  [in] id The completed wav player ID [in] user_data The user data passed from the callback registration function 
- See also:
- wav_player_start_new()
Enumeration Type Documentation
| enum wav_player_error_e | 
Enumeration of error codes for WAV player.
- Since :
- 2.3.1
Function Documentation
| int wav_player_start_loop | ( | const char * | path, | 
| sound_stream_info_h | stream_info, | ||
| unsigned int | loop_count, | ||
| wav_player_playback_completed_cb | callback, | ||
| void * | user_data, | ||
| int * | id | ||
| ) | 
Plays a WAV file multiple times.
- Since :
- 6.0
- Remarks:
- Voice Recognition and VOIP stream types are not supported by this function.
- Parameters:
- 
  [in] path The file path to play [in] stream_info The sound stream information handle [in] loop_count The number of times the file should be played ( 0indicates infinite loops)[in] callback The callback function to be invoked when the WAV file is no longer being played [in] user_data The user data to be passed to the callback function [out] id The WAV player ID (can be set to NULL)
- Returns:
- 0on success, otherwise a negative error value
- Return values:
- 
  WAV_PLAYER_ERROR_NONE Successful WAV_PLAYER_ERROR_INVALID_PARAMETER Invalid parameter WAV_PLAYER_ERROR_INVALID_OPERATION Invalid operation WAV_PLAYER_ERROR_FORMAT_NOT_SUPPORTED Not supported format WAV_PLAYER_ERROR_NOT_SUPPORTED_TYPE Not supported stream type 
- Postcondition:
- It invokes wav_player_playback_completed_cb() when the WAV file is no longer being played.
| int wav_player_start_new | ( | const char * | path, | 
| sound_stream_info_h | stream_info, | ||
| wav_player_playback_completed_cb | callback, | ||
| void * | user_data, | ||
| int * | id | ||
| ) | 
Plays a WAV file with stream information of sound-manager.
- Since :
- 3.0
- Remarks:
- Voice Recognition and VOIP stream types are not supported by this function.
- Parameters:
- 
  [in] path The file path to play [in] stream_info The sound stream information handle [in] callback The callback function to be invoked when the WAV file is no longer being played [in] user_data The user data to be passed to the callback function [out] id The WAV player ID (can be set to NULL)
- Returns:
- 0on success, otherwise a negative error value
- Return values:
- 
  WAV_PLAYER_ERROR_NONE Successful WAV_PLAYER_ERROR_INVALID_PARAMETER Invalid parameter WAV_PLAYER_ERROR_INVALID_OPERATION Invalid operation WAV_PLAYER_ERROR_FORMAT_NOT_SUPPORTED Not supported format WAV_PLAYER_ERROR_NOT_SUPPORTED_TYPE Not supported stream type 
- Postcondition:
- It invokes wav_player_playback_completed_cb() when the WAV file is no longer being played.
| int wav_player_stop | ( | int | id | ) | 
Stops playing the WAV file.
- Since :
- 2.3.1
- Remarks:
- If the playback of id has been already finished at the server side and
 wav_player_playback_completed_cb() is not invoked yet, WAV_PLAYER_ERROR_INVALID_OPERATION will be returned.
- Parameters:
- 
  [in] id The WAV player ID to stop 
- Returns:
- 0 on success, otherwise a negative error value.
- Return values:
- 
  WAV_PLAYER_ERROR_NONE Successful WAV_PLAYER_ERROR_INVALID_PARAMETER Invalid parameter WAV_PLAYER_ERROR_INVALID_OPERATION Invalid operation 
- See also:
- wav_player_start_new()