|
Tizen Native API
4.0
|
The WAV Player API provides functions for playing the waveform audio file format(*.wav).
#include <wav_player.h>
The WAV Player API allows you to simply play and stop a wav file. To play a certain wav file, call wave_player_start() 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 (const char *path, sound_type_e type, wav_player_playback_completed_cb callback, void *user_data, int *id) TIZEN_DEPRECATED_API |
| Plays a WAV file. | |
| 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_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 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().
| [in] | id | The completed wav player ID |
| [in] | user_data | The user data passed from the callback registration function |
| enum wav_player_error_e |
Enumeration of error codes for WAV player.
| int wav_player_start | ( | const char * | path, |
| sound_type_e | type, | ||
| wav_player_playback_completed_cb | callback, | ||
| void * | user_data, | ||
| int * | id | ||
| ) |
Plays a WAV file.
| [in] | path | The file path to play |
| [in] | type | The sound type |
| [in] | callback | The callback function to invoke when a WAV file is finished playing |
| [in] | user_data | The user data to be passed to the callback function |
| [out] | id | The WAV player ID ( can be set to NULL ) |
0 on success, otherwise a negative error value | 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 |
| 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.
| [in] | path | The file path to play |
| [in] | stream_info | The sound stream information handle |
| [in] | callback | The callback function to be invoked when a 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) |
0 on success, otherwise a negative error value | 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 |
| int wav_player_stop | ( | int | id | ) |
Stops playing the WAV file.
| [in] | id | The WAV player ID to stop |
| WAV_PLAYER_ERROR_NONE | Successful |
| WAV_PLAYER_ERROR_INVALID_PARAMETER | Invalid parameter |
| WAV_PLAYER_ERROR_INVALID_OPERATION | Invalid operation |