diff --git a/module-audio/Audio/AudioDevice.hpp b/module-audio/Audio/AudioDevice.hpp index f27d38b54..3dd991753 100644 --- a/module-audio/Audio/AudioDevice.hpp +++ b/module-audio/Audio/AudioDevice.hpp @@ -27,7 +27,8 @@ namespace audio None, Audiocodec, Cellular, - Bluetooth + BluetoothA2DP, + BluetoothHSP }; virtual ~AudioDevice() = default; diff --git a/module-audio/Audio/Profiles/ProfilePlaybackBluetoothA2DP.hpp b/module-audio/Audio/Profiles/ProfilePlaybackBluetoothA2DP.hpp index 9b5e01700..546199c3d 100644 --- a/module-audio/Audio/Profiles/ProfilePlaybackBluetoothA2DP.hpp +++ b/module-audio/Audio/Profiles/ProfilePlaybackBluetoothA2DP.hpp @@ -21,7 +21,7 @@ namespace audio .inputGain = 0, .inputPath = audio::codec::InputPath::None, .outputPath = audio::codec::OutputPath::None}, - AudioDevice::Type::Bluetooth) + AudioDevice::Type::BluetoothA2DP) {} }; diff --git a/module-audio/Audio/Profiles/ProfileRecordingBluetoothHSP.hpp b/module-audio/Audio/Profiles/ProfileRecordingBluetoothHSP.hpp index 7850fdc95..4234ac8ea 100644 --- a/module-audio/Audio/Profiles/ProfileRecordingBluetoothHSP.hpp +++ b/module-audio/Audio/Profiles/ProfileRecordingBluetoothHSP.hpp @@ -23,7 +23,7 @@ namespace audio .inputGain = static_cast(gain), .inputPath = audio::codec::InputPath::None, .outputPath = audio::codec::OutputPath::None}, - AudioDevice::Type::Bluetooth) + AudioDevice::Type::BluetoothHSP) {} }; diff --git a/module-audio/Audio/Profiles/ProfileRoutingBluetoothHSP.hpp b/module-audio/Audio/Profiles/ProfileRoutingBluetoothHSP.hpp index d48f57aa0..f70e847ef 100644 --- a/module-audio/Audio/Profiles/ProfileRoutingBluetoothHSP.hpp +++ b/module-audio/Audio/Profiles/ProfileRoutingBluetoothHSP.hpp @@ -23,7 +23,7 @@ namespace audio .inputGain = static_cast(gain), .inputPath = audio::codec::InputPath::None, .outputPath = audio::codec::OutputPath::None}, - AudioDevice::Type::Bluetooth) + AudioDevice::Type::BluetoothHSP) {} }; diff --git a/module-audio/Audio/transcode/InputTranscodeProxy.cpp b/module-audio/Audio/transcode/InputTranscodeProxy.cpp index 36f181c7a..1d88525a8 100644 --- a/module-audio/Audio/transcode/InputTranscodeProxy.cpp +++ b/module-audio/Audio/transcode/InputTranscodeProxy.cpp @@ -23,6 +23,11 @@ bool InputTranscodeProxy::push(const Span &span) return getWrappedStream().push(transform->transform(span, transcodingSpaceSpan)); } +bool InputTranscodeProxy::push(void *data, std::size_t dataSize) +{ + return push(Span{.data = reinterpret_cast(data), .dataSize = dataSize}); +} + void InputTranscodeProxy::commit() { if (isReserved) { diff --git a/module-audio/Audio/transcode/InputTranscodeProxy.hpp b/module-audio/Audio/transcode/InputTranscodeProxy.hpp index dfb2d23c4..46903418f 100644 --- a/module-audio/Audio/transcode/InputTranscodeProxy.hpp +++ b/module-audio/Audio/transcode/InputTranscodeProxy.hpp @@ -27,6 +27,7 @@ namespace audio::transcode std::shared_ptr transform) noexcept; bool push(const Span &span) override; + bool push(void *data, std::size_t dataSize); void commit() override; bool reserve(Span &span) override; [[nodiscard]] auto getInputTraits() const noexcept -> Traits override; diff --git a/module-audio/board/rt1051/RT1051DeviceFactory.cpp b/module-audio/board/rt1051/RT1051DeviceFactory.cpp index a3b29a020..b7baa642b 100644 --- a/module-audio/board/rt1051/RT1051DeviceFactory.cpp +++ b/module-audio/board/rt1051/RT1051DeviceFactory.cpp @@ -21,8 +21,12 @@ std::shared_ptr RT1051DeviceFactory::getDevice(const audio::Profile device = std::make_shared(profile.GetAudioConfiguration()); } break; - case AudioDevice::Type::Bluetooth: { - device = std::make_shared(); + case AudioDevice::Type::BluetoothA2DP: { + device = std::make_shared(); + } break; + + case AudioDevice::Type::BluetoothHSP: { + device = std::make_shared(); } break; case AudioDevice::Type::Cellular: { diff --git a/module-bluetooth/Bluetooth/audio/BluetoothAudioDevice.cpp b/module-bluetooth/Bluetooth/audio/BluetoothAudioDevice.cpp index aca60e2e5..e386a28ec 100644 --- a/module-bluetooth/Bluetooth/audio/BluetoothAudioDevice.cpp +++ b/module-bluetooth/Bluetooth/audio/BluetoothAudioDevice.cpp @@ -3,42 +3,46 @@ #include "BluetoothAudioDevice.hpp" -#include