summaryrefslogtreecommitdiffstatshomepage
path: root/src/devices/sound/digitalk.cpp
diff options
context:
space:
mode:
author Olivier Galibert <galibert@pobox.com>2025-04-14 11:31:53 +0200
committer Olivier Galibert <galibert@pobox.com>2025-04-27 22:23:20 +0200
commitd0f1c15a0f6df2dd51a754cb46e6175b7079c8f2 (patch)
treebe35c94340442af08c316a8679089ee68e119fac /src/devices/sound/digitalk.cpp
parentec636faeba5c5841c5a4a35b7c9dc2f06a00f538 (diff)
New sound infrastructure.
Should be added soon: - mute - speaker/microphone resampling To be added a little later: - compression - reverb Needs to be added by someone else: - coreaudio - direct - portaudio - xaudio2 - js
Diffstat (limited to 'src/devices/sound/digitalk.cpp')
-rw-r--r--src/devices/sound/digitalk.cpp18
1 files changed, 7 insertions, 11 deletions
diff --git a/src/devices/sound/digitalk.cpp b/src/devices/sound/digitalk.cpp
index d41c267e798..ebe7fbb14da 100644
--- a/src/devices/sound/digitalk.cpp
+++ b/src/devices/sound/digitalk.cpp
@@ -544,28 +544,27 @@ void digitalker_device::digitalker_step()
// sound_stream_update - handle a stream update
//-------------------------------------------------
-void digitalker_device::sound_stream_update(sound_stream &stream, std::vector<read_stream_view> const &inputs, std::vector<write_stream_view> &outputs)
+void digitalker_device::sound_stream_update(sound_stream &stream)
{
- auto &sout = outputs[0];
int cpos = 0;
- while(cpos != sout.samples()) {
+ while(cpos != stream.samples()) {
if(m_zero_count == 0 && m_dac_index == 128)
digitalker_step();
if(m_zero_count) {
- int n = sout.samples() - cpos;
+ int n = stream.samples() - cpos;
if(n > m_zero_count)
n = m_zero_count;
- sout.fill(0, cpos, n);
+ stream.fill(0, 0, cpos, n);
cpos += n;
m_zero_count -= n;
} else if(m_dac_index != 128) {
- while(cpos != sout.samples() && m_dac_index != 128) {
+ while(cpos != stream.samples() && m_dac_index != 128) {
s32 v = m_dac[m_dac_index];
int pp = m_pitch_pos;
- while(cpos != sout.samples() && pp != m_pitch) {
- sout.put_int(cpos++, v, 32768);
+ while(cpos != stream.samples() && pp != m_pitch) {
+ stream.put_int(0, cpos++, v, 32768);
pp++;
}
if(pp == m_pitch) {
@@ -575,9 +574,6 @@ void digitalker_device::sound_stream_update(sound_stream &stream, std::vector<re
m_pitch_pos = pp;
}
- } else {
- sout.fill(0, cpos);
- break;
}
}
}