mirror of
https://github.com/MihailRis/voxelcore.git
synced 2026-10-13 06:51:51 +00:00
add audio::InputDevice
This commit is contained in:
parent
2b72f87c64
commit
27416ab0cd
4 changed files with 96 additions and 0 deletions
|
|
@ -108,6 +108,20 @@ namespace audio {
|
|||
}
|
||||
};
|
||||
|
||||
class InputDevice {
|
||||
public:
|
||||
virtual ~InputDevice() {};
|
||||
|
||||
virtual void startCapture() = 0;
|
||||
virtual void stopCapture() = 0;
|
||||
|
||||
/// @brief Get number of audio channels
|
||||
/// @return 1 if mono, 2 if stereo
|
||||
virtual uint getChannels() const = 0;
|
||||
|
||||
virtual size_t read(char* buffer, size_t bufferSize) = 0;
|
||||
};
|
||||
|
||||
/// @brief audio::PCMStream is a data source for audio::Stream
|
||||
class PCMStream {
|
||||
public:
|
||||
|
|
@ -345,6 +359,9 @@ namespace audio {
|
|||
virtual std::unique_ptr<Stream> openStream(
|
||||
std::shared_ptr<PCMStream> stream, bool keepSource
|
||||
) = 0;
|
||||
virtual std::unique_ptr<InputDevice> openInputDevice(
|
||||
uint sampleRate, uint channels, uint bitsPerSample
|
||||
) = 0;
|
||||
virtual void setListener(
|
||||
glm::vec3 position,
|
||||
glm::vec3 velocity,
|
||||
|
|
|
|||
Loading…
Add table
Add a link
Reference in a new issue