~/aronnax.site/blog/2025
cat Open the Door For Fotune.md

Open the Door For Fortune Guide

tokei Open the Door For Fotune.md

Type Lines CJK Words
List 31 0 494
Heading 9 0 18
Paragraph 9 0 182
Code 3 0 8
Quote 1 0 14
Image 1 0 2
Total 54 0 718

~4 min read

Open the Door for Fortune

A command line game to guess songs, based on ffmpeg and iTunes Search API

Introduction

This project is inspired by a TV program called Kaimen Daji (Open the Door for Fortune) in China. In the program, the players are required to guess the names of random songs based on their intro melody. If they guess the correct answer, they receive some cash as rewards; otherwise, they fail.

This project will simulate its rules. The user will be asked to listen to slices of different songs and guess the song’s title, and if he/she guesses correctly, his/her score will increase by one.

There are two modes to choose:

The number of songs and whether to turn on “cheat mode” can also be modified. See “How to Use” for more information.

How to Use

Before running the program, please ensure the following dependencies are met:

  1. Install Python Dependencies: Install the required Python packages by running: pip install -r requirements.txt

  2. Install FFmpeg: Ensure that the FFmpeg multimedia framework is installed and accessible via your system’s command line (CLI). Download here.

This project does not have a GUI interface, so the user is required to run this project from the command line. Overall, the format is as follows.

python project.py [-n number] [-m mode] [-c]
command-line guide

The specific usage of these arguments is shown in the command line interface.

Then, the user can follow the instructions on the command line.

Functions

project.py

test_project.py

Packages

All Packages: requirements

APIs

Software