Os - Labproject
Os - Labproject
SUBMITTED BY
K.CHARAN REDDY (23J21A1209)
D.GANGADHAR (23J21A1212)
DEPARTMENT OF INFORMATIONTECHNOLOGY
CERTIFICATE
This is to certify that the Lab Project entitled “MUSIC PLAYLIST USING FIRST COME
FIRST SERVE” is the bonofide work carried out by is carried out by C.CHARAN REDDY
(23J21A1209),D.GANGADHAR(23J21A1212) ,T.NITEESH REDDY (23J21A1246) of II B.
Tech IT under the guidance and supervision. The Lab Project Report is submitted to
Joginpally BR Engineering College (UGC Autonomous) Hyderabad in partial fulfilment
of requirements of the award of the degree of Bachelor of Technology in Information
Technology during the academic year 2024-2025.
2
ACKNOWLEDGEMENT
We would like to take this opportunity to place it on record that this Lab Project would
never have taken shape but for the cooperation extended to us by certain individuals.
Though it is not possible to name all of them, it would be unpardonable on our part if we
do not mention some of very important persons.
We express our gratitude to Dr. B Venkata Ramana Reddy, Principal of JOGINPALLY
BR ENGINEERING COLLEGE for valuable suggestions and advice. We also extend our
thanks to other faculty members for their cooperation during our Lab Project.
We express our gratitude to Dr.T.Sheshagiri, HOD OF INFORMATON TECHNOLOGY
for valuable suggestions and advice.
Sincerely, We acknowledge our deep sense of gratitude to our Lab Project guide, Mr.K.
Venkaiah, Assistant Professor for his constant encouragement, help and
valuable suggestions.
Sincerely, We acknowledge our deep sense of gratitude to our Lab Project guide,
Dr.SHAIK ALEEM BASHA, Associate Professor for his constant encouragement, help
and valuable suggestions.
3
DECLARATION
We hereby declare that our Lab Project entitled “MUSIC PLAYLIST USING FIRST
COME FIRST SERVE”is the work done during the academic year 2024-2025, II year
–II -Sem and our Lab Project is submitted in partial fulfilment of the requirements for
the award of B.Tech degree in Information Technology from Joginpally B.R.
Engineering College (UGC Autonomous), Hyderabad.
ABSTRACT
4
A music playlist is a structured compilation of audio tracks that are grouped based on
specific criteria such as mood, genre, artist, theme, or user preference. Playlists play a
significant role in modern digital music consumption, allowing users to experience seamless
and personalized music streaming.With advancements in technology, playlists have evolved
from manually curated song lists to AI-driven, dynamically updated collections. Streaming
platforms like Spotify, Apple Music, and YouTube Music utilize machine learning
algorithms to analyze user behavior, listening patterns, and contextual factors to generate
personalized playlists. These intelligent recommendations enhance user engagement by
suggesting songs that match individual tastes.Playlists can be categorized
into static and dynamic types. Static playlists consist of manually selected songs that
remain unchanged unless modified by the user. Dynamic playlists, on the other hand, are
automatically updated based on specific rules, such as recently played tracks, trending songs,
or AI-generated recommendations. Additionally, collaborative playlists enable multiple
users to contribute and modify a shared playlist, promoting social interaction and discovery
of new music.The role of music playlists extends beyond entertainment. They are widely
used in therapy, fitness training, meditation, and focus enhancement. For instance,
curated workout playlists help maintain energy levels during exercise, while relaxation
playlists aid in stress reduction and mindfulness.Furthermore, advancements in music
recommendation systems have led to the integration of contextual awareness in playlist
creation. Factors such as time of day, location, weather, and user mood are considered to
provide a more immersive and adaptive listening experience.As technology continues to
evolve, the future of music playlists lies in deeper AI integration, real-time user adaptation,
and more interactive features, ensuring a highly personalized and engaging musical journey
for listeners.
5
INDEX
ABSTRACT
1. INTRODUCTION
2. SYSTEM ANALYSIS
2.1 Fuctional Requriements
2.2 Non-Functional Requirement
3. METHODOLOGY
2.3 Design Approach
2.4 Development Tools
4.SOFTWARE REQUIREMENT
5. SYSTEM DESIGN
6. ALGORITHM
2.5 Shuffle Playlist(Firsher-Yates Algorithm)
2.6 Add Song Algorithm
2.7 Remove Song Alogorithm
7. CODE
8. TEST CASES ON MUSIC PLAYLIST
9.RESULT
10. CONCLUSION
11.REFERENCE
6
1. INTRODUCTION
A music playlist is a collection of audio tracks organized in a specific order or random
arrangement, allowing users to enjoy their music in a personalized and convenient way.
With the rise of digital music platforms and services, playlists have become a core
feature for organizing and managing music collections. These playlists allow users to
curate their listening experience by selecting their favorite songs and grouping them
together based on themes, moods, genres, or activities.The aim of this project is to
design and implement a Music Playlist System that enables users to create, modify,
and manage playlists efficiently. The system will allow users
to add songs, remove songs, and shuffle the playlist, giving them full control over
their music selection. Whether the user wants to organize songs by genre, create a
workout playlist, or simply shuffle their favorite tunes, this system provides the tools to
customize their music experience.In addition to the basic functionalities like adding and
removing songs, one of the key features of the system is the ability to shuffle the
playlist using the Fisher-Yates shuffle algorithm, a highly efficient method for
randomizing the order of songs. This adds an element of surprise and variety, helping
users enjoy their playlists in a new and engaging way every time they listen.This
project explores the interaction between functional and non-functional requirements,
ensuring that the system is both user-friendly and performant. By leveraging modern
programming languages and development tools, the system is designed to handle
various operations like managing large music libraries efficiently, responding quickly
to user actions, and ensuring the integrity of the playlist data.
Overall, the project seeks to enhance the user experience with an intuitive and
interactive music playlist manager that simplifies music management and offers more
control over the listening experience. Whether you're a casual listener or an avid music
lover, this system provides a flexible and customizable way to enjoy your favorit
7
2. SYSTEM ANALYSIS
The system analysis includes understanding the functional and non-function
requirements of the Music Playlist Management System.
2.1 Functional Requirements:
1. Add a song: The user can add songs to the playlist.
2. Remove a song: The user can remove a song from the playlist by title.
3. Shuffle the playlist: The user can shuffle the playlist to randomize the song order.
4. Display current playlist: The user can view the current songs in the playlist.
2.2Non-Functional Requirements:
1. Efficiency: The system must handle playlists with a large number of songs efficiently.
2. User Interface: The user should interact with the system through a console-based
menu.
3. Memory Usage: The program should minimize memory usage while managing the
playlist
8
3. METHODOLOGY
In developing the Music Playlist System, we used a structured methodology that guided the
design, development, and testing phases of the project. This approach focused on ensuring
that the system was user-friendly, functional, and scalable, while also providing an efficient
backend that can handle various playlist operations
2.3. Design Approach
Modular Design: The system is designed with a modular structure, where each core
functionality, such as adding songs, removing songs, and shuffling the playlist, is
isolated into its own module. This makes the code easier to maintain, debug, and
extend with additional features in the future.
User-Centered Design: The focus of the design was on delivering a simple and
intuitive user interface that makes it easy for users to interact with the system. The
design ensures that adding, removing, and shuffling songs can be performed with
minimal effort and in a straightforward manner.
2.4. Development Tools
Programming Language: C
Compiler: GCC or any standard C compiler
9
4.Software requirement
In the context of this project, "Recurrent" could refer to repeating tasks or actions in the
program. Here, it specifically refers to the use of loops in the program to handle user input
continuously until the user decides to exit the application.For example, a loop will repeatedly
show the menu for the user to choose operations like adding, removing, shuffling, or
displaying songs until the user exits the program.
HARDWARE REQUIRMENTS
• PIV 2.8GHz Processor and above
• RAM 512MB and above
• HDD 40GB hard disk space and above
SOFTWARE REQUIRMENTS
• WINDOWS OS(NT/XP/7/10/11)
• Ms Office
• Dev C+
5.SYSTEM DESIGNING
10
A music playlist system is a fundamental feature in music streaming applications, allowing
users to create, manage, and share curated collections of songs. This system must be designed
to handle large-scale operations efficiently while providing a seamless user experience. It
requires robust data storage, efficient retrieval mechanisms, and features like playlist
recommendations, collaborative playlists, and caching for frequently accessed data. The
system must also support both public and private playlists with secure access controls.
System Requirements
The system's functional requirements include the ability for users to create, edit, delete, and
share playlists. Users should be able to add or remove songs, reorder tracks, enable shuffle
and repeat modes, and set metadata such as playlist names, descriptions, and cover images.
Additionally, the system should support collaborative playlists where multiple users can
contribute, and allow users to like, follow, or discover trending playlists. Recommendations
based on user preferences and behavior should also be integrated. On the non-functional
side, the system must be highly available, scalable, and performant, ensuring minimal latency
in retrieving playlists and streaming music. Efficient caching and indexing are required for
quick search and retrieval, and security mechanisms should be in place to manage user access
and prevent unauthorized modifications.
Architecture Design
The system follows a microservices architecture to ensure scalability and flexibility. The
frontend can be developed using React for web applications or Flutter for mobile apps,
providing an interactive UI for managing playlists. The backend can be built using Spring
Boot (Java) or Node.js, exposing REST APIs for playlist operations. A relational database
like PostgreSQL or MySQL stores structured playlist data, such as user-created playlists,
song metadata, and playlist relationships. To optimize performance, Redis is used for caching
frequently accessed playlists, reducing database load. Elasticsearch is integrated to enable
fast searches for playlists by name, genre, or user preferences. Large files, such as playlist
cover images, are stored in cloud storage solutions like AWS S3 or Google Cloud Storage.
Additionally, a message queue (Kafka or RabbitMQ) helps process background tasks like
recommendation calculations asynchronous
11
6.ALGORITHM
Here’s an overview of the algorithms used in the system:
Shuffle Playlist (Fisher-Yates Algorithm):
1. Start with an array of songs.
2. For each song, randomly swap it with another song in the array.
3. Repeat the process for each song in the array.
4. The playlist is now shuffled randomly.
Add Song Algorithm:
1. Accept song details (title, artist, length) from the user.
2. Add a new song to the playlist array.
Remove Song Algorithm:
1. Search the playlist for the song by title.
2. If found, remove the song from the playlist and shift remaining songs to fill the gap.
12
7.SAMPLE PROGRAM
#include <stdio.h>
#include <stdlib.h>
#include <string.h>
#include <unistd.h>
// For sleep function
#define MAX 100 // Maximum playlist size
// Queue structure for FCFS Playlist
typedef struct {
char songs[MAX][50]; // Array to store song names
int front, rear;
} Playlist;
13
q->rear++;
strcpy(q->songs[q->rear], song);
printf("Added: %s\n", song);
}
// Main function
int main() {
Playlist q;
initialize(&q);
playSongs(&q);
return 0;
14
8.TEST CASE ON MUSIC PLAYLIST
Here are some test cases that can be used to verify the functionality of the system:
Test Case 1: Add Song
Input: Title: "Song A", Artist: "Artist A", Length: 3.5
Expected Output: "Song A by Artist A (3.5 min)" should be added to the playlist.
Result: Verified successful addition of the song.
Test Case 2: Display Playlist
Input: Display playlist with 2 songs.
Expected Output: Displays the songs in the playlist.
Result: Playlist displayed correctly.
Test Case 3: Remove Song
Input: Title: "Song A"
Expected Output: "Song A" should be removed from the playlist.
Result: Song was successfully removed.
Test Case 4: Shuffle Playlist
Input: Shuffle playlist with 3 songs.
Expected Output: Playlist order should change randomly.
Result: Playlist was shuffled correctly
15
9.EXPECTED OUTPUT
16
17
18
19
10.CONCLUSION
The Music Playlist System using First Come First Serve (FCFS) follows a structured
approach where songs are played in the exact order they were added. The Music Playlist
Management System in C works effectively, allowing users to add, remove, shuffle, and
display songs. It fulfills the requirements and performs well even with multiple songs. Future
improvements could include saving and loading playlists from files and implementing
advanced features like song search and sorting.
20
11.REFERENCE
1. C Programming Language, Brian W. Kernighan and Dennis M. Ritchie.
2. Fisher-Yates Shuffle Algorithm: https://en.wikipedia.org/wiki/Fisher
%E2%80%93Yates_shuffle
3. C Standard Library Documentation: https://en.cppreference.com/w/c
21