|
| 1 | +--- |
| 2 | +title: "SSoC ’25 Week 09 Update by Muhammad Haroon" |
| 3 | +excerpt: "Create a FastAPI for connecting frontend with backend for AI Sample Generation." |
| 4 | +category: "DEVELOPER NEWS" |
| 5 | +date: "2025-08-03" |
| 6 | +slug: "2025-08-03-ssoc-25-MuhammadHaroon-week09" |
| 7 | +author: "@/constants/MarkdownFiles/authors/muhammad-haroon.md" |
| 8 | +tags: "ssoc25,sugarlabs,week09,GenAI,MusicBlocks,Music" |
| 9 | +image: "assets/Images/GSOC.webp" |
| 10 | +--- |
| 11 | + |
| 12 | +<!-- markdownlint-disable --> |
| 13 | + |
| 14 | +# Week 09 Progress Report by Muhammad Haroon |
| 15 | + |
| 16 | +**Project:** [Generative AI Instrument Sample Generation for Music Blocks](https://github.com/sugarlabs/GSoC/blob/master/Ideas-2025.md#Generative-AI-Instrument-Sample-Generation-for-Music-Blocks) |
| 17 | +**Mentors:** [Walter Bender](https://github.com/walterbender), [Sumit Srivastava](https://github.com/sum2it) |
| 18 | +**Assisting Mentors:** [Devin Ulibarri](https://github.com/pikurasa) |
| 19 | +**Reporting Period:** 2025-07-28 - 2025-08-03 |
| 20 | + |
| 21 | +--- |
| 22 | + |
| 23 | +## Goals for This Week |
| 24 | + |
| 25 | +- **Goal 1:** Create a FastAPI for connecting frontend with backend for AI Sample Generation. |
| 26 | + |
| 27 | +--- |
| 28 | + |
| 29 | +## This Week's Achievements |
| 30 | + |
| 31 | +1. **Create a FastAPI for connecting frontend with backend for AI Sample Generation.** |
| 32 | + - I successfully created a FastAPI for connecting the frontend with the backend for AI Sample Generation. |
| 33 | + |
| 34 | + - Users can now enter a prompt in the Music Blocks Sampler widget. Initially, only the Submit button will be enabled. The prompt will be sent to the backend server, and audio generation will begin. While the audio is being generated, a text message will repeatedly appear on the screen at regular intervals to inform the users. Once the audio is ready, another message will be displayed to let them know that the audio has been generated. After this, the Preview and Save buttons will become enabled, allowing users to listen to the generated audio and, if satisfied, save it. |
| 35 | + |
| 36 | + - Below is the video demonstrating the AI Sample Generation in Music Blocks. |
| 37 | + |
| 38 | + [youtube: 7e6454_j74g] |
| 39 | + |
| 40 | +--- |
| 41 | + |
| 42 | +## Challenges & How I Overcame Them |
| 43 | + |
| 44 | +- **Challenge:** I had no experience with FastAPI before. |
| 45 | +- **Solution:** Learned it along the way, followed the docs of FastAPI and some Youtube tutorials for it. |
| 46 | + |
| 47 | +--- |
| 48 | + |
| 49 | +## Key Learnings |
| 50 | + |
| 51 | +- Learned about CORSMiddleware in FastAPI, which allows your frontend (running on a different port) to communicate with your backend by relaxing the browser’s cross-origin restrictions. Without it, browsers block such requests for security reasons. |
| 52 | + |
| 53 | +- Discovered that FastAPI can also send file and JSON responses to the browser. |
| 54 | + |
| 55 | +--- |
| 56 | + |
| 57 | +## Next Week's Roadmap |
| 58 | + |
| 59 | +- Create a FastAPI for connecting frontend with backend for Audio Trimmer. |
| 60 | + |
| 61 | +--- |
| 62 | + |
| 63 | +## Resources & References |
| 64 | +- **Frontend Code** https://github.com/sugarlabs/musicblocks/pull/4740 |
| 65 | +- **Backend Code** https://github.com/haroon10725/AI-Sample-Generation-Backend |
| 66 | + |
| 67 | +--- |
| 68 | + |
| 69 | +## Acknowledgments |
| 70 | + |
| 71 | +Thank you to my mentors, the Sugar Labs community, and fellow GSoC contributors for ongoing support. |
| 72 | + |
| 73 | +--- |
0 commit comments