Call do_sample from audioapi_submit_buffer
This commit is contained in:
parent
32b98a880c
commit
75e5d53912
5 changed files with 8 additions and 4 deletions
|
@ -226,6 +226,12 @@ void audioapi_record_voice(float* samples, size_t count)
|
|||
|
||||
void audioapi_submit_buffer(int16_t* samples, size_t count, bool stereo, double rate)
|
||||
{
|
||||
if(stereo)
|
||||
for(unsigned i = 0; i < count; i++)
|
||||
information_dispatch::do_sample(samples[2 * i + 0], samples[2 * i + 1]);
|
||||
else
|
||||
for(unsigned i = 0; i < count; i++)
|
||||
information_dispatch::do_sample(samples[i], samples[i]);
|
||||
//Limit buffers to avoid overrunning.
|
||||
if(count > music_bufsize / (stereo ? 2 : 1))
|
||||
count = music_bufsize / (stereo ? 2 : 1);
|
||||
|
|
|
@ -353,7 +353,6 @@ namespace
|
|||
uint16_t _r = r_sample;
|
||||
soundbuf[soundbuf_fill++] = l_sample;
|
||||
soundbuf[soundbuf_fill++] = r_sample;
|
||||
information_dispatch::do_sample(l_sample, r_sample);
|
||||
//The SMP emits a sample every 768 ticks of its clock. Use this in order to keep track of
|
||||
//time.
|
||||
ecore_callbacks->timer_tick(768, SNES::system.apu_frequency());
|
||||
|
|
|
@ -352,7 +352,6 @@ namespace
|
|||
int16_t r2 = (accumulator_r >> 6) - 32768;
|
||||
soundbuf[emitted++] = l2;
|
||||
soundbuf[emitted++] = r2;
|
||||
information_dispatch::do_sample(l2, r2);
|
||||
accumulator_l = accumulator_r = 0;
|
||||
accumulator_s = 0;
|
||||
}
|
||||
|
|
|
@ -341,8 +341,6 @@ namespace sky
|
|||
int16_t sbuf[2668];
|
||||
fetch_sfx(_gstate, sbuf, samples);
|
||||
audioapi_submit_buffer(sbuf, samples, true, 48000);
|
||||
for(unsigned i = 0; i < samples; i++)
|
||||
information_dispatch::do_sample(sbuf[2 * i + 0], sbuf[2 * i + 1]);
|
||||
}
|
||||
void c_runtosave() {}
|
||||
bool c_get_pflag() { return pflag; }
|
||||
|
|
|
@ -146,6 +146,7 @@ namespace
|
|||
void c_install_handler() { hide(); }
|
||||
void c_uninstall_handler() {}
|
||||
void c_emulate() {
|
||||
int16_t audio[800] = {0};
|
||||
pflag = false;
|
||||
redraw_screen();
|
||||
framebuffer_info inf;
|
||||
|
@ -161,6 +162,7 @@ namespace
|
|||
inf.offset_y = 0;
|
||||
framebuffer_raw ls(inf);
|
||||
ecore_callbacks->output_frame(ls, 60,1);
|
||||
audioapi_submit_buffer(audio, 800, false, 48000);
|
||||
}
|
||||
void c_runtosave() {}
|
||||
bool c_get_pflag() { return pflag; }
|
||||
|
|
Loading…
Add table
Reference in a new issue