-
Notifications
You must be signed in to change notification settings - Fork 303
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
Add MediaRecorder component #244
base: main
Are you sure you want to change the base?
Conversation
Codecov ReportAll modified and coverable lines are covered by tests ✅
Additional details and impacted files@@ Coverage Diff @@
## main #244 +/- ##
==========================================
+ Coverage 95.68% 95.88% +0.19%
==========================================
Files 14 14
Lines 950 996 +46
==========================================
+ Hits 909 955 +46
Misses 41 41 ☔ View full report in Codecov by Sentry. |
After renaming
I can't think of another way to pass the data back without a larger change. 🧠🌪️🌧️ Brainstorm Advanced OptionsA "larger change" would involve an optional setup function where you would register your app with FastUI allowing dynamic endpoint creation or a single endpoint accepting a list of Instead of a setup function, it could be a FastUI helper function where the developer creates an endpoint and calls this helper function, passing the request along with it. If one is added, it would allow extended capabilities as outlined above. I could use some feedback on this if anyone has any insights or has identified issues with how I currently understand the situation. |
Quick updateChanges / Current Functionality
Endpoint Example
@router.post("/media_upload")
async def media_upload(recording: UploadFile):
save_path = Path("some/path")
recording_path = save_path / (recording.filename or "recording.webm")
try:
contents = await recording.read()
recording_path.write_bytes(contents)
except Exception as e:
print(e)
return PlainTextResponse(f"File {recording_path.as_posix()} saved") Once I have time, I'll finish cleaning/refactoring the code and add the changes to this PR. |
Hey everyone! 👋
I'm taking a crack at adding audio recording and playback as discussed in issue #172. Since this is still pretty exploratory, I figured I'd open up this draft PR to get some feedback and collaborate with any interested parties. Hopefully, once we have the Pydantic classes and schema files for this
MediaRecorder
sorted, the audio recording functionality will start to work.I decided to call the component
MediaRecorder
instead ofAudioRecorder
to keep our options open for video recording down the line, since the browser API supports both. There is even a chance video recording functions alongside the audio recording, assuming the audio recording reaches a functional state. But like everything else at this state, we can change it based on how things shape up and the feedback received.I'm also thinking about adding an
AudioPlayer
component that can handle streams and URLs, to add bi-directional audio communication functionality to FastUI.I'd really appreciate any thoughts, ideas, or contributions you have, as these features are tackled. Whether it's code, suggestions, or pointing out potential issues, all kinds of collaboration is welcome. 🤙