Objectives / To-Do

  • Implement Unit tests
  • Consider GUI creation or Web app
  • Draw Webapp wireframe
  • Lookup things to turn wireframe to proper website layout
  • Include AI to read the file names?
  • Turn into webapp?
    • Create RESTful API using Django or Flaks for Python backend
    • Create a JS stack for the website, to handle the front end and middle?
    • Single page website that does the File IO and sends the data to the backend
    • PicoCSS for styling
    • prompt user to choose folder by “browse” or drag and drop
    • Host Python backend on cloud server
    • Send and receive info to the API via HTTPS request
      • Test backend API using Postman
    • Add disclaimer that it’s a POS
    • add tips and popups?
  • Populate/update GUI accordingly
    • Implement DOM updating functions
    • Add visual cues to show in progress and that it might take a while
    • ~~Preview of the audio files or metadata, this can be done on the client side to reduce load on your server and speed up user interaction.
  • Deploy on Docker?
  • Driver class: Consider how the system reacts if Spotify credentials are invalid.
  • Set up a system to wipe the backend’s cache to prevent sensitive info leaks
  • Update the replace() in clean_metadata()
  • ~~Search for ways to hide code on frontend
  • Write documentation for both Python and the web app
  • Clean up and remove all console logs and dumb comments
  • Add copyright and legal disclaimers (See email for more details)
  • Give credits to banner art artist
  • Add some form of contact info?
  • Change to persistent secret key
  • ~~Implementing token revocation~
  • Consider containerizing the backend using Docker.
  • Cookie Disclaimer (legally required).
  • Host flask backend reliably: Seenode, DigitalOcean, Vercel, Render, Heroku
  • Add SEO tools and things like robots.txt and metadata in the HTML headers.
  • Consider docker for the Redis cache (and perhaps another for the Flask app).
  • Document how to run stuff locally, need to boot docker container for the cache, then boot up the Flask server, then the Node app.
  • Update the UI to not suck
  • Style contact modal better? //Actually Restyle the WHOLE thing
  • Redemo the app to Spotify when done

Future considerations

  • Look into adding ads to cover operating costs
  • Cache processed results from GPT and then check if any new requests match the cached information. To minimize network requests and speed up load times, you can cache data on the client side. This might include storing user preferences, recently viewed items, or temporarily storing the results of API calls that don’t update frequently.
  • Pretty fonts?
  • Make a similar tool, that edits the file’s metadata. Solving the issue in the first place!

Contacting Soundizz


About

AudioReaper Backend

  • A 100% Python backend built using Flask as the web framework.
  • Processes song metadata and normalizes it into a specific form, while also utilizing Natural Language Processing to fill in the gaps when data is missing or corrupted.
  • Utilizes the Python specific Spotipy library to accomplish:
    • Authenticate user’s Spotify credentials and log them in.
    • Retrieve the playlist with the name specified by the user or create one with that name if not found.
    • Check if identified tracks are listed on that playlist and returns list of Track IDs for songs not on the playlist.
    • Add the songs to the playlist.

While the backend is ready and hosted, AudioReaper’s frontend is still in development.


AudioReaper Front-end

The Client side part of the web app, this was developed to publish AudioReaper and allow others to use it in a clean and simple way directly in their browsers. Features:

  • Simple and lightweight way UI that’s intuitive but also good looking without being bloated and extra.
  • Written in JavaScript, and built using Node.js and Express.
  • Allows user’
  • s log-in and authorize AudioReaper to access their Spotify account to add songs, and when they’re they can log out and all session data is removed.*
  • Allows users to “drag ‘n drop” or upload the folder containing their music files to add to the desired playlist.
  • Simple form for the destination playlist’s name.
  • Once folder is uploaded and name sent, hit ‘harvest’ and the backend will do the rest.
  • Super easy and intuitive to use, but guidelines provided.

I hope you find AudioReaper as useful as my friends and I have and if you encounter any issues or have suggestions, please feel free to contact me.


Idea

  • To make a script that reads all mp3 files in a folder
  • Searches through BOTH the file names and their meta data (if available) them converts these extracted names into a CSV file
  • Runs then asks for a name inputted by the user to serve as Playlist name
  • Then via the Spotify API searches for these songs and adds them to that playlist, if it doesn’t exist it creates it in the user’s Spotify account.

