The karaoke_client
is designed to interact with the AIProcessingService
of the Karaoke Scoring System, simulating real-time karaoke performance scoring. This client helps in testing the system by sending audio chunks and receiving scores.
- Docker installed on your machine.
- Access to the AWS EC2 instance with the Karaoke Scoring System deployed.
.pem
file for secure connection to the AWS EC2 instance.
git clone [repository-url](https://github.com/eandualem/karaoke_client)
cd karaoke_client
- Place your
certificate.pem
file in the root directory ofkaraoke_client
. - Ensure the certificate file name matches the one specified in your
.env
file.
-
Clean the Generated Folder (if necessary):
Remove the existing
Generated
directory within theproto
folder to ensure fresh generation of protocol files:rm -r ./proto/Generated
-
Build the Docker Image for gRPC Generation:
Build the
grpc-builder
image using theDockerfile.grpcgen
:docker build -t grpc-builder -f Dockerfile.grpcgen .
-
Generate Protocol Files:
Run a temporary container to generate the protocol files and copy them back to the host:
docker run --name grpc-temp grpc-builder /bin/true docker cp grpc-temp:/app/Generated ./proto docker rm grpc-temp
docker build -t karaoke-client -f Dockerfile.client .
Update the .env
file with the appropriate values, especially the SERVER_ADDRESS
.
Example .env
content:
USER_LOCALE = "en"
AUTH_TOKEN = "token_placeholder"
CERT_FILE_PATH = "certificate.pem"
SERVER_ADDRESS = "ec2-16-171-36-141.eu-north-1.compute.amazonaws.com:50051"
To run the client and connect it to the AIProcessingService
:
docker run -it --rm --name karaoke-client karaoke-client
The client will start sending audio chunks and display the scoring results in real-time.
karaoke_client/
βββ Dockerfile.client
βββ Dockerfile.grpcgen
βββ README.md
βββ certificate.pem
βββ proto/
β βββ Declarations/
β βββ Generated/
β βββ generate.sh
β βββ requirements_grpcgen.txt
βββ requirements.txt
βββ src/
βββ __init__.py
βββ ai_processing_service_client.py
βββ client.py
βββ logger.py
βββ request_builder.py