forked from len0rd/rockbox
Correct metronome sound on PCM playback targets
git-svn-id: svn://svn.rockbox.org/rockbox/trunk@8325 a1c6a512-1295-4272-9138-f99709370657
This commit is contained in:
parent
cf218e33ec
commit
befd0ac3a6
1 changed files with 15 additions and 2 deletions
|
@ -711,11 +711,23 @@ static signed short sound[] = {
|
||||||
|
|
||||||
int tock;
|
int tock;
|
||||||
|
|
||||||
|
short sndbuf[sizeof(sound)*2];
|
||||||
|
|
||||||
|
/* Convert the mono "tock" sample to interleaved stereo */
|
||||||
|
void prepare_tock(void)
|
||||||
|
{
|
||||||
|
int i;
|
||||||
|
for(i = 0;i < (int)sizeof(sound)/2;i++) {
|
||||||
|
sndbuf[i*2] = sound[i];
|
||||||
|
sndbuf[i*2+1] = sound[i];
|
||||||
|
}
|
||||||
|
}
|
||||||
|
|
||||||
void callback_pcm(unsigned char** start, long* size)
|
void callback_pcm(unsigned char** start, long* size)
|
||||||
{
|
{
|
||||||
if(sound_active) {
|
if(sound_active) {
|
||||||
*start = (unsigned char *)sound;
|
*start = (unsigned char *)sndbuf;
|
||||||
*size = sizeof(sound);
|
*size = sizeof(sndbuf);
|
||||||
sound_active = false;
|
sound_active = false;
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
@ -876,6 +888,7 @@ enum plugin_status plugin_start(struct plugin_api* api, void* parameter){
|
||||||
#if CONFIG_CODEC != SWCODEC
|
#if CONFIG_CODEC != SWCODEC
|
||||||
rb->bitswap(sound, sizeof(sound));
|
rb->bitswap(sound, sizeof(sound));
|
||||||
#else
|
#else
|
||||||
|
prepare_tock();
|
||||||
rb->pcm_set_frequency(44100);
|
rb->pcm_set_frequency(44100);
|
||||||
#endif
|
#endif
|
||||||
|
|
||||||
|
|
Loading…
Add table
Add a link
Reference in a new issue