xavieryang / check_wav_format.py
0 likes
0 forks
1 files
Last active
1 | import wave |
2 | import sys |
3 | |
4 | # Open the WAV file |
5 | file_path = sys.argv[1] |
6 | with wave.open(file_path, 'rb') as wav_file: |
7 | # Get audio parameters |
8 | channels = wav_file.getnchannels() # Number of channels (1=mono, 2=stereo) |
9 | sample_width = wav_file.getsampwidth() # Sample width in bytes |
10 | frame_rate = wav_file.getframerate() # Sampling frequency (Hz) |
xavieryang / scroll_to_top.js
0 likes
0 forks
1 files
Last active
1 | // 创建按钮 |
2 | const backToTopBtn = document.createElement('button'); |
3 | backToTopBtn.innerText = '↑'; |
4 | backToTopBtn.style.position = 'fixed'; |
5 | backToTopBtn.style.bottom = '20px'; |
6 | backToTopBtn.style.right = '20px'; |
7 | backToTopBtn.style.padding = '10px 15px'; |
8 | backToTopBtn.style.backgroundColor = '#007bff'; |
9 | backToTopBtn.style.color = 'white'; |
10 | backToTopBtn.style.border = 'none'; |
xavieryang / remove_unused_ufw_rules.sh
0 likes
0 forks
1 files
Last active
1 | #!/bin/bash |
2 | # 获取所有已允许的 UFW 端口 |
3 | allowed_ports=$(sudo ufw status | grep -oP '^\d+') |
4 | |
5 | for port in $allowed_ports; do |
6 | # 检查端口是否在监听 |
7 | if ! sudo ss -tuln | grep -q ":$port\s"; then |
8 | echo "Port $port is not in use. Removing allow rule..." |
9 | sudo ufw delete allow "$port" |
10 | else |
xavieryang / activeChoiceJenkins.groovy
0 likes
0 forks
1 files
Last active
1 | // Parameterize agent label |
2 | if (params.containsKey('AGENT_LABEL')) { |
3 | AGENT_LABEL = "$params.AGENT_LABEL" |
4 | } |
5 | pipeline { |
6 | agent { label "${AGENT_LABEL}" } |
7 | parameters { |
8 | string(name: 'AGENT_LABEL', defaultValue: 'labelA') |
9 | } |
10 | } |
xavieryang / check_audio_device_id.py
0 likes
0 forks
1 files
Last active
1 | import pyaudio |
2 | |
3 | def list_audio_devices(): |
4 | p = pyaudio.PyAudio() |
5 | |
6 | print("Available audio devices:") |
7 | for i in range(p.get_device_count()): |
8 | device_info = p.get_device_info_by_index(i) |
9 | # 只打印输出设备 |
10 | if device_info['maxOutputChannels'] > 0: |
Newer
Older