日本語説明はこちら
"Refine Effect" is a tool which can improve sound quality of cheap earphones.
Most cheap earphones have poor sound quality. Why?
In my opinion, it is because they don't have flat frequency characteristics.
Therefore, I decided to develop a tool to measure them and make the untidy characteristics flat using a normal microphone.
You don't have to know the microphone's frequency characteristics, but you need a good earphone.
This tool compares cheap earphones's data with good earphone's data, and calculates magnifications with respect to each frequency. In other words, it makes your cheap earphone closer to your good earphone.
This repository contains two different tools.
The former(main.py) measures frequency characteristics of your earphones.
The latter(realtime.py) takes in audio output of your PC and reproduces good sound tuned for your cheap earphones in real time.
I developed these tools in the environment as shown below.
$ python -V
Python 3.6.5 :: Anaconda, Inc.
This tool requires following Python packages.
- numpy
- PyQt5
- pyaudio
- threading
And you have to install a virtual audio driver. I confirmed following softwares works well.
- Soundflower(Mac)
- VB-CABLE(Windows)
-
Move to the RefineEffect directory and execute a frequency measuring tool.
$ python main.py
Measure your good earphone once, and then measure both side of your cheap earphone.
- change output device.
If you use Mac, setting->sound->output->select "Soundflower(2ch)".
If you use Windows, setting->sound->playback->select "CABLE Input".
-
Check both output and input device index.
$ python device.py
If you use Mac, output device is "Built-in Output" and input device is "Soundflower(2ch)".
If you use Windows, output device is "CABLE Output" and input device depends on your environment.
- Edit realtime.py
Change these variables to suit your environment.
class MainWindow(QtWidgets.QMainWindow):
OUTPUT_INDEX = 3
INPUT_INDEX = 4
CALIBRATE_PATH = "calibrate/earphone.npy" # Calibrate earphone data
LEFT_PATH = "earphone/L.npy" # left poor earphone
RIGHT_PATH = "earphone/R.npy" # right poor earphone
OUTPUT_FIX = 7 # Change here according to sound level-
Execute a real-time equalizer.
$ python realtime.py
Enjoy good sound!
Decrease the number of OUTPUT_FIX in realtime.py.
Increase the number of OUTPUT_FIX in realtime.py.



