mirror of
https://github.com/gtxaspec/wz_mini_hacks.git
synced 2024-11-25 14:57:19 +00:00
fix audio_play.c for panv2
This commit is contained in:
parent
7e9aa36d46
commit
c20b8c1b60
Binary file not shown.
@ -5,6 +5,7 @@
|
||||
#include <unistd.h>
|
||||
|
||||
extern void local_sdk_speaker_set_pa_mode(int mode);
|
||||
extern void local_sdk_speaker_set_ap_mode(int mode);
|
||||
extern void local_sdk_speaker_clean_buf_data();
|
||||
extern void local_sdk_speaker_set_volume(int volume);
|
||||
extern int local_sdk_speaker_feed_pcm_data(unsigned char *buf, int size);
|
||||
@ -43,7 +44,18 @@ int PlayPCM(char *file, int vol) {
|
||||
}
|
||||
local_sdk_speaker_clean_buf_data();
|
||||
local_sdk_speaker_set_volume(vol);
|
||||
|
||||
if(!local_sdk_speaker_set_pa_mode) {
|
||||
local_sdk_speaker_set_ap_mode(3);
|
||||
fprintf(stderr, "[command] aplay: set ap mode 3\n");
|
||||
}
|
||||
|
||||
if(!local_sdk_speaker_set_ap_mode) {
|
||||
local_sdk_speaker_set_pa_mode(3);
|
||||
fprintf(stderr, "[command] aplay: set pa mode 3\n");
|
||||
}
|
||||
|
||||
|
||||
|
||||
while(!feof(fp)) {
|
||||
size = fread(buf, 1, bufLength, fp);
|
||||
@ -54,8 +66,15 @@ int PlayPCM(char *file, int vol) {
|
||||
usleep(2 * 1000 * 1000);
|
||||
local_sdk_speaker_finish_buf_data();
|
||||
local_sdk_speaker_set_volume(0);
|
||||
|
||||
if(!local_sdk_speaker_set_pa_mode) {
|
||||
local_sdk_speaker_set_ap_mode(0);
|
||||
}
|
||||
if(!local_sdk_speaker_set_ap_mode) {
|
||||
local_sdk_speaker_set_pa_mode(0);
|
||||
}
|
||||
|
||||
}
|
||||
fprintf(stderr, "[command] aplay: finish\n");
|
||||
return 0;
|
||||
}
|
||||
|
Binary file not shown.
Loading…
Reference in New Issue
Block a user