duerapp_media.h 1.8 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566
  1. /**
  2. * Copyright (2017) Baidu Inc. All rights reserved.
  3. *
  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
  7. *
  8. * http://www.apache.org/licenses/LICENSE-2.0
  9. *
  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.
  15. */
  16. /**
  17. * File: duerapp_media.h
  18. * Auth: Renhe Zhang (v_zhangrenhe@baidu.com)
  19. * Desc: Media module API.
  20. */
  21. #ifndef BAIDU_DUER_LIBDUER_DEVICE_EXAMPLES_DCS3_LINUX_DUERAPP_MEDIA_H
  22. #define BAIDU_DUER_LIBDUER_DEVICE_EXAMPLES_DCS3_LINUX_DUERAPP_MEDIA_H
  23. #include "duerapp_config.h"
  24. typedef enum{
  25. MEDIA_SPEAK_PLAY,
  26. MEDIA_SPEAK_STOP,
  27. }duer_speak_state_t;
  28. typedef enum{
  29. MEDIA_TONE_PLAY,
  30. MEDIA_TONE_STOP,
  31. }duer_tone_state_t;
  32. typedef enum{
  33. MEDIA_AUDIO_PLAY,
  34. MEDIA_AUDIO_PAUSE,
  35. MEDIA_AUDIO_STOP,
  36. }duer_audio_state_t;
  37. void duer_media_init();
  38. void duer_media_destroy();
  39. void duer_media_speak_play(const char *url);
  40. void duer_media_speak_stop();
  41. void duer_media_audio_start(const char *url);
  42. void duer_media_audio_resume(const char *url, int offset);
  43. void duer_media_audio_stop();
  44. void duer_media_audio_pause();
  45. int duer_media_audio_get_position();
  46. duer_audio_state_t duer_media_audio_state();
  47. void duer_media_volume_change(int volume);
  48. void duer_media_set_volume(int volume);
  49. int duer_media_get_volume();
  50. void duer_media_set_mute(bool mute);
  51. bool duer_media_get_mute();
  52. void duer_media_tone_play(const char *url,int wait_tm);
  53. #endif // BAIDU_DUER_LIBDUER_DEVICE_EXAMPLES_DCS3_LINUX_DUERAPP_MEDIA_H