Skip to content

MT-KS-04/AudioStreaming

Folders and files

NameName
Last commit message
Last commit date

Latest commit

 

History

11 Commits
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 

Repository files navigation

Audio Streaming App

Audio Streaming & Secure Chat Application

A powerful Java desktop application for real-time audio streaming and secure text chat over LAN/Internet. The project provides a room-based system that lets users freely create and join public or private chat groups.

🇻🇳 Phiên bản Tiếng Việt

Java Version Build Codec Security Protocol License

🌟 Key Features

  • Room Management
    • Create Public rooms or Private rooms (password protected).
    • Manage client connections through the ControlServer.
  • Audio Streaming
    • Real-time audio capture and playback using the Java Sound API.
    • UDP Multicast/Unicast transport for low latency.
    • OPUS Codec integration for high-quality audio compression and optimized bandwidth.
    • Jitter Buffer mechanism to minimize stutter when the network is unstable.
  • Secure Text Chat
    • Multi-user group chat backed by a multithreaded TCP server.
    • SSL/TLS v1.3 end-to-end encryption to protect messages in transit.
    • Safe login/logout flow with user presence notifications (join/leave).

📸 Screenshots

  • Create Room screen (Server): Server GUI

  • Join Room screen (Client): Client GUI

  • Interactive networking screen (Client UI): Client UI

  • In-room streaming & chat: Streaming GUI

  • DJ Mode (music playback): DJ Mode

  • Talkback / speak request status: Talkback Request

  • Selecting an audio file to stream: Audio File

🛠 Project Structure

  • src/app: Standalone main entry points used to test local/multicast streaming outside the GUI.
  • src/UI: The main Swing interface (frmServer, frmClient, room screens).
  • src/audio: Audio capture (microphone) and playback (speaker) handling.
  • src/codec: Wrapper around the Opus codec for fast PCM encode/decode.
  • src/network: UDP sender/receiver for streaming traffic.
  • src/TCPChat: TCP socket server/client running over TLS v1.3 for secure chat.
  • src/jitterbuffer: Jitter Buffer that reorders and synchronizes late/out-of-order packets.
  • src/control: Signaling between clients and server to join the correct multicast group / room registry.

🚀 Getting Started

Prerequisites

  • Java Development Kit (JDK) 8+ (JDK 17 or newer is recommended for solid TLS 1.3 support; the bundled NetBeans project is configured for JDK 24).
  • Apache Ant, or an IDE with Ant support (e.g. Apache NetBeans).

Option 1 — Run the prebuilt JAR (fastest)

A ready-to-run build is included under dist/. You only need a JRE/JDK:

# From the project root
java -jar dist/audioStreaming.jar

The dist/lib/ folder holds all runtime dependencies — keep the folder layout intact when you copy the build elsewhere.

Option 2 — Build from source with Apache Ant

# Compile and repackage the JAR into dist/
ant clean
ant jar

# Or build and immediately launch the default entry point
ant run

Option 3 — Open in NetBeans IDE

  1. Clone or download the project.
  2. Open it in NetBeans IDE (File → Open Project).
  3. Start the Server:
    • Run src/UI/frmServer.java (right-click → Run File).
    • Choose Public or Private mode (enter a password if needed).
    • Click Create Room. The app generates a Room Code, starts the audio thread, and waits for secure client connections.
  4. Start a Client:
    • Run src/UI/frmClient.java for each participant.
    • Enter the Room Code (shared by the host), your Full Name, and the Password (for Private rooms).
    • Click Join. The app authenticates you and opens the streaming + group-chat window.

Local testing tip: You can open one Server window and several Client windows on the same machine to test quickly before deploying across a LAN.

🔐 About the Security Certificate (Keystore)

The project uses server.keystore for TLS chat connections. The default password is changeit. For real deployments, generate your own keystore with a stronger password using keytool:

keytool -genkeypair -alias serverkey -keyalg RSA -keysize 2048 \
        -validity 365 -keystore server.keystore

📖 User Manual

Once the app is installed and running, you can use the following features:

  • Creating & managing rooms (Server side):

    • As the host (Server), you can set up a room in Public mode (room code is shared openly) or Private mode (a password protects the space).
    • DJ Mode: Instead of only capturing from the microphone, you can switch the source and browse for an existing audio file to broadcast high-quality music to every client.
  • Group interaction (Client side):

    • Get the Room Code and Password (if any) from the Server host to connect.
    • Use the Message panel to send text messages (secured with TLS encryption).
    • Bandwidth-heavy audio features (e.g. Talkback / speak request) are granted through a system queue to avoid interference when several people try to talk at once.

👤 Authors & Contact

This project was conceived and built by a team passionate about deep network-system optimization — from researching UDP Multicast streaming and applying the Opus Codec for audio compression in Java, to encrypting raw data with the TLS v1.3 security layer — all aiming to create a stable, secure, and high-quality voice/chat ecosystem.

If you share that passion, want to contribute new features (e.g. richer multithreaded UI/UX, improved P2P connectivity), or simply want to exchange ideas or request materials, we'd love to hear from you 👇


📄 License

This project is distributed under the Apache License 2.0. See the LICENSE file for full terms, rights, and limitations.


© 2026 Development Team (MT-KS-04 & duytran). All rights reserved.
A Java Desktop application demonstrating Multicast UDP streaming and TLS v1.3 Chat.

About

Real-time audio streaming between a server and multiple clients over LAN. Java, raw TCP/UDP sockets, multithreading, and packet encryption.

Topics

Resources

License

Stars

1 star

Watchers

0 watching

Forks

Releases

No releases published

Packages

 
 
 

Contributors

Languages