No version for distro humble showing github. Known supported distros are highlighted in the buttons above.

Package Summary

Tags No category tags.
Version 1.0.0
License Apache License, Version 2.0
Build type AMENT_CMAKE
Use RECOMMENDED

Repository Summary

Description ROS 2 packages for CyberDog
Checkout URI https://github.com/miroboticslab/cyberdog_ros2.git
VCS Type git
VCS Version main
Last Updated 2021-10-15
Dev Status UNKNOWN
Released UNRELEASED
Tags robotics ros ros2 cyberdog
Contributing Help Wanted (-)
Good First Issues (-)
Pull Requests to Review (-)

Package Description

Base audio package, including recording and playing

Additional Links

No additional links.

Maintainers

  • jia

Authors

No additional authors.

audio_base

audio_player

该模块用于播放多段或单段不定长PCM音频数据、wav格式音频文件,其底层实现为SDL2与SDL_mixer

官方帮助文档:SDL2SDL_mixer

包含文件:



主要接口部分如下:

namespace cyberdog_audio
{
#define DELAY_CHECK_TIME 1000
#define DEFAULT_PLAY_CHANNEL_NUM 4
#define DEFAULT_VOLUME MIX_MAX_VOLUME

#define AUDIO_FREQUENCY 16000
#define AUDIO_FORMAT MIX_DEFAULT_FORMAT
#define AUDIO_CHANNELS 1
#define AUDIO_CHUCKSIZE 2048

using callback = std::function<void (void)>;

class AudioPlayer
{
public:
  explicit AudioPlayer(
    int channel,
    callback finish_callback = nullptr,
    int volume_group = INDE_VOLUME_GROUP,
    int volume = DEFAULT_VOLUME);
  static int GetFreeChannel();
  static bool InitSuccess();

  static bool OpenReference();
  static void CloseReference();
  static int GetReferenceData(Uint8 * buff, int need_size);
  static size_t GetReferenceDataSize();

  void SetFinishCallBack(callback finish_callback);
  int SetVolume(int volume);
  void SetVolumeGroup(int volume_gp);
  int GetVolume();

  void AddPlay(Uint8 * buff, int len);
  void AddPlay(const char * file);
  void StopPlay();
  bool IsPlaying();
  bool InitReady();
};
}


