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

New PCM Audio player use a AudioWorkletProcessor to offload work #46

Merged
merged 18 commits into from
Sep 30, 2023

Conversation

dvrtech-us
Copy link
Contributor

No description provided.

false seems to be sent as a string occasionally so lets handle it both ways
in this case if("false") is evaluating to true
Since we always use Float32, we have no need to do conversions. This yields improvements because the conversion function was rebuilding the buffer even though it was formatted correctly.
Moved Audio related JS to separate file
Implemented AudioWorkletProcessor to move message handling structure conversion and buffer out of main thread
Now the audio socket is initialized only after pcmPlayerNode is created
Also a bug fix to properly cast gain as a float.
Seems like a latency improvement
@dvrtech-us
Copy link
Contributor Author

  • Optimized when the web socket loads so the player is ready when it starts receiving data.
  • Removed checks on the WebSocket data coming in to reduce logic in the primary thread now that the socket doesn't open until the player is ready.

@mikegapinski mikegapinski merged commit 051af4a into tesla-android:main Sep 30, 2023
1 check passed
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

2 participants