VBS Recorder is an Android application for recording and managing audio files. It includes features such as splitting audio files into segments and saving them to the media store.
To install the project, follow these steps:
- Clone the repository:
git clone https://github.com/yourusername/vbs_recorder.git
- Open the project in Android Studio.
- Build the project to download all dependencies.
To use the application, follow these steps:
- Launch the application on your Android device.
- Use the record button to start recording audio.
- The recorded audio will be split into segments and saved to the media store.
The project uses the following dependencies:
- AndroidX Core KTX
- AndroidX AppCompat
- Material Components
- AndroidX ConstraintLayout
- AndroidX Navigation
- AndroidX Activity
- AndroidX Room
- AWS SDK for Android (S3 and Core)
- IIRJ (Infinite Impulse Response filters)
Add the following to your build.gradle.kts
file:
dependencies {
implementation(libs.androidx.core.ktx)
implementation(libs.androidx.appcompat)
implementation(libs.material)
implementation(libs.androidx.constraintlayout)
implementation(libs.androidx.navigation.fragment.ktx)
implementation(libs.androidx.navigation.ui.ktx)
implementation(libs.androidx.activity)
implementation(libs.androidx.room.common)
implementation(libs.androidx.room.ktx)
implementation(libs.androidx.room.runtime)
annotationProcessor(libs.androidx.room.compiler)
ksp(libs.androidx.room.compiler)
implementation(libs.aws.android.sdk.s3)
implementation(libs.aws.android.sdk.core)
implementation("uk.me.berndporr:iirj:1.7")
testImplementation(libs.junit)
androidTestImplementation(libs.androidx.junit)
androidTestImplementation(libs.androidx.espresso.core)
}
Ensure the following permissions are added to your AndroidManifest.xml
:
<uses-permission android:name="android.permission.RECORD_AUDIO" />
<uses-permission android:name="android.permission.FOREGROUND_SERVICE" />
<uses-permission android:name="android.permission.READ_MEDIA_IMAGES" />
<uses-permission android:name="android.permission.READ_MEDIA_VIDEO" />
<uses-permission android:name="android.permission.READ_MEDIA_AUDIO" />
<uses-permission android:name="android.permission.READ_EXTERNAL_STORAGE"/>
<uses-permission android:name="android.permission.WRITE_EXTERNAL_STORAGE" android:maxSdkVersion="29" />
- Recording Audio: Press the record button to start recording audio.
- Playing Audio: Press the play button to play the recorded audio. Use the seek bar to navigate through the audio.
Handles permission requests and basic app setup.
Contains the UI and logic for recording and playing audio.
- MediaRecorder for recording audio.
- MediaPlayer for playing audio.
- AWS account (Sign up).
- AWS CLI installed (Installation Guide).
- Proper IAM permissions for S3 (IAM Policy Guide).
- Install
boto3
library for Python:pip install boto3
- Configure AWS credentials (AWS CLI Config Guide):
aws configure
- Follow the official AWS guide: Create Bucket.
- Enable public or private access as needed: Bucket Policy Examples.
- Configure CLI with your AWS credentials:
aws configure
- Use the AWS CLI Configuration Guide.
- Upload files using CLI:
aws s3 cp /local/path s3://your-bucket-name/ --recursive
- For detailed instructions, see Uploading Objects.
- Update
config.json
in the repository with:- Bucket Name
- AWS Region
Use boto3
to create an S3 client instance for interacting with AWS S3.
import boto3
s3 = boto3.client('s3')
Use the upload_file
method to upload recordings from the local system to your S3 bucket.
bucket_name = 'your-bucket-name'
file_name = 'local/path/to/recording.mp4'
s3_key = 'recordings/recording.mp4'
s3.upload_file(file_name, bucket_name, s3_key)
print(f"Uploaded {file_name} to {bucket_name}/{s3_key}")
For more details, refer to the Boto3 Upload File Documentation.
Download a recording from S3 to the local system using the download_file
method.
download_path = 'local/path/to/save/recording.mp4'
s3.download_file(bucket_name, s3_key, download_path)
print(f"Downloaded {bucket_name}/{s3_key} to {download_path}")
More details: Download File Documentation.
List all recordings in your bucket using list_objects_v2
.
response = s3.list_objects_v2(Bucket=bucket_name, Prefix='recordings/')
if 'Contents' in response:
for obj in response['Contents']:
print(f"Found: {obj['Key']}")
else:
print("No recordings found.")
Reference: List Objects Documentation.
Delete a specific recording using delete_object
.
s3.delete_object(Bucket=bucket_name, Key=s3_key)
print(f"Deleted {bucket_name}/{s3_key}")
Reference: Delete Object Documentation.
This project is licensed under GNU General Public License v3.0.
Initial development of this project was supported by BBSRC Impact Acceleration Account (IAA) awarded to the University of Cambridge under the project titled: Accelerating the adoption of wingbeat-based sensing to quantify mosquito species abundance in the tropics led by Dr. Angkana T. Huang.