Roadmap

  • Research and Learn: Before starting the project, research and learn about the Spotify API, how to read mp3 files, and how to extract metadata from them. This will help you understand the requirements and limitations of the project.
  • Set up the Development Environment: Set up the development environment by installing the necessary libraries and tools. For example, you may need to install the Spotipy library to interact with the Spotify API.
  • Read MP3 Files: Write a script that reads all mp3 files in a folder. You can use the os library to list all files in a directory and filter out the mp3 files.
  • Extract Metadata: Extract metadata from the mp3 files using a library like mutagen. This will allow you to get information like the song title, artist, and album.
  • Convert to CSV: Convert the extracted metadata into a CSV file. You can use the csv library to write the metadata to a CSV file.
  • Get Playlist Name: Ask the user to input a name for the playlist.
  • Search for Songs: Use the Spotify API to search for the songs in the CSV file. You can use the Spotipy library to interact with the Spotify API.
  • Create Playlist: If the playlist does not exist, create it using the Spotify API. You can use the Spotipy library to create a new playlist.
  • Add Songs to Playlist: Add the songs to the playlist using the Spotify API. You can use the Spotipy library to add the songs to the playlist.
  • Test and Debug: Test the script thoroughly and debug any errors that arise. Make sure the script is working as expected and handling edge cases.
  • Documentation: Document the code and provide instructions on how to use the script. This will make it easier for others to understand and use the script.

Development

  • ~~Set up the development environment: Install the necessary libraries and tools required for the project.~

  • install the Spotipy library to interact with the Spotify API.

  • ~~Read MP3 files: Write a script that reads all mp3 files in a folder. You can use the os library to list all files in a directory and filter out the mp3 files.

  • ~~Extract Metadata: Extract metadata from the mp3 files using a library like mutagen. This will allow you to get information like the song title, artist, and album.

  • ~~Convert to CSV: Convert the extracted metadata into a CSV file. You can use the csv library to write the metadata to a CSV file.

  • ~~Get Playlist Name: Ask the user to input a name for the playlist.

  • ~~Search for Songs: Use the Spotify API to search for the songs in the CSV file. You can use the Spotipy library to interact with the Spotify API.

  • **Create Playlist**: If the playlist does not exist, create it using the Spotify API. You can use the Spotipy library to create a new playlist.

  • ~~Add Songs to Playlist: Add the songs to the playlist using the Spotify API. You can use the Spotipy library to add the songs to the playlist.

  • ~~Test and Debug: Test the script thoroughly and debug any errors that arise. Make sure the script is working as expected and handling edge cases.

  • Document the Code: Document the code and provide instructions on how to use the script. This will make it easier for others to understand and use the script.

Dealing with metadata inconsistencies

A few strategies to consider handling songs with faulty metadata:

  1. Improve Metadata Extraction:
    • Use more advanced metadata extraction techniques that can handle various tagging formats and inconsistencies.
    • Consider using a music tagging library that can help standardize the metadata from your files.
  2. Manual Review:
    • Create a list of tracks that cannot be found automatically and conduct a manual review to correct the metadata.
    • Use music recognition software like Shazam or ACRCloud to identify songs and obtain correct metadata.
  3. Machine Learning:
    • Implement machine learning models that can predict the correct metadata based on partial or noisy data.
    • Use acoustic fingerprinting to identify songs and retrieve metadata from a database.
  4. User Input:
    • For tracks that cannot be matched, prompt the user to input the correct metadata.
    • Build an interface that suggests the closest matches for user confirmation.
  5. Database of Common Corrections:
    • Maintain a database of common metadata errors and their corrections that the script can refer to when encountering known issues.
  6. Integration with Music APIs:
    • Integrate with music databases like MusicBrainz, Discogs, or the Spotify Search API to find potential matches for tracks with incomplete metadata.
  7. Fuzzy Matching:
    • Implement fuzzy matching algorithms that can find close matches even with some inaccuracies in the metadata.
  8. Batch Corrections:
    • Use batch editing tools to correct metadata for multiple files at once, based on patterns you observe in the errors.

Each of these strategies comes with its own set of complexities and may require additional development effort. In many cases, a combination of automated processes with manual review steps yields the best results, especially when dealing with large libraries of music files.

SaaS Packaging and distribution

