add AudioBackend_SetVolumeSeparate to the harness audio interface (#433)

This commit is contained in:
Szilárd Biró 2025-01-30 18:56:54 +01:00 committed by GitHub
parent 3c01b63346
commit 1ef129a7bf
No known key found for this signature in database
GPG Key ID: B5690EEEBB952194
3 changed files with 10 additions and 0 deletions

View File

@ -362,6 +362,11 @@ int S3SyncSampleVolumeAndPan(tS3_channel* chan) {
if (chan->type != eS3_ST_sample) { if (chan->type != eS3_ST_sample) {
return 1; return 1;
} }
if (AudioBackend_SetVolumeSeparate(chan->type_struct_sample, chan->left_volume, chan->right_volume) == eAB_success) {
return 1;
}
total_vol = chan->left_volume + chan->right_volume; total_vol = chan->left_volume + chan->right_volume;
if (total_vol == 0.0f) { if (total_vol == 0.0f) {
total_vol = 1.0f; total_vol = 1.0f;

View File

@ -233,6 +233,10 @@ tAudioBackend_error_code AudioBackend_SetFrequency(void* type_struct_sample, int
return eAB_success; return eAB_success;
} }
tAudioBackend_error_code AudioBackend_SetVolumeSeparate(void* type_struct_sample, int left_volume, int right_volume) {
return eAB_error;
}
tAudioBackend_error_code AudioBackend_StopSample(void* type_struct_sample) { tAudioBackend_error_code AudioBackend_StopSample(void* type_struct_sample) {
tMiniaudio_sample* miniaudio; tMiniaudio_sample* miniaudio;

View File

@ -21,6 +21,7 @@ tAudioBackend_error_code AudioBackend_StopSample(void* type_struct_sample);
tAudioBackend_error_code AudioBackend_SetVolume(void* type_struct_sample, int volume); tAudioBackend_error_code AudioBackend_SetVolume(void* type_struct_sample, int volume);
tAudioBackend_error_code AudioBackend_SetPan(void* type_struct_sample, int pan); tAudioBackend_error_code AudioBackend_SetPan(void* type_struct_sample, int pan);
tAudioBackend_error_code AudioBackend_SetFrequency(void* type_struct_sample, int original_rate, int new_rate); tAudioBackend_error_code AudioBackend_SetFrequency(void* type_struct_sample, int original_rate, int new_rate);
tAudioBackend_error_code AudioBackend_SetVolumeSeparate(void* type_struct_sample, int left_volume, int right_volume);
tAudioBackend_error_code AudioBackend_PlayCDA(int track); tAudioBackend_error_code AudioBackend_PlayCDA(int track);
tAudioBackend_error_code AudioBackend_StopCDA(void); tAudioBackend_error_code AudioBackend_StopCDA(void);