π§ Creating a Google Cloud Storage Bucket for Audio Files π§
This guide will walk you through setting up a Google Cloud Storage (GCS) bucket perfect for keeping your πΆ audio files πΆ safe and sound. We'll set it up with the right permissions and give you the keys π (credentials) so you can easily upload and manage your tunes.
π Prerequisites πβ
- An active Google Cloud Platform (GCP) account.
- A little bit of experience navigating the GCP console.
πͺ£ Step 1: Create Your Audio Bucket πͺ£β
- Head to the GCS Console:
- Log in to your GCP account and go to the Google Cloud Storage console.
- Click "CREATE BUCKET":
- Hit that button to get started!
- Let's Set Up Your Bucket:
- Name your bucket: Pick a unique name that follows the naming guidelines. Get creative, but keep it relevant! Example:
friend-audio-files
. - Where should we store your audio?: Choose a location that makes sense for you. Think about how quickly you need to access your files and your budget. A Multi-region is great for extra reliability across a wider area, while a Region gives you faster access in a specific spot.
- Pick a storage class: Standard is usually the best choice for files you access often. If you have audio you don't need very often, check out the other options (Nearline, Coldline, Archive) to save some π°.
- Control who can access your files:
- Public access prevention: Keep this "On" to make sure your audio stays private. π€«
- Access control: Stick with "Uniform" for consistent permissions across all your audio files.
- Extra protection for your tunes:
- Soft delete policy: This is already on by default β it's like a safety net if you accidentally delete something!
- Object versioning: Want to keep track of changes and easily recover older versions? Turn this on!
- Object retention policy: If you need to keep audio for a specific amount of time, use this to set rules.
- Encryption type: Google will keep your audio encrypted by default β you don't need to do anything here unless you have special requirements.
- Name your bucket: Pick a unique name that follows the naming guidelines. Get creative, but keep it relevant! Example:
- Time to Create:
- Double-check everything and click "CREATE".
- Success!
- You'll get a message letting you know your bucket is ready to rock. π€
π Step 2: Create a Service Account πβ
Think of this like a special ID card for your app to access the bucket.
- Go to "IAM & Admin":
- Find it in the GCP console menu.
- Click "Service Accounts":
- This is where we'll make that ID card.
- "CREATE SERVICE ACCOUNT":
- Click the button to get started.
- Fill in the Details:
- Service account name: Give it a clear name. Example:
test-service-account-friend-app
. - Service account description: What will this account do? (e.g., "Uploads audio to the friend-audio-files bucket").
- Service account name: Give it a clear name. Example:
- Give Permissions (Optional):
- Select a role: Search for and select "Storage Object User". This gives your app permission to work with the audio files in your bucket.
- Grant Users Access (Optional):
- We can skip this for now β we'll use a key instead.
- Create that Account!
- Review and click "DONE".
π Step 3: Get Your Key πβ
- Find Your Service Account:
- Go back to the service accounts list and click on the one you just created.
- Click "KEYS":
- Time to get that access key!
- Add a New Key:
- Click "ADD KEY" and then "Create new key".
- Choose "JSON":
- This is the format we need.
- Create!
- Click "CREATE", and the key file will download to your computer.
- Keep it Safe! This key gives your app access to your bucket β don't share it publicly!
𧬠Step 4: Convert to Base64 π§¬β
This step turns your key file into a special code we can use in the app.
Option 1: Command Line
- Open Your Terminal:
- Open a terminal or command prompt.
- Go to Your Key:
- Use
cd
to navigate to where you saved the key file.
- Use
- Run This Command:
- Replace
your-key-file.json
with the actual name of your key file:base64 your-key-file.json
- Replace
- Copy the Code:
- You'll get a long string of text β this is your Base64 encoded key! Copy it.
Option 2: Website Converter
- Go to the Converter:
- Paste Your Key:
- Open your
json
key file and copy the entire contents.
- Open your
- Convert!
- Paste the key contents into the website's input box and click "JSON to Base64".
- Copy the Base64:
- Copy the encoded text from the output box.
π Step 5: Grab Your Bucket Name πβ
- Back to the GCS Console:
- Go back to the Google Cloud Storage console.
- Find Your Bucket:
- You'll see it in the list.
- Copy the Name:
- Click on your bucket's name and copy it from the "Bucket details" page.
π You're All Set! πβ
You now have two important pieces:
- GCP Credentials Base64: Your special encoded key.
- GCP Bucket Name: The name of your audio bucket.
π±Last Stepπ±β
- Open the app
- Goto Settings
- Enable Developer Mode
- Select Developer Mode (scroll down)
- Enter your GCP Credentails and GCP Bucket Name
- SAVE π
Watch the magic and check out those sweet sounds! πΆ
Contributing π€β
We welcome contributions from the open source community! Whether it's improving documentation, adding new features, or reporting bugs, your input is valuable. Check out our Contribution Guide for more information.
Support πβ
If you're stuck, have questions, or just want to chat about Omi:
- GitHub Issues: π For bug reports and feature requests
- Community Forum: π¬ Join our community forum for discussions and questions
- Documentation: π Check out our full documentation for in-depth guides
Happy coding! π» If you have any questions or need further assistance, don't hesitate to reach out to our community.