Distributing your software as a product and potentially turning it into a Software as a Service (SaaS) involves several steps, each with its own considerations. Here’s a high-level overview of the process:

  1. Product Readiness:

    • Ensure your software is robust, user-friendly, and well-tested. It should have a clean interface (if it’s not command-line only), clear documentation, and handle errors gracefully.
    • Consider the scalability of your software. If it’s going to be SaaS, make sure it can handle multiple users and large data volumes efficiently.
  2. Licensing and Legal:

    • Decide on a licensing model. Will it be open-source, freemium, or commercial?
    • Consult with a legal professional to draft a Terms of Service agreement and a Privacy Policy, especially since you’re dealing with third-party services like Spotify.
  3. Monetization Strategy:

    • Determine how you will monetize the service. Subscription-based models are common for SaaS products. You could offer tiered pricing based on usage, features, or support levels.
    • Consider offering a free trial period to attract users.
  4. Deployment:

    • Deploy your application to a cloud service provider like AWS, Google Cloud, or Azure. This is necessary to manage the load and scale the service as your user base grows.
    • Set up continuous integration/continuous deployment (CI/CD) pipelines to streamline updates and deployments.
  5. User Support and Documentation:

    • Provide comprehensive documentation on how to use the software.
    • Set up support channels for users to report issues or seek help, such as email support, a ticketing system, or a community forum.
  6. Marketing and Outreach:

    • Create a website for your product with clear messaging on the benefits and features.
    • Use social media, content marketing, SEO, and perhaps paid advertising to reach your target audience.
    • Network within relevant communities (e.g., music enthusiasts, DJs, music producers).
  7. Feedback Loop:

    • Implement a system to gather user feedback and analytics to understand how your product is being used and to guide future development.
    • Use this feedback to iterate on your product, fixing bugs and adding features as necessary.
  8. Compliance:

    • Ensure compliance with any relevant data protection regulations (like GDPR if you have EU customers) and the Spotify API terms of use.

Regarding the question of whether it’s robust enough to be monetized as a SaaS, this depends on several factors:

  • Value Proposition: Does it solve a significant problem for users? Is there a demand for such a solution?
  • Market Fit: Are there enough potential customers who would pay for this service?
  • Competitive Analysis: Are there similar products? Can you offer something better or different?

Before proceeding, conduct market research to validate your idea. Consider creating a Minimum Viable Product (MVP) to gauge interest and get early feedback. The music industry is complex, and the legality of distributing a product that interacts with copyrighted material and third-party services must be carefully considered.

Remember, turning a script into a full-fledged product involves much more than just the technology. Customer service, marketing, business development, and legal compliance are all crucial parts of the equation.

Handling Auth in backend

Handling Spotify Authentication in a web application where you’re dividing tasks between the frontend and the backend involves a few considerations. For security and efficiency, it’s generally best to manage OAuth authentication through the backend. Here’s a detailed step-by-step approach on how to handle this:

1. Backend Handles Authentication

Why the Backend?

  • Security: Keeping sensitive operations like authentication on the backend protects the app from potential vulnerabilities such as exposing your client secret or access tokens to the client side.
  • Control: It’s easier to manage and refresh tokens securely and perform other sensitive operations from the backend.

Implementation Steps:

A. Setup the Backend:

  1. Configure OAuth with Spotify:

    • Use the Spotipy library as before but configure it to handle web server OAuth flow.
    • Store your Spotify app credentials (client ID and secret) securely on the server, ideally using environment variables.
  2. Create Authentication Routes:

    • Login Route: Redirects the user to the Spotify authorization page.
    • Callback Route: Handles the redirection after Spotify has authenticated the user. This is where you capture and process the authorization code returned by Spotify to exchange it for an access token.
  3. Session Management:

    • Store the access token (and refresh token, if applicable) in a server-side session or a secure place where it can be associated with the user’s session.

B. Integrate with Frontend:

  1. Trigger Authentication from Frontend:

    • When required, direct the user to the backend’s login route, which will handle the redirection to Spotify’s authentication page.
  2. Handling the Redirect:

    • After the user authenticates and authorizes your app, Spotify will redirect them back to the callback URL you specified, which should be your server’s callback route.
    • Process the authorization code to obtain tokens and then respond to the frontend, ideally redirecting the user back to the main app or providing a token indirectly via setting HTTP-only cookies or similar methods that secure the token from client-side access.
