Skip to content

Commit

Permalink
add AudioBackend_SetVolumeSeparate to the harness audio interface (#433)
Browse files Browse the repository at this point in the history
  • Loading branch information
BSzili authored Jan 30, 2025
1 parent 3c01b63 commit 1ef129a
Show file tree
Hide file tree
Showing 3 changed files with 10 additions and 0 deletions.
5 changes: 5 additions & 0 deletions src/S3/s3sound.c
Original file line number Diff line number Diff line change
Expand Up @@ -362,6 +362,11 @@ int S3SyncSampleVolumeAndPan(tS3_channel* chan) {
if (chan->type != eS3_ST_sample) {
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;
if (total_vol == 0.0f) {
total_vol = 1.0f;
Expand Down
4 changes: 4 additions & 0 deletions src/harness/audio/miniaudio.c
Original file line number Diff line number Diff line change
Expand Up @@ -233,6 +233,10 @@ tAudioBackend_error_code AudioBackend_SetFrequency(void* type_struct_sample, int
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) {
tMiniaudio_sample* miniaudio;

Expand Down
1 change: 1 addition & 0 deletions src/harness/include/harness/audio.h
Original file line number Diff line number Diff line change
Expand Up @@ -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_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_SetVolumeSeparate(void* type_struct_sample, int left_volume, int right_volume);

tAudioBackend_error_code AudioBackend_PlayCDA(int track);
tAudioBackend_error_code AudioBackend_StopCDA(void);
Expand Down

0 comments on commit 1ef129a

Please sign in to comment.