Skip to content

Commit

Permalink
Update readme manual
Browse files Browse the repository at this point in the history
  • Loading branch information
Paradeluxe committed Dec 8, 2024
1 parent 4538867 commit d9f8c80
Show file tree
Hide file tree
Showing 4 changed files with 55 additions and 54 deletions.
21 changes: 11 additions & 10 deletions README_zh.md
Original file line number Diff line number Diff line change
Expand Up @@ -51,8 +51,7 @@ Praditor可以处理**单起始点**和**多起始点**音频文件,无论你

Praditor计算得出的起始点会以.TextGrid的PointTier呈现,并允许用户调整参数以获得更好的结果。

# 来自作者

# 作者

因为Praditor的给出的结果文件是PointTier,而PointTier通常不好操作。如果你需要一些**后续脚本**

Expand Down Expand Up @@ -159,20 +158,22 @@ Praditor 允许用户调整 _**EPS%**_。该参数的运作逻辑是:每一个


## Threshold
It is the most used parameter. The core idea of thresholding method is about "Hitting the cliff".
Whenever a talker speaks, the (absolute) amplitude rises up and creates a "cliff" (in amplitude, or other features).
这是最常用的参数。

阈值法的核心概念可以看作是“击中断崖(Hitting the cliff)”。说话者说话会使得音频信号的波幅(或是其他信号特征的数值)上升,就像是创造了一个“断崖”。

**_Threshold_** 的最小值限制在1.00(相对于噪声参考区域的基线值)。录制到的说话声应当大于背景噪声——信号的波幅应当大于噪声参考的波幅。

![threshold_possibly_close.png](instructions/threshold_possibly_close.png)

**_Threshold_** has a minimum limitation at **1.00**, which is based on the mean value of background-noise reference.
However, background noise is not "smoothy" but actually "spiky".
That is why **_Threshold_** is usually **slightly larger than 1.00**.
然而,背景噪声通常不是“平滑的”,而是“毛糙的”;也就是,基线值通常小于毛糙部分的顶点(因为基线值是平均得来的)。
所以,实际情况是 **_Threshold_** 应当稍微大于1.00(永远不会等于1.00,这就违背了最基础的假设“说话声大于噪声”)。

![asp_sound.png](instructions/asp_sound.png)

