diff options
| -rw-r--r-- | Whisper/MF/AudioBuffer.h | 6 | ||||
| -rw-r--r-- | Whisper/Whisper/ContextImpl.capture.cpp | 3 |
2 files changed, 7 insertions, 2 deletions
diff --git a/Whisper/MF/AudioBuffer.h b/Whisper/MF/AudioBuffer.h index 87319dd..93a6ace 100644 --- a/Whisper/MF/AudioBuffer.h +++ b/Whisper/MF/AudioBuffer.h @@ -30,6 +30,12 @@ namespace Whisper stereo.clear(); } + void swap( AudioBuffer& that ) + { + mono.swap( that.mono ); + stereo.swap( that.stereo ); + } + void resize( size_t len ) { assert( len <= mono.size() ); diff --git a/Whisper/Whisper/ContextImpl.capture.cpp b/Whisper/Whisper/ContextImpl.capture.cpp index c0d3d28..617c1f3 100644 --- a/Whisper/Whisper/ContextImpl.capture.cpp +++ b/Whisper/Whisper/ContextImpl.capture.cpp @@ -138,8 +138,7 @@ namespace workStatus = S_FALSE; buffer.currentOffset = pcmStartTime; - buffer.pcm.mono = pcm.mono; - buffer.pcm.stereo = pcm.stereo; + pcm.swap( buffer.pcm ); SubmitThreadpoolWork( work ); pcmStartTime = nextSampleTime; pcm.clear(); |
