Empowering Storytelling with Node.js: Introducing an Open-Source MP3 Splitter for Children's Stories

2. September 2023
Storytelling is a cherished tradition, especially when it comes to children's stories. The joy of sharing tales with our little ones can be magical, but it often comes with a challenge: the length of the story. Children might not always have the patience for an entire narrative in one sitting. That's where the MP3 Splitter for Children's Stories comes into play.

Open Source and Node.js-Powered

Our project, the MP3 Splitter for Children's Stories, is an open-source initiative built on Node.js. It aims to enhance the storytelling experience for both parents and children. With this tool, you can effortlessly divide longer MP3 files, such as children's stories, into a series of shorter, more manageable segments. These segmented chunks can then be loaded onto compatible devices, like the Toniebox, to make storytime an even more enjoyable experience.

Simplify Storytelling

The main features of the project are:
  • Segmentation: The MP3 splitter takes a longer MP3 file and divides it into smaller, more easily digestible segments. This ensures that children can easily navigate to specific parts of the story, skipping forward or backward as they desire.
  • Customization: Tailor the number of segments to your preferences. You can determine how many segments each story should have, catering to your child's listening habits.

Getting started

Ready to simplify storytelling for your children? Ensure you have node, npm and git installed first, then follow these steps to get started:

1. Clone the Repository

Begin by cloning the project's repository to your local machine. Open a terminal and type in the following command:
git clone https://github.com/encho/mp3-splitter

2. Install Dependencies

Navigate to the project directory and install the necessary dependencies by running:
cd mp3-splitter && npm install

3. Run the MP3 Files Splitter

Execute the splitter script with:
npm start
The script will now ask you information about the file you want to split. First you will be prompted to input the original MP3 files location:
Enter the path of the input .mp3 file: ./input/cinderella.mp3
Then, you will be promted to enter the directory where the MP3 files will be saved. If the directory does not yet exist, it will be created for you automatically:
Enter the directory where output files will be saved: ./output/cinderella
Then, specify a file name which will be used for naming all generated MP3 files:
Enter the file name: cinderella
Finally, specify the number of segments your large MP3 file needs to get split up to:
Enter the number of segments: 8
Now, watch the feedback of the mp3 files generation script. If you see some output like this, your files have been generated successfully!

Audio duration (s): 2908.891429
Segment duration (ms): 2908891.429
Segment 1: start 0ms, end 363611ms
Segment 2: start 363611ms, end 727222ms
Segment 3: start 727222ms, end 1090833ms
Segment 4: start 1090833ms, end 1454444ms
Segment 5: start 1454444ms, end 1818055ms
Segment 6: start 1818055ms, end 2181666ms
Segment 7: start 2181666ms, end 2545277ms
Segment 8: start 2545277ms, end 2908888ms
Segment 8 saved as output/cinderella/cinderella_08.mp3
Segment 7 saved as output/cinderella/cinderella_07.mp3
Segment 6 saved as output/cinderella/cinderella_06.mp3
Segment 5 saved as output/cinderella/cinderella_05.mp3
Segment 4 saved as output/cinderella/cinderella_04.mp3
Segment 3 saved as output/cinderella/cinderella_03.mp3
Segment 2 saved as output/cinderella/cinderella_02.mp3
Segment 1 saved as output/cinderella/cinderella_01.mp3
            

4. Load Segments onto the MP3 Player

Once the MP3 file is successfully split, transfer the generated segments to your child's device, such as the Toniebox.

5. Enjoy the Experience

Witness your children delight in an enhanced storytelling experience. They can effortlessly navigate through the story using the device's controls, making storytime more interactive and engaging.

How to get the long MP3 files in the first place?

My process for getting MP3 files is to search for childrens stories on YouTube first. Then, once I have agreed with my child on the story, I download the video as an MP3 file with the free version of the excellent tool 4K YouTube to MP3.

Conclusion

The MP3 Splitter for Children's Stories is not just a script; it's an opportunity to foster a love for storytelling in your children. With seamless navigation, customization, and open-source flexibility, you can transform ordinary stories into unforgettable adventures. Get started today, and let the magic of storytelling unfold in your home. ∎
You’re into data design too?Then let’s connect on LinkedIn and exchange thoughts ondata, design, and visual storytelling.