其中宏定义:

  • DELAY_CHECK_TIME:播放线程每DELAY_CHECK_TIME(ms)检查一次是否正在播放音频,是否需要退出
  • DEFAULT_PLAY_CHANNEL_NUM:混音通道默认数量(通道数会根据根据需要动态增加数量)
  • DEFAULT_VOLUME:默认音量(0-128)
  • AUDIO_FREQUENCYAUDIO_FORMATAUDIO_CHANNELSAUDIO_CHUCKSIZE:为SDL_mixer初始化参数(官方文档

public函数:

构造函数: 初始化播放器对象

AudioPlayer(
  int channel,
  callback finish_callback = nullptr,
  int volume_group = INDE_VOLUME_GROUP,
  int volume = DEFAULT_VOLUME);

  • channel:使用的混音通道
  • finish_callback:播放队列完成后的回调函数
  • volume_group:音量通道组,改变该组中单个通道音量时,将改变所有同组通道音量
  • volume:该通道音量

获取空闲通道:返回空闲通道channel号

static int GetFreeChannel();

获取SDL初始化状态:返回SDL是否初始化成功

static bool InitSuccess();

打开音频播放反馈的参考通道并开始录制数据:返回是否成功打开

static bool OpenReference();

关闭音频播放反馈的参考通道并清除录制数据

```cpp

File truncated at 100 lines see the full file

CHANGELOG
No CHANGELOG found.

Package Dependencies

System Dependencies

No direct system dependencies.

Launch files

No launch files found

Messages

No message files found.

Services

No service files found

Plugins

No plugins found.

Recent questions tagged audio_base at Robotics Stack Exchange

No version for distro jazzy showing github. Known supported distros are highlighted in the buttons above.

Package Summary

Tags No category tags.
Version 1.0.0
License Apache License, Version 2.0
Build type AMENT_CMAKE
Use RECOMMENDED

Repository Summary

Description ROS 2 packages for CyberDog
Checkout URI https://github.com/miroboticslab/cyberdog_ros2.git
VCS Type git
VCS Version main
Last Updated 2021-10-15
Dev Status UNKNOWN
Released UNRELEASED
Tags robotics ros ros2 cyberdog
Contributing Help Wanted (-)
Good First Issues (-)
Pull Requests to Review (-)

Package Description

Base audio package, including recording and playing

Additional Links

No additional links.

Maintainers

  • jia

Authors

No additional authors.

audio_base

audio_player

该模块用于播放多段或单段不定长PCM音频数据、wav格式音频文件,其底层实现为SDL2与SDL_mixer

官方帮助文档:SDL2SDL_mixer

包含文件:



主要接口部分如下:

namespace cyberdog_audio
{
#define DELAY_CHECK_TIME 1000
#define DEFAULT_PLAY_CHANNEL_NUM 4
#define DEFAULT_VOLUME MIX_MAX_VOLUME

#define AUDIO_FREQUENCY 16000
#define AUDIO_FORMAT MIX_DEFAULT_FORMAT
#define AUDIO_CHANNELS 1
#define AUDIO_CHUCKSIZE 2048

using callback = std::function<void (void)>;

class AudioPlayer
{
public:
  explicit AudioPlayer(
    int channel,
    callback finish_callback = nullptr,
    int volume_group = INDE_VOLUME_GROUP,
    int volume = DEFAULT_VOLUME);
  static int GetFreeChannel();
  static bool InitSuccess();

  static bool OpenReference();
  static void CloseReference();
  static int GetReferenceData(Uint8 * buff, int need_size);
  static size_t GetReferenceDataSize();

  void SetFinishCallBack(callback finish_callback);
  int SetVolume(int volume);
  void SetVolumeGroup(int volume_gp);
  int GetVolume();

  void AddPlay(Uint8 * buff, int len);
  void AddPlay(const char * file);
  void StopPlay();
  bool IsPlaying();
  bool InitReady();
};
}


其中宏定义:

  • DELAY_CHECK_TIME:播放线程每DELAY_CHECK_TIME(ms)检查一次是否正在播放音频,是否需要退出
  • DEFAULT_PLAY_CHANNEL_NUM:混音通道默认数量(通道数会根据根据需要动态增加数量)
  • DEFAULT_VOLUME:默认音量(0-128)
  • AUDIO_FREQUENCYAUDIO_FORMATAUDIO_CHANNELSAUDIO_CHUCKSIZE:为SDL_mixer初始化参数(官方文档

public函数:

构造函数: 初始化播放器对象

AudioPlayer(
  int channel,
  callback finish_callback = nullptr,
  int volume_group = INDE_VOLUME_GROUP,
  int volume = DEFAULT_VOLUME);

  • channel:使用的混音通道
  • finish_callback:播放队列完成后的回调函数
  • volume_group:音量通道组,改变该组中单个通道音量时,将改变所有同组通道音量
  • volume:该通道音量

获取空闲通道:返回空闲通道channel号

static int GetFreeChannel();

获取SDL初始化状态:返回SDL是否初始化成功

static bool InitSuccess();

打开音频播放反馈的参考通道并开始录制数据:返回是否成功打开

static bool OpenReference();

关闭音频播放反馈的参考通道并清除录制数据

```cpp

File truncated at 100 lines see the full file

CHANGELOG
No CHANGELOG found.

Package Dependencies

System Dependencies

No direct system dependencies.

Launch files

No launch files found

Messages

No message files found.

Services

No service files found

Plugins

No plugins found.

Recent questions tagged audio_base at Robotics Stack Exchange

No version for distro kilted showing github. Known supported distros are highlighted in the buttons above.

Package Summary

Tags No category tags.
Version 1.0.0
License Apache License, Version 2.0
Build type AMENT_CMAKE
Use RECOMMENDED

Repository Summary

Description ROS 2 packages for CyberDog
Checkout URI https://github.com/miroboticslab/cyberdog_ros2.git
VCS Type git
VCS Version main
Last Updated 2021-10-15
Dev Status UNKNOWN
Released UNRELEASED
Tags robotics ros ros2 cyberdog
Contributing Help Wanted (-)
Good First Issues (-)
Pull Requests to Review (-)

Package Description

Base audio package, including recording and playing

Additional Links

No additional links.

Maintainers

  • jia

Authors

No additional authors.

audio_base

audio_player

该模块用于播放多段或单段不定长PCM音频数据、wav格式音频文件,其底层实现为SDL2与SDL_mixer

官方帮助文档:SDL2SDL_mixer

包含文件:



主要接口部分如下:

namespace cyberdog_audio
{
#define DELAY_CHECK_TIME 1000
#define DEFAULT_PLAY_CHANNEL_NUM 4
#define DEFAULT_VOLUME MIX_MAX_VOLUME

#define AUDIO_FREQUENCY 16000
#define AUDIO_FORMAT MIX_DEFAULT_FORMAT
#define AUDIO_CHANNELS 1
#define AUDIO_CHUCKSIZE 2048

using callback = std::function<void (void)>;

class AudioPlayer
{
public:
  explicit AudioPlayer(
    int channel,
    callback finish_callback = nullptr,
    int volume_group = INDE_VOLUME_GROUP,
    int volume = DEFAULT_VOLUME);
  static int GetFreeChannel();
  static bool InitSuccess();

  static bool OpenReference();
  static void CloseReference();
  static int GetReferenceData(Uint8 * buff, int need_size);
  static size_t GetReferenceDataSize();

  void SetFinishCallBack(callback finish_callback);
  int SetVolume(int volume);
  void SetVolumeGroup(int volume_gp);
  int GetVolume();

  void AddPlay(Uint8 * buff, int len);
  void AddPlay(const char * file);
  void StopPlay();
  bool IsPlaying();
  bool InitReady();
};
}


其中宏定义:

  • DELAY_CHECK_TIME:播放线程每DELAY_CHECK_TIME(ms)检查一次是否正在播放音频,是否需要退出
  • DEFAULT_PLAY_CHANNEL_NUM:混音通道默认数量(通道数会根据根据需要动态增加数量)
  • DEFAULT_VOLUME:默认音量(0-128)
  • AUDIO_FREQUENCYAUDIO_FORMATAUDIO_CHANNELSAUDIO_CHUCKSIZE:为SDL_mixer初始化参数(官方文档

public函数:

构造函数: 初始化播放器对象

AudioPlayer(
  int channel,
  callback finish_callback = nullptr,
  int volume_group = INDE_VOLUME_GROUP,
  int volume = DEFAULT_VOLUME);

  • channel:使用的混音通道
  • finish_callback:播放队列完成后的回调函数
  • volume_group:音量通道组,改变该组中单个通道音量时,将改变所有同组通道音量
  • volume:该通道音量

获取空闲通道:返回空闲通道channel号

static int GetFreeChannel();

获取SDL初始化状态:返回SDL是否初始化成功

static bool InitSuccess();

打开音频播放反馈的参考通道并开始录制数据:返回是否成功打开

static bool OpenReference();

关闭音频播放反馈的参考通道并清除录制数据

```cpp

File truncated at 100 lines see the full file

CHANGELOG
No CHANGELOG found.

Package Dependencies

System Dependencies

No direct system dependencies.

Launch files

No launch files found

Messages

No message files found.

Services

No service files found

Plugins

No plugins found.

Recent questions tagged audio_base at Robotics Stack Exchange

No version for distro rolling showing github. Known supported distros are highlighted in the buttons above.

Package Summary

Tags No category tags.
Version 1.0.0
License Apache License, Version 2.0
Build type AMENT_CMAKE
Use RECOMMENDED

Repository Summary

Description ROS 2 packages for CyberDog
Checkout URI https://github.com/miroboticslab/cyberdog_ros2.git
VCS Type git
VCS Version main
Last Updated 2021-10-15
Dev Status UNKNOWN
Released UNRELEASED
Tags robotics ros ros2 cyberdog
Contributing Help Wanted (-)
Good First Issues (-)
Pull Requests to Review (-)

Package Description

Base audio package, including recording and playing

Additional Links

No additional links.

Maintainers

  • jia

Authors

No additional authors.

audio_base

audio_player

该模块用于播放多段或单段不定长PCM音频数据、wav格式音频文件,其底层实现为SDL2与SDL_mixer

官方帮助文档:SDL2SDL_mixer

包含文件:



主要接口部分如下:

namespace cyberdog_audio
{
#define DELAY_CHECK_TIME 1000
#define DEFAULT_PLAY_CHANNEL_NUM 4
#define DEFAULT_VOLUME MIX_MAX_VOLUME

#define AUDIO_FREQUENCY 16000
#define AUDIO_FORMAT MIX_DEFAULT_FORMAT
#define AUDIO_CHANNELS 1
#define AUDIO_CHUCKSIZE 2048

using callback = std::function<void (void)>;

class AudioPlayer
{
public:
  explicit AudioPlayer(
    int channel,
    callback finish_callback = nullptr,
    int volume_group = INDE_VOLUME_GROUP,
    int volume = DEFAULT_VOLUME);
  static int GetFreeChannel();
  static bool InitSuccess();

  static bool OpenReference();
  static void CloseReference();
  static int GetReferenceData(Uint8 * buff, int need_size);
  static size_t GetReferenceDataSize();

  void SetFinishCallBack(callback finish_callback);
  int SetVolume(int volume);
  void SetVolumeGroup(int volume_gp);
  int GetVolume();

  void AddPlay(Uint8 * buff, int len);
  void AddPlay(const char * file);
  void StopPlay();
  bool IsPlaying();
  bool InitReady();
};
}


其中宏定义:

  • DELAY_CHECK_TIME:播放线程每DELAY_CHECK_TIME(ms)检查一次是否正在播放音频,是否需要退出
  • DEFAULT_PLAY_CHANNEL_NUM:混音通道默认数量(通道数会根据根据需要动态增加数量)
  • DEFAULT_VOLUME:默认音量(0-128)
  • AUDIO_FREQUENCYAUDIO_FORMATAUDIO_CHANNELSAUDIO_CHUCKSIZE:为SDL_mixer初始化参数(官方文档

public函数:

构造函数: 初始化播放器对象

AudioPlayer(
  int channel,
  callback finish_callback = nullptr,
  int volume_group = INDE_VOLUME_GROUP,
  int volume = DEFAULT_VOLUME);

  • channel:使用的混音通道
  • finish_callback:播放队列完成后的回调函数
  • volume_group:音量通道组,改变该组中单个通道音量时,将改变所有同组通道音量
  • volume:该通道音量

获取空闲通道:返回空闲通道channel号

static int GetFreeChannel();

获取SDL初始化状态:返回SDL是否初始化成功

static bool InitSuccess();

打开音频播放反馈的参考通道并开始录制数据:返回是否成功打开

static bool OpenReference();

关闭音频播放反馈的参考通道并清除录制数据

```cpp

File truncated at 100 lines see the full file

CHANGELOG
No CHANGELOG found.

Package Dependencies

System Dependencies

No direct system dependencies.

Launch files

No launch files found

Messages

No message files found.

Services

No service files found

Plugins

No plugins found.

Recent questions tagged audio_base at Robotics Stack Exchange

Package Summary

Tags No category tags.
Version 1.0.0
License Apache License, Version 2.0
Build type AMENT_CMAKE
Use RECOMMENDED

Repository Summary

Description ROS 2 packages for CyberDog
Checkout URI https://github.com/miroboticslab/cyberdog_ros2.git
VCS Type git
VCS Version main
Last Updated 2021-10-15
Dev Status UNKNOWN
Released UNRELEASED
Tags robotics ros ros2 cyberdog
Contributing Help Wanted (-)
Good First Issues (-)
Pull Requests to Review (-)

Package Description

Base audio package, including recording and playing

Additional Links

No additional links.

Maintainers

  • jia

Authors

No additional authors.

audio_base

audio_player

该模块用于播放多段或单段不定长PCM音频数据、wav格式音频文件,其底层实现为SDL2与SDL_mixer

官方帮助文档:SDL2SDL_mixer

包含文件:



主要接口部分如下:

namespace cyberdog_audio
{
#define DELAY_CHECK_TIME 1000
#define DEFAULT_PLAY_CHANNEL_NUM 4
#define DEFAULT_VOLUME MIX_MAX_VOLUME

#define AUDIO_FREQUENCY 16000
#define AUDIO_FORMAT MIX_DEFAULT_FORMAT
#define AUDIO_CHANNELS 1
#define AUDIO_CHUCKSIZE 2048

using callback = std::function<void (void)>;

class AudioPlayer
{
public:
  explicit AudioPlayer(
    int channel,
    callback finish_callback = nullptr,
    int volume_group = INDE_VOLUME_GROUP,
    int volume = DEFAULT_VOLUME);
  static int GetFreeChannel();
  static bool InitSuccess();

  static bool OpenReference();
  static void CloseReference();
  static int GetReferenceData(Uint8 * buff, int need_size);
  static size_t GetReferenceDataSize();

  void SetFinishCallBack(callback finish_callback);
  int SetVolume(int volume);
  void SetVolumeGroup(int volume_gp);
  int GetVolume();

  void AddPlay(Uint8 * buff, int len);
  void AddPlay(const char * file);
  void StopPlay();
  bool IsPlaying();
  bool InitReady();
};
}


其中宏定义:

  • DELAY_CHECK_TIME:播放线程每DELAY_CHECK_TIME(ms)检查一次是否正在播放音频,是否需要退出
  • DEFAULT_PLAY_CHANNEL_NUM:混音通道默认数量(通道数会根据根据需要动态增加数量)
  • DEFAULT_VOLUME:默认音量(0-128)
  • AUDIO_FREQUENCYAUDIO_FORMATAUDIO_CHANNELSAUDIO_CHUCKSIZE:为SDL_mixer初始化参数(官方文档

public函数:

构造函数: 初始化播放器对象

AudioPlayer(
  int channel,
  callback finish_callback = nullptr,
  int volume_group = INDE_VOLUME_GROUP,
  int volume = DEFAULT_VOLUME);

  • channel:使用的混音通道
  • finish_callback:播放队列完成后的回调函数
  • volume_group:音量通道组,改变该组中单个通道音量时,将改变所有同组通道音量
  • volume:该通道音量

获取空闲通道:返回空闲通道channel号

static int GetFreeChannel();

获取SDL初始化状态:返回SDL是否初始化成功

static bool InitSuccess();

打开音频播放反馈的参考通道并开始录制数据:返回是否成功打开

static bool OpenReference();

关闭音频播放反馈的参考通道并清除录制数据

```cpp

File truncated at 100 lines see the full file

CHANGELOG
No CHANGELOG found.

Package Dependencies

System Dependencies

No direct system dependencies.

Launch files

No launch files found

Messages

No message files found.

Services

No service files found

Plugins

No plugins found.

Recent questions tagged audio_base at Robotics Stack Exchange

No version for distro galactic showing github. Known supported distros are highlighted in the buttons above.

Package Summary

Tags No category tags.
Version 1.0.0
License Apache License, Version 2.0
Build type AMENT_CMAKE
Use RECOMMENDED

Repository Summary

Description ROS 2 packages for CyberDog
Checkout URI https://github.com/miroboticslab/cyberdog_ros2.git
VCS Type git
VCS Version main
Last Updated 2021-10-15
Dev Status UNKNOWN
Released UNRELEASED
Tags robotics ros ros2 cyberdog
Contributing Help Wanted (-)
Good First Issues (-)
Pull Requests to Review (-)

Package Description

Base audio package, including recording and playing

Additional Links

No additional links.

Maintainers

  • jia

Authors

No additional authors.

audio_base

audio_player

该模块用于播放多段或单段不定长PCM音频数据、wav格式音频文件,其底层实现为SDL2与SDL_mixer

官方帮助文档:SDL2SDL_mixer

包含文件:



主要接口部分如下:

namespace cyberdog_audio
{
#define DELAY_CHECK_TIME 1000
#define DEFAULT_PLAY_CHANNEL_NUM 4
#define DEFAULT_VOLUME MIX_MAX_VOLUME

#define AUDIO_FREQUENCY 16000
#define AUDIO_FORMAT MIX_DEFAULT_FORMAT
#define AUDIO_CHANNELS 1
#define AUDIO_CHUCKSIZE 2048

using callback = std::function<void (void)>;

class AudioPlayer
{
public:
  explicit AudioPlayer(
    int channel,
    callback finish_callback = nullptr,
    int volume_group = INDE_VOLUME_GROUP,
    int volume = DEFAULT_VOLUME);
  static int GetFreeChannel();
  static bool InitSuccess();

  static bool OpenReference();
  static void CloseReference();
  static int GetReferenceData(Uint8 * buff, int need_size);
  static size_t GetReferenceDataSize();

  void SetFinishCallBack(callback finish_callback);
  int SetVolume(int volume);
  void SetVolumeGroup(int volume_gp);
  int GetVolume();

  void AddPlay(Uint8 * buff, int len);
  void AddPlay(const char * file);
  void StopPlay();
  bool IsPlaying();
  bool InitReady();
};
}


其中宏定义:

  • DELAY_CHECK_TIME:播放线程每DELAY_CHECK_TIME(ms)检查一次是否正在播放音频,是否需要退出
  • DEFAULT_PLAY_CHANNEL_NUM:混音通道默认数量(通道数会根据根据需要动态增加数量)
  • DEFAULT_VOLUME:默认音量(0-128)
  • AUDIO_FREQUENCYAUDIO_FORMATAUDIO_CHANNELSAUDIO_CHUCKSIZE:为SDL_mixer初始化参数(官方文档

public函数:

构造函数: 初始化播放器对象

AudioPlayer(
  int channel,
  callback finish_callback = nullptr,
  int volume_group = INDE_VOLUME_GROUP,
  int volume = DEFAULT_VOLUME);

  • channel:使用的混音通道
  • finish_callback:播放队列完成后的回调函数
  • volume_group:音量通道组,改变该组中单个通道音量时,将改变所有同组通道音量
  • volume:该通道音量

获取空闲通道:返回空闲通道channel号

static int GetFreeChannel();

获取SDL初始化状态:返回SDL是否初始化成功

static bool InitSuccess();

打开音频播放反馈的参考通道并开始录制数据:返回是否成功打开

static bool OpenReference();

关闭音频播放反馈的参考通道并清除录制数据

```cpp

File truncated at 100 lines see the full file

CHANGELOG
No CHANGELOG found.

Package Dependencies

System Dependencies

No direct system dependencies.

Launch files

No launch files found

Messages

No message files found.

Services

No service files found

Plugins

No plugins found.

Recent questions tagged audio_base at Robotics Stack Exchange

No version for distro iron showing github. Known supported distros are highlighted in the buttons above.

Package Summary

Tags No category tags.
Version 1.0.0
License Apache License, Version 2.0
Build type AMENT_CMAKE
Use RECOMMENDED

Repository Summary

Description ROS 2 packages for CyberDog
Checkout URI https://github.com/miroboticslab/cyberdog_ros2.git
VCS Type git
VCS Version main
Last Updated 2021-10-15
Dev Status UNKNOWN
Released UNRELEASED
Tags robotics ros ros2 cyberdog
Contributing Help Wanted (-)
Good First Issues (-)
Pull Requests to Review (-)

Package Description

Base audio package, including recording and playing

Additional Links

No additional links.

Maintainers

  • jia

Authors

No additional authors.

audio_base

audio_player

该模块用于播放多段或单段不定长PCM音频数据、wav格式音频文件,其底层实现为SDL2与SDL_mixer

官方帮助文档:SDL2SDL_mixer

包含文件:



主要接口部分如下:

namespace cyberdog_audio
{
#define DELAY_CHECK_TIME 1000
#define DEFAULT_PLAY_CHANNEL_NUM 4
#define DEFAULT_VOLUME MIX_MAX_VOLUME

#define AUDIO_FREQUENCY 16000
#define AUDIO_FORMAT MIX_DEFAULT_FORMAT
#define AUDIO_CHANNELS 1
#define AUDIO_CHUCKSIZE 2048

using callback = std::function<void (void)>;

class AudioPlayer
{
public:
  explicit AudioPlayer(
    int channel,
    callback finish_callback = nullptr,
    int volume_group = INDE_VOLUME_GROUP,
    int volume = DEFAULT_VOLUME);
  static int GetFreeChannel();
  static bool InitSuccess();

  static bool OpenReference();
  static void CloseReference();
  static int GetReferenceData(Uint8 * buff, int need_size);
  static size_t GetReferenceDataSize();

  void SetFinishCallBack(callback finish_callback);
  int SetVolume(int volume);
  void SetVolumeGroup(int volume_gp);
  int GetVolume();

  void AddPlay(Uint8 * buff, int len);
  void AddPlay(const char * file);
  void StopPlay();
  bool IsPlaying();
  bool InitReady();
};
}


其中宏定义:

  • DELAY_CHECK_TIME:播放线程每DELAY_CHECK_TIME(ms)检查一次是否正在播放音频,是否需要退出
  • DEFAULT_PLAY_CHANNEL_NUM:混音通道默认数量(通道数会根据根据需要动态增加数量)
  • DEFAULT_VOLUME:默认音量(0-128)
  • AUDIO_FREQUENCYAUDIO_FORMATAUDIO_CHANNELSAUDIO_CHUCKSIZE:为SDL_mixer初始化参数(官方文档

public函数:

构造函数: 初始化播放器对象

AudioPlayer(
  int channel,
  callback finish_callback = nullptr,
  int volume_group = INDE_VOLUME_GROUP,
  int volume = DEFAULT_VOLUME);

  • channel:使用的混音通道
  • finish_callback:播放队列完成后的回调函数
  • volume_group:音量通道组,改变该组中单个通道音量时,将改变所有同组通道音量
  • volume:该通道音量

获取空闲通道:返回空闲通道channel号

static int GetFreeChannel();

获取SDL初始化状态:返回SDL是否初始化成功

static bool InitSuccess();

打开音频播放反馈的参考通道并开始录制数据:返回是否成功打开

static bool OpenReference();

关闭音频播放反馈的参考通道并清除录制数据

```cpp

File truncated at 100 lines see the full file

CHANGELOG
No CHANGELOG found.

Package Dependencies

System Dependencies

No direct system dependencies.

Launch files

No launch files found

Messages

No message files found.

Services

No service files found

Plugins

No plugins found.

Recent questions tagged audio_base at Robotics Stack Exchange

No version for distro melodic showing github. Known supported distros are highlighted in the buttons above.

Package Summary

Tags No category tags.
Version 1.0.0
License Apache License, Version 2.0
Build type AMENT_CMAKE
Use RECOMMENDED

Repository Summary

Description ROS 2 packages for CyberDog
Checkout URI https://github.com/miroboticslab/cyberdog_ros2.git
VCS Type git
VCS Version main
Last Updated 2021-10-15
Dev Status UNKNOWN
Released UNRELEASED
Tags robotics ros ros2 cyberdog
Contributing Help Wanted (-)
Good First Issues (-)
Pull Requests to Review (-)

Package Description

Base audio package, including recording and playing

Additional Links

No additional links.

Maintainers

  • jia

Authors

No additional authors.

audio_base

audio_player

该模块用于播放多段或单段不定长PCM音频数据、wav格式音频文件,其底层实现为SDL2与SDL_mixer

官方帮助文档:SDL2SDL_mixer

包含文件:



主要接口部分如下:

namespace cyberdog_audio
{
#define DELAY_CHECK_TIME 1000
#define DEFAULT_PLAY_CHANNEL_NUM 4
#define DEFAULT_VOLUME MIX_MAX_VOLUME

#define AUDIO_FREQUENCY 16000
#define AUDIO_FORMAT MIX_DEFAULT_FORMAT
#define AUDIO_CHANNELS 1
#define AUDIO_CHUCKSIZE 2048

using callback = std::function<void (void)>;

class AudioPlayer
{
public:
  explicit AudioPlayer(
    int channel,
    callback finish_callback = nullptr,
    int volume_group = INDE_VOLUME_GROUP,
    int volume = DEFAULT_VOLUME);
  static int GetFreeChannel();
  static bool InitSuccess();

  static bool OpenReference();
  static void CloseReference();
  static int GetReferenceData(Uint8 * buff, int need_size);
  static size_t GetReferenceDataSize();

  void SetFinishCallBack(callback finish_callback);
  int SetVolume(int volume);
  void SetVolumeGroup(int volume_gp);
  int GetVolume();

  void AddPlay(Uint8 * buff, int len);
  void AddPlay(const char * file);
  void StopPlay();
  bool IsPlaying();
  bool InitReady();
};
}


其中宏定义:

  • DELAY_CHECK_TIME:播放线程每DELAY_CHECK_TIME(ms)检查一次是否正在播放音频,是否需要退出
  • DEFAULT_PLAY_CHANNEL_NUM:混音通道默认数量(通道数会根据根据需要动态增加数量)
  • DEFAULT_VOLUME:默认音量(0-128)
  • AUDIO_FREQUENCYAUDIO_FORMATAUDIO_CHANNELSAUDIO_CHUCKSIZE:为SDL_mixer初始化参数(官方文档

public函数:

构造函数: 初始化播放器对象

AudioPlayer(
  int channel,
  callback finish_callback = nullptr,
  int volume_group = INDE_VOLUME_GROUP,
  int volume = DEFAULT_VOLUME);

  • channel:使用的混音通道
  • finish_callback:播放队列完成后的回调函数
  • volume_group:音量通道组,改变该组中单个通道音量时,将改变所有同组通道音量
  • volume:该通道音量

获取空闲通道:返回空闲通道channel号

static int GetFreeChannel();

获取SDL初始化状态:返回SDL是否初始化成功

static bool InitSuccess();

打开音频播放反馈的参考通道并开始录制数据:返回是否成功打开

static bool OpenReference();

关闭音频播放反馈的参考通道并清除录制数据

```cpp

File truncated at 100 lines see the full file

CHANGELOG
No CHANGELOG found.

Package Dependencies

System Dependencies

No direct system dependencies.

Launch files

No launch files found

Messages

No message files found.

Services

No service files found

Plugins

No plugins found.

Recent questions tagged audio_base at Robotics Stack Exchange

No version for distro noetic showing github. Known supported distros are highlighted in the buttons above.

Package Summary

Tags No category tags.
Version 1.0.0
License Apache License, Version 2.0
Build type AMENT_CMAKE
Use RECOMMENDED

Repository Summary

Description ROS 2 packages for CyberDog
Checkout URI https://github.com/miroboticslab/cyberdog_ros2.git
VCS Type git
VCS Version main
Last Updated 2021-10-15
Dev Status UNKNOWN
Released UNRELEASED
Tags robotics ros ros2 cyberdog
Contributing Help Wanted (-)
Good First Issues (-)
Pull Requests to Review (-)

Package Description

Base audio package, including recording and playing

Additional Links

No additional links.

Maintainers

  • jia

Authors

No additional authors.

audio_base

audio_player

该模块用于播放多段或单段不定长PCM音频数据、wav格式音频文件,其底层实现为SDL2与SDL_mixer

官方帮助文档:SDL2SDL_mixer

包含文件:



主要接口部分如下:

namespace cyberdog_audio
{
#define DELAY_CHECK_TIME 1000
#define DEFAULT_PLAY_CHANNEL_NUM 4
#define DEFAULT_VOLUME MIX_MAX_VOLUME

#define AUDIO_FREQUENCY 16000
#define AUDIO_FORMAT MIX_DEFAULT_FORMAT
#define AUDIO_CHANNELS 1
#define AUDIO_CHUCKSIZE 2048

using callback = std::function<void (void)>;

class AudioPlayer
{
public:
  explicit AudioPlayer(
    int channel,
    callback finish_callback = nullptr,
    int volume_group = INDE_VOLUME_GROUP,
    int volume = DEFAULT_VOLUME);
  static int GetFreeChannel();
  static bool InitSuccess();

  static bool OpenReference();
  static void CloseReference();
  static int GetReferenceData(Uint8 * buff, int need_size);
  static size_t GetReferenceDataSize();

  void SetFinishCallBack(callback finish_callback);
  int SetVolume(int volume);
  void SetVolumeGroup(int volume_gp);
  int GetVolume();

  void AddPlay(Uint8 * buff, int len);
  void AddPlay(const char * file);
  void StopPlay();
  bool IsPlaying();
  bool InitReady();
};
}


其中宏定义:

  • DELAY_CHECK_TIME:播放线程每DELAY_CHECK_TIME(ms)检查一次是否正在播放音频,是否需要退出
  • DEFAULT_PLAY_CHANNEL_NUM:混音通道默认数量(通道数会根据根据需要动态增加数量)
  • DEFAULT_VOLUME:默认音量(0-128)
  • AUDIO_FREQUENCYAUDIO_FORMATAUDIO_CHANNELSAUDIO_CHUCKSIZE:为SDL_mixer初始化参数(官方文档

public函数:

构造函数: 初始化播放器对象

AudioPlayer(
  int channel,
  callback finish_callback = nullptr,
  int volume_group = INDE_VOLUME_GROUP,
  int volume = DEFAULT_VOLUME);

  • channel:使用的混音通道
  • finish_callback:播放队列完成后的回调函数
  • volume_group:音量通道组,改变该组中单个通道音量时,将改变所有同组通道音量
  • volume:该通道音量

获取空闲通道:返回空闲通道channel号

static int GetFreeChannel();

获取SDL初始化状态:返回SDL是否初始化成功

static bool InitSuccess();

打开音频播放反馈的参考通道并开始录制数据:返回是否成功打开

static bool OpenReference();

关闭音频播放反馈的参考通道并清除录制数据

```cpp

File truncated at 100 lines see the full file

CHANGELOG
No CHANGELOG found.

Package Dependencies

System Dependencies

No direct system dependencies.

Launch files

No launch files found

Messages

No message files found.

Services

No service files found

Plugins

No plugins found.

Recent questions tagged audio_base at Robotics Stack Exchange