Besides, I would suggest you pay more attention to **aspirated sound**, as this type of sound has "very slow slope".
Too large **_Threshold_** can end up in the middle of that "slope" (which is something you don't want).
If that's the case, it can sound really weird, like a burst, rather than gradually smooth in.
同时,我会建议你着重关注 **送气音**。当一个单词以 **送气音** 开头,它并不形成一个“断崖(cliff)”,而是一个“缓坡(very slow slope)”——
这种差异导致了正常情况击中“断崖”而落下得到的**起始点**,会停留在“缓坡”的**半坡**上。 当**送气音**被斩断,音频会听起来像是“突然爆炸(burst)”,
有一种突兀感;而非完整截取时得到的渐进。


## KernelSize, KernelFrm%
Expand Down
Binary file modified illustration.pptx
Binary file not shown.
24 changes: 13 additions & 11 deletions main.py
Original file line number Diff line number Diff line change
@@ -1,8 +1,9 @@
import ctypes
import os
import sys
import webbrowser

from PySide6.QtGui import QAction, QIcon, QPixmap
from PySide6.QtGui import QAction, QIcon
from PySide6.QtWidgets import (
QApplication,
QMainWindow,
Expand All @@ -13,7 +14,7 @@

from QSS import *
from core import runPraditorWithTimeRange, create_textgrid_with_time_point, get_frm_points_from_textgrid
from pic_message import Example
# from pic_message import Example
from pyplot.view_audio_qchart_slider import AudioViewer
from slider.slider_section import MySliders
from tool import isAudioFile, resource_path
Expand Down Expand Up @@ -71,9 +72,9 @@ def __init__(self):
""")

file_menu = menu.addMenu("&Help")
button_action = QAction("&Parameters", self)
button_action = QAction("&Instructions", self)
button_action.setStatusTip("Folder to store target audios")
button_action.triggered.connect(self.showParamInstruction)
button_action.triggered.connect(self.browseInstruction)
file_menu.addAction(button_action)
file_menu.setStyleSheet("""
QMenu {
Expand Down Expand Up @@ -405,14 +406,14 @@ def showParams(self):
self.MySliders.resetParams(eval(txt_file.read()))


def showParamInstruction(self):
# QMessageBox.information(None, "标题", "这是一个信息消息框。")
self.popup = Example()
self.popup.show()
# def showParamInstruction(self):
# # QMessageBox.information(None, "标题", "这是一个信息消息框。")
# self.popup = Example()
# self.popup.show()

def openFileDialog(self):
# 打开文件对话框,让用户选择一个文件
options = QFileDialog.Options()
# options = QFileDialog.Options()
# options.setStatusTip("Folder to store target audios")

# options |= QFileDialog.DontUseNativeDialog # 禁用原生对话框
Expand Down Expand Up @@ -452,8 +453,9 @@ def openFileDialog(self):

self.setWindowTitle("Praditor")



def browseInstruction(self):
# 使用webbrowser模块打开默认浏览器并导航到指定网址
webbrowser.open('https://github.com/Paradeluxe/Praditor?tab=readme-ov-file#--------')

def runPraditorOnAudio(self):
if not self.run_onset.isChecked():
Expand Down
64 changes: 31 additions & 33 deletions test.py
Original file line number Diff line number Diff line change
@@ -1,37 +1,35 @@
from PySide6.QtWidgets import QApplication, QWidget, QLabel, QVBoxLayout, QMainWindow
from PySide6.QtCore import Qt

class CustomTitleBar(QWidget):
def __init__(self, parent=None):
super().__init__(parent)
self.layout = QVBoxLayout(self)
self.layout.setContentsMargins(0, 0, 0, 0)
self.title = QLabel("Custom Title", self)
self.title.setStyleSheet("font-weight: bold;")
self.title.setAlignment(Qt.AlignmentFlag.AlignCenter)
self.layout.addWidget(self.title)
import sys
from PySide6.QtWidgets import QApplication, QMainWindow, QMenuBar
import webbrowser
from PySide6.QtGui import QAction


class MainWindow(QMainWindow):
def __init__(self):
super().__init__()
self.setWindowTitle("Custom Title Bar")
self.resize(400, 200)
self.setWindowFlags(Qt.WindowType.FramelessWindowHint)
central_widget = QWidget()
self.title_bar = CustomTitleBar(self)
work_space_layout = QVBoxLayout()
work_space_layout.setContentsMargins(11, 11, 11, 11)
work_space_layout.addWidget(QLabel("Hello, World!", self))
centra_widget_layout = QVBoxLayout()
centra_widget_layout.setContentsMargins(0, 0, 0, 0)
centra_widget_layout.setAlignment(Qt.AlignmentFlag.AlignTop)
centra_widget_layout.addWidget(self.title_bar)
centra_widget_layout.addLayout(work_space_layout)
central_widget.setLayout(centra_widget_layout)
self.setCentralWidget(central_widget)

if __name__ == "__main__":
app = QApplication([])
window = MainWindow()
window.show()
app.exec()
self.initUI()

def initUI(self):
self.menuBar = QMenuBar(self)
self.setMenuBar(self.menuBar)

# 创建一个菜单
menu = self.menuBar.addMenu('&文件')

# 创建一个动作(QAction),并设置其触发时执行的操作
openWebAction = QAction('打开网页', self)
openWebAction.triggered.connect(self.openWebPage)

# 将动作添加到菜单中
menu.addAction(openWebAction)

def openWebPage(self):
# 使用webbrowser模块打开默认浏览器并导航到指定网址
webbrowser.open('https://www.example.com')


if __name__ == '__main__':
app = QApplication(sys.argv)
mainWin = MainWindow()
mainWin.show()
sys.exit(app.exec())

0 comments on commit d9f8c80

Please sign in to comment.