| 123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596 |
- /*
- * Copyright (c) 2006-2022, RT-Thread Development Team
- *
- * SPDX-License-Identifier: Apache-2.0
- *
- * Date Author Notes
- * 2019-07-15 Zero-Free first implementation
- */
- #ifndef __WAVPLAYER_H__
- #define __WAVPLAYER_H__
- /**
- * wav player status
- */
- enum PLAYER_STATE
- {
- PLAYER_STATE_STOPED = 0,
- PLAYER_STATE_PLAYING = 1,
- PLAYER_STATE_PAUSED = 2,
- };
- /**
- * @brief Play wav music
- *
- * @param uri the pointer for file path
- *
- * @return
- * - 0 Success
- * - others Failed
- */
- int wavplayer_play(char *uri);
- /**
- * @brief Stop music
- *
- * @return
- * - 0 Success
- * - others Failed
- */
- int wavplayer_stop(void);
- /**
- * @brief Pause music
- *
- * @return
- * - 0 Success
- * - others Failed
- */
- int wavplayer_pause(void);
- /**
- * @brief Resume music
- *
- * @return
- * - 0 Success
- * - others Failed
- */
- int wavplayer_resume(void);
- /**
- * @brief Set volume
- *
- * @param volume volume value(0 ~ 99)
- *
- * @return
- * - 0 Success
- * - others Failed
- */
- int wavplayer_volume_set(int volume);
- /**
- * @brief Get volume
- *
- * @return volume value(0 ~ 99)
- */
- int wavplayer_volume_get(void);
- /**
- * @brief Get wav player state
- *
- * @return
- * - PLAYER_STATE_STOPED stoped status
- * - PLAYER_STATE_PLAYING playing status
- * - PLAYER_STATE_PAUSED paused
- */
- int wavplayer_state_get(void);
- /**
- * @brief Get the uri that is currently playing
- *
- * @return uri that is currently playing
- */
- char *wavplayer_uri_get(void);
- #endif
|