awslabs / aws-lex-browser-audio-capture

An example web application using the Lex JavaScript SDK to send and receive audio from the Lex PostContent API. Demonstrates how to capture an audio device, record audio, and convert the audio into a format that Lex will recognize, and play the response. All from a web browser.
MIT No Attribution
165 stars 75 forks source link

correct sample rate in wave export #23

Open vogler75 opened 4 years ago

vogler75 commented 4 years ago

if the recording is downsampled the new sample rate must also be passed to encodeWAV so that the wave header includes the new/correct sample rate.

*Issue #22

Description of changes: Extended the encodeWAV function with a argument "sampleRate", this sample rate is now written to the wave header (not using the global variable recordSampleRate anymore). And in the exportBuffer function I pass now the new samplerate to the encodeWAV function.

By submitting this pull request, I confirm that you can use, modify, copy, and redistribute this contribution, under the terms of your choice.

expatiating commented 4 years ago

@vogler75 👍

meronz commented 3 years ago

Please merge this one, i also have tested this and wasted time (re) fixing it.

arteagac commented 2 years ago

This is an important fix that should be merged.