Pepper_42_C++_interfaces
|
#include <audio.h>
Public Member Functions | |
Audio () | |
An empty constructor for an Audio resource. More... | |
Audio (const InstanceHandle &instance, const AudioConfig &config, PPB_Audio_Callback callback, void *user_data) | |
Audio (const InstanceHandle &instance, const AudioConfig &config, PPB_Audio_Callback_1_0 callback, void *user_data) | |
AudioConfig & | config () |
const AudioConfig & | config () const |
bool | StartPlayback () |
bool | StopPlayback () |
![]() | |
Resource () | |
The default constructor. More... | |
Resource (const Resource &other) | |
virtual | ~Resource () |
Destructor. More... | |
Resource & | operator= (const Resource &other) |
bool | is_null () const |
PP_Resource | pp_resource () const |
PP_Resource | detach () |
Additional Inherited Members | |
![]() | |
Resource (PP_Resource resource) | |
Resource (PassRef, PP_Resource resource) | |
void | PassRefFromConstructor (PP_Resource resource) |
void | Clear () |
Sets this resource to null. This releases ownership of the resource. More... | |
An audio resource. Refer to the Audio chapter in the Developer's Guide for information on using this interface.
|
inline |
pp::Audio::Audio | ( | const InstanceHandle & | instance, |
const AudioConfig & | config, | ||
PPB_Audio_Callback | callback, | ||
void * | user_data | ||
) |
A constructor that creates an Audio resource. No sound will be heard until StartPlayback() is called. The callback is called with the buffer address and given user data whenever the buffer needs to be filled. From within the callback, you should not call PPB_Audio
functions. The callback will be called on a different thread than the one which created the interface. For performance-critical applications (such as low-latency audio), the callback should avoid blocking or calling functions that can obtain locks, such as malloc. The layout and the size of the buffer passed to the audio callback will be determined by the device configuration and is specified in the AudioConfig
documentation.
[in] | instance | The instance with which this resource will be associated. |
[in] | config | An AudioConfig containing the audio config resource. |
[in] | callback | A PPB_Audio_Callback callback function that the browser calls when it needs more samples to play. |
[in] | user_data | A pointer to user data used in the callback function. |
pp::Audio::Audio | ( | const InstanceHandle & | instance, |
const AudioConfig & | config, | ||
PPB_Audio_Callback_1_0 | callback, | ||
void * | user_data | ||
) |
A constructor that creates an Audio resource.
[in] | instance | The instance with which this resource will be associated. |
[in] | config | An AudioConfig containing the audio config resource. |
[in] | callback | A PPB_Audio_Callback_1_0 callback function that the browser calls when it needs more samples to play. |
[in] | user_data | A pointer to user data used in the callback function. |
|
inline |
|
inline |
bool pp::Audio::StartPlayback | ( | ) |
StartPlayback() starts playback of audio.
bool pp::Audio::StopPlayback | ( | ) |
StopPlayback stops playback of audio.