Skip to content

Commit f649f7a

Browse files
committed
aesnd: add AESND_SetVoiceDelay
Used to delay start of streaming voices
1 parent eac8fe2 commit f649f7a

2 files changed

Lines changed: 11 additions & 0 deletions

File tree

gc/aesndlib.h

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -54,6 +54,7 @@ void AESND_SetVoiceFormat(AESNDPB *pb,u32 format);
5454
void AESND_SetVoiceStream(AESNDPB *pb,bool stream);
5555
void AESND_SetVoiceFrequency(AESNDPB *pb,f32 freq);
5656
void AESND_SetVoiceVolume(AESNDPB *pb,u16 volume_l,u16 volume_r);
57+
void AESND_SetVoiceDelay(AESNDPB *pb,u32 delay);
5758
void AESND_SetVoiceBuffer(AESNDPB *pb,const void *buffer,u32 len);
5859
void AESND_PlayVoice(AESNDPB *pb,u32 format,const void *buffer,u32 len,f32 freq,u32 delay,bool looped);
5960
AESNDVoiceCallback AESND_RegisterVoiceCallback(AESNDPB *pb,AESNDVoiceCallback cb);

libaesnd/aesndlib.c

Lines changed: 10 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -694,3 +694,13 @@ AESNDVoiceCallback AESND_RegisterVoiceCallback(AESNDPB *pb,AESNDVoiceCallback cb
694694

695695
return rcb;
696696
}
697+
698+
void AESND_SetVoiceDelay(AESNDPB *pb,u32 delay)
699+
{
700+
u32 level;
701+
702+
_CPU_ISR_Disable(level);
703+
pb->delay = (delay*48);
704+
_CPU_ISR_Restore(level);
705+
}
706+

0 commit comments

Comments
 (0)