diff options
author | 2020-09-20 19:40:21 -0700 | |
---|---|---|
committer | 2020-09-20 19:40:21 -0700 | |
commit | 4849a5aebaf94b0ee95293308309bf43a5ff8da6 (patch) | |
tree | 4700e4cb5e458f84c923708d045b5f8d547c2625 /src/devices/sound/es5503.cpp | |
parent | 6eaa5f09467165e144da9369dc51aa6cfc500cd0 (diff) |
sound: Add a few new helpers to write_stream_view
* put_clamp - clamps the input value before writing
* put_int - takes an integer and coverts it to float
* put_int_clamp - converts and clamps an integer
* add_int - converts an int and adds to the current sample
Diffstat (limited to 'src/devices/sound/es5503.cpp')
-rw-r--r-- | src/devices/sound/es5503.cpp | 3 |
1 files changed, 1 insertions, 2 deletions
diff --git a/src/devices/sound/es5503.cpp b/src/devices/sound/es5503.cpp index 4ffc0d263a3..0d727fc77bf 100644 --- a/src/devices/sound/es5503.cpp +++ b/src/devices/sound/es5503.cpp @@ -199,9 +199,8 @@ void es5503_device::sound_stream_update(sound_stream &stream, std::vector<read_s } mixp = &m_mix_buffer[0]; - constexpr stream_buffer::sample_t sample_scale = 1.0 / (32768.0 * 8.0); for (i = 0; i < outputs[chan].samples(); i++) - outputs[chan].put(i, stream_buffer::sample_t(*mixp++) * sample_scale); + outputs[chan].put_int(i, *mixp++, 32768 * 8); } } |