Skip to content

Commit

Permalink
rattlegram: do not force echo cancelation and noise suppression
Browse files Browse the repository at this point in the history
  • Loading branch information
bastibl committed Jul 4, 2024
1 parent 88182f1 commit 19bfed5
Show file tree
Hide file tree
Showing 2 changed files with 5 additions and 5 deletions.
2 changes: 1 addition & 1 deletion examples/rattlegram/assets/setup-decoder.js
Original file line number Diff line number Diff line change
Expand Up @@ -9,7 +9,7 @@ async function getWebAudioMediaStream() {

try {
const result = await window.navigator.mediaDevices.getUserMedia({
audio: { echoCancellation: { exact: false }, noiseSuppression: { exact: false }, sampleRate: { exact: 48000 } },
audio: { echoCancellation: { ideal: false }, noiseSuppression: { ideal: false }, sampleRate: { exact: 48000 } },
video: false,
});

Expand Down
8 changes: 4 additions & 4 deletions examples/rattlegram/src/decoder.rs
Original file line number Diff line number Diff line change
Expand Up @@ -53,7 +53,7 @@ impl Kernel for DecoderBlock {
) -> Result<()> {
let input = sio.input(0).slice::<f32>();

for s in input.chunks_exact(512) {
for s in input.chunks_exact(960) {
if !self.decoder.feed(s) {
continue;
}
Expand Down Expand Up @@ -104,7 +104,7 @@ impl Kernel for DecoderBlock {
}
}

sio.input(0).consume(input.len() / (512) * (512));
sio.input(0).consume(input.len() / (960) * (960));

if sio.input(0).finished() {
io.finished = true;
Expand Down Expand Up @@ -314,7 +314,7 @@ impl SchmidlCox {
return Complex32::new(0.0, 0.0);
}
let cons = curr / prev;
if !(cons.norm_sqr() <= 4.0) {
if !(cons.norm_sqr() <= 10.0) {
return Complex32::new(0.0, 0.0);
}
cons
Expand Down Expand Up @@ -974,7 +974,7 @@ impl Decoder {
return Complex32::new(0.0, 0.0);
}
let cons = curr / prev;
if cons.norm_sqr() > 4.0 {
if cons.norm_sqr() > 10.0 {
return Complex32::new(0.0, 0.0);
}
cons
Expand Down

0 comments on commit 19bfed5

Please sign in to comment.