Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Web Demo issue #5

Open
chulochula opened this issue Jan 6, 2021 · 4 comments
Open

Web Demo issue #5

chulochula opened this issue Jan 6, 2021 · 4 comments
Labels
bug Something isn't working wasm WebAssembly port

Comments

@chulochula
Copy link

Very great library!

Firstly, for the Web Demo, inside onchange event of "Tx Protocol" combobox , please assign the integer value to protocolId instead of a string value. Otherwise, the "broadcast" cannot work properly when calling _sendData.

Secondly, on MacOS & iOS Safari, the Web Demo can _getText from hearable sound but not from Ultrasound. They both work on Mac Chrome though. Any idea please? Because I want to embed this into a iPhone Cordova app. Many thanks!

@ggerganov
Copy link
Owner

Thanks for spotting the protocolId issue - it is fixed now!

Regarding the ultrasound issue:
That is interesting observation and I am not sure what is causing the ultrasound to not work with Safari. One potential idea could be that the following part for adjusting the capture parameters does not work for Safari:

let constraints = {
audio: {
echoCancellation: false,
autoGainControl: false,
noiseSuppression: false
}
};
let mediaInput = navigator.mediaDevices.getUserMedia( constraints );

Although it seems unlikely. I will do some experiments on my MacBook and see if I can find more information.

@ggerganov ggerganov added the bug Something isn't working label Jan 6, 2021
@chulochula
Copy link
Author

Cool!

One more question about the Web Demo. I have played around it as well as the iPhone demo (from App Store). The transmission distance and accuracy are very high on iPhone while not the same performance on Web Demo. It is the same when I send data from App/Web on iPhone and receive it on Mac Chrome. App has much better transmission distance.

Anything can I fine tune the source of the Web Demo please?

@ggerganov
Copy link
Owner

ggerganov commented Jan 7, 2021

I can reproduce the same issue with Safari on my MacBook. For some reason the high-frequency audio in Safari is filtered. Here is Safari (left) and Chrome (right) receiving an Ultrasound message simultaneously:

safari-issue

The higher portion of the audio spectrum in Safari is completely missing.
Probably the Safari is capturing at a much lower sample rate, even though SDL reports 48kHz. Not sure..

Regarding the performance issue:
Probably the audio capture parameters of the browser need to be tuned in some way. There might be some filtering going on in the background that I am not aware of.

@ggerganov
Copy link
Owner

It has been suggested that this might be a security risk mitigation by Safari. Not sure if that is the case.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
bug Something isn't working wasm WebAssembly port
Projects
None yet
Development

No branches or pull requests

2 participants