2. Securely Handling Tokens
  • Refresh Tokens: If the access token has expired, use the refresh token (stored securely on your server) to obtain a new access token automatically without needing the user to authenticate again.
  • Token Expiry: Implement logic on the backend to check the expiry of the token and refresh it as needed before making calls to Spotify’s API.
3. Frontend Receives Authentication Status
  • The frontend should be designed to handle states indicating whether the user is authenticated or not. This can be done through responses from the backend after trying to fetch or refresh tokens.
4. Use Tokens in API Requests
  • When the frontend needs to perform actions that require Spotify API interaction, it should request these actions from your backend, which then uses the stored tokens to authenticate API requests to Spotify.

Example with Flask (Python):

from flask import Flask, redirect, request, session
import spotipy
from spotipy.oauth2 import SpotifyOAuth
 
app = Flask(__name__)
app.secret_key = 'your_secret_key'  # Needed for session management
 

Moving Forward

With this setup, your web app can securely manage user authentication and seamlessly integrate Spotify’s capabilities, all while keeping user credentials safe and making the user experience as smooth as possible. This model also prepares you to scale your app securely, handle more Spotify API features, and maintain robust user sessions.

Transforming from a script to an app.

Creating a good looking web app

  1. Color Scheme: It’s important to choose a color scheme that is easy on the eyes, especially since users might be looking at the screen for a while as they manage their music libraries. The color scheme should also help to direct the user’s attention to important elements like the “Browse” button and the “Harvest” button.

  2. Typography: Select a clear and readable font. Headings and buttons may use a bolder version to make them stand out.

  3. User Input Fields: Clearly mark where users should input the playlist name and include placeholder text in the input fields to guide them.

  4. Buttons: Make buttons like “Browse” and “Harvest” prominent and use color to indicate primary actions. They should be large enough to be easily clicked on without being too distracting.

  5. Instructions and Labels: Provide concise instructions and labels to guide the user through the process. Tooltips can be used for additional information without cluttering the interface.

  6. Spacing and Layout: Ensure that there is enough space between different elements to avoid a cluttered look. Group related items together to create a logical flow on the page.

  7. Responsive Design: The web app should look good on both desktops and mobile devices. Elements should resize and rearrange themselves appropriately on smaller screens.

  8. Feedback for User Actions: Show progress indicators or animations when the app is working on a task, such as syncing the library, and provide clear success or error messages.

  9. Accessibility: Ensure that the design is accessible, with proper contrast ratios and support for screen readers.

  10. Animations and Micro-interactions: Subtle animations can make the user experience feel smoother. For example, a small animation when a folder is dragged and dropped, or when a sync is in progress.

Creating a Graphical User Interface (GUI)

  1. Choose a GUI framework: Python has several GUI frameworks, but Tkinter (built-in), PyQt, or Kivy are popular choices. Tkinter is the easiest to start with, but PyQt and Kivy have more features and flexibility.

  2. Design the interface: Use the chosen framework to create the layout. For your application, you might include:

    • A field to input the directory path.
    • A field to input the playlist name.
    • Buttons to execute the main script functions.
    • A console area to display the script output in real-time.

Bundling into an Executable

  1. Use a packaging tool: PyInstaller or py2exe for Windows, py2app for macOS, or PyOxidizer and Briefcase for cross-platform distribution can turn your script into a standalone executable.

  2. Test the executable: Ensure it works on a clean machine without a Python environment set up.

Providing an Installer

  1. Create an installer: Tools like Inno Setup or NSIS for Windows can create professional-looking installers that will install your executable and any required files.

  2. User documentation: Provide a simple README or even an in-app help section that guides users on how to use the application.

  3. Test the installer: Ensure that it correctly sets up the application on a new machine.

Distribution

  1. Choose a platform: Depending on your target audience, you could distribute your software via GitHub, a personal website, or a software marketplace.

  2. Update mechanism: Consider how users will get updates. For a simple script, it might be sufficient to tell users to download the new version from where they got the original.

  3. Feedback channel: Provide a way for users to report bugs or request features, like an email address or a GitHub issues page.

Learning Resources

  • For GUI development, check out tutorials specific to the library you choose (Tkinter, PyQt, etc.).
  • For PyInstaller, the official documentation is quite comprehensive.
  • For creating installers, Inno Setup and NSIS have their own scripting languages, and you can find many guides online.