|
|
|
@ -34,16 +34,16 @@ size_t System::GetSessionId() const {
|
|
|
|
|
return session_id;
|
|
|
|
|
}
|
|
|
|
|
|
|
|
|
|
std::string_view System::GetDefaultDeviceName() {
|
|
|
|
|
std::string_view System::GetDefaultDeviceName() const {
|
|
|
|
|
return "BuiltInHeadset";
|
|
|
|
|
}
|
|
|
|
|
|
|
|
|
|
std::string_view System::GetDefaultUacDeviceName() {
|
|
|
|
|
std::string_view System::GetDefaultUacDeviceName() const {
|
|
|
|
|
return "Uac";
|
|
|
|
|
}
|
|
|
|
|
|
|
|
|
|
Result System::IsConfigValid(const std::string_view device_name,
|
|
|
|
|
const AudioInParameter& in_params) {
|
|
|
|
|
const AudioInParameter& in_params) const {
|
|
|
|
|
if ((device_name.size() > 0) &&
|
|
|
|
|
(device_name != GetDefaultDeviceName() && device_name != GetDefaultUacDeviceName())) {
|
|
|
|
|
return Service::Audio::ERR_INVALID_DEVICE_NAME;
|
|
|
|
@ -114,12 +114,14 @@ bool System::AppendBuffer(const AudioInBuffer& buffer, const u64 tag) {
|
|
|
|
|
}
|
|
|
|
|
|
|
|
|
|
const auto timestamp{buffers.GetNextTimestamp()};
|
|
|
|
|
AudioBuffer new_buffer{.start_timestamp = timestamp,
|
|
|
|
|
.end_timestamp = timestamp + buffer.size / (channel_count * sizeof(s16)),
|
|
|
|
|
.played_timestamp = 0,
|
|
|
|
|
.samples = buffer.samples,
|
|
|
|
|
.tag = tag,
|
|
|
|
|
.size = buffer.size};
|
|
|
|
|
const AudioBuffer new_buffer{
|
|
|
|
|
.start_timestamp = timestamp,
|
|
|
|
|
.end_timestamp = timestamp + buffer.size / (channel_count * sizeof(s16)),
|
|
|
|
|
.played_timestamp = 0,
|
|
|
|
|
.samples = buffer.samples,
|
|
|
|
|
.tag = tag,
|
|
|
|
|
.size = buffer.size,
|
|
|
|
|
};
|
|
|
|
|
|
|
|
|
|
buffers.AppendBuffer(new_buffer);
|
|
|
|
|
RegisterBuffers();
|
|
|
|
@ -200,11 +202,11 @@ void System::SetVolume(const f32 volume_) {
|
|
|
|
|
session->SetVolume(volume_);
|
|
|
|
|
}
|
|
|
|
|
|
|
|
|
|
bool System::ContainsAudioBuffer(const u64 tag) {
|
|
|
|
|
bool System::ContainsAudioBuffer(const u64 tag) const {
|
|
|
|
|
return buffers.ContainsBuffer(tag);
|
|
|
|
|
}
|
|
|
|
|
|
|
|
|
|
u32 System::GetBufferCount() {
|
|
|
|
|
u32 System::GetBufferCount() const {
|
|
|
|
|
return buffers.GetAppendedRegisteredCount();
|
|
|
|
|
}
|
|
|
|
|
|
|
|
|
|