1 #include "rockmacros.h"
5 struct pcm pcm IBSS_ATTR
;
10 #if CONFIG_CODEC == SWCODEC
15 static unsigned short *buf
=0, *hwbuf
=0;
17 static bool newly_started
;
19 static void get_more(unsigned char** start
, size_t* size
)
21 memcpy(hwbuf
, &buf
[pcm
.len
*doneplay
], BUF_SIZE
*sizeof(short));
22 *start
= (unsigned char*)(hwbuf
);
23 *size
= BUF_SIZE
*sizeof(short);
34 #if defined(HW_HAVE_11) && !defined(TOSHIBA_GIGABEAT_F)
45 buf
= my_malloc(pcm
.len
* N_BUFS
*sizeof(short));
46 hwbuf
= my_malloc(pcm
.len
*sizeof(short));
50 memset(buf
, 0, pcm
.len
* N_BUFS
*sizeof(short));
55 #if INPUT_SRC_CAPS != 0
57 rb
->audio_set_input_source(AUDIO_SRC_PLAYBACK
, SRCF_PLAYBACK
);
58 rb
->audio_set_output_source(AUDIO_SRC_PLAYBACK
);
61 rb
->pcm_set_frequency(pcm
.hz
); /* 44100 22050 11025 */
66 memset(&pcm
, 0, sizeof pcm
);
69 rb
->pcm_set_frequency(HW_SAMPR_DEFAULT
);
74 if (!pcm
.buf
) return 0;
75 if (pcm
.pos
< pcm
.len
) return 1;
79 rb
->pcm_play_data(&get_more
,NULL
,0);
80 newly_started
= false;
105 memset(&pcm
, 0, sizeof pcm
);