Arc676 / Arc676/Toohak

Embed audio?

Open
#1 0 comments 0 reactions 0 assignees View on GitHub
enhancement help wanted
Dominant language
Java
Stars
39
Forks
7
PR merge metrics
No merged PRs in 30d

Description

It would be nice if it were possible to embed audio into questions. It could be useful for quizzes for learning languages or music identification (or various other things).

Several implementation questions though:
1) Where will the audio be saved?
2) Will the audio be played by the host device or by the clients?

### Question 1

If the audio is saved as part of the quiz, then the audio data will have to be serialized.

Advantages:
- Sharing quizzes doesn't require sharing resource files. This is already the case for image data.
- Can send audio data over network to clients

Disadvantages:
- Increased file size for quizzes
- Increased complexity

If the audio data is *not* serialized, other questions arise:
1) Where will the audio be stored? How will Toohak know where to access them? What if they move?
2) What will the implications be for sharing quizzes?
3) Will it still be possible to send audio data to clients?

### Question 2

One of the primary advantages of Toohak over Kahoot is that all the necessary information for answering a question is sent to the clients. Although the leaderboard is only visible on the server (for now, anyway), clients don't have to be physically near the server to play. If this is to continue to be the case, then the audio data must be transmitted to the clients. This could incur extreme latency and server-side overhead. The alternative is to simply not support audio data questions for when people aren't actually near the server, but this would be a compromise when questions and images are already independent of physical location.

Additionally, if the audio data is played client side and the players *are* close to one another, then they'll all be playing the audio over each other, which would be detrimental to the experience.

### Suggested solution

One potential solution that should be simple to implement is the following:
- Audio files must be stored in the same directory as the quiz file
- Search for audio files in the same directory as the quiz file when needed (the path is retrieved when the quiz file is loaded)
- Play audio server-side (compromise as stated for question 2)
- Sharing quizzes would require sharing audio files
- No need for serializing, en/decoding audio, or transmitting audio data

Contributor guide

No contributing guide indexed for this repository

Research direction

No files or tests are named. Start by mapping how quiz files are loaded and how question data reaches clients, then evaluate the suggested same-directory audio files and server-side playback approach. Done would require a decided storage, sharing, and playback design for audio questions.

Written by the indexing model from the issue text.

Assessment

Tech stack
java
Domain
audio-video-rtc, game-dev
Issue type
Feature
Difficulty
5/5
Estimated time
Over a week
Activity status
Stale
Clarity
Needs clarification
Newbie friendliness
20/100

Get new issues in your inbox

A short digest of beginner-friendly GitHub issues.