【已解决】使用pyaudio内录声卡声音及相关问题

news2024/10/6 4:05:15

使用pyaudio内录声卡声音及相关问题解决

目录

  • 使用pyaudio内录声卡声音及相关问题解决
    • 1 实现代码
      • 1.1 Recorder类:
      • 1.2 调用方法
    • 2 问题一:选择设备实现内录/外录(解决报错:OSError: [Errno -9999] Unanticipated host error)
    • 3 问题二:运行内录代码时,必须要扬声器外放才能录到声音,插入耳机则没有声音

1 实现代码

主要参考:https://blog.csdn.net/littlezhuhui/article/details/101025305
使用上述连接中的Recorder类可以在其他声音生成程序中同步开启一个线程,并同步记录声音,自由控制录音时间

1.1 Recorder类:

import os
import pyaudio
import threading
import wave
import time
from datetime import datetime

#录音类 
class Recorder():
    def __init__(self, chunk=1024, channels=2, rate=44100):
        self.CHUNK = chunk
        self.FORMAT = pyaudio.paInt16
        self.CHANNELS = channels
        self.RATE = rate
        self._running = True
        self._frames = []

    #获取内录设备序号,在windows操作系统上测试通过,hostAPI = 0 表明是MME设备
    def findInternalRecordingDevice(self,p):
        #要找查的设备名称中的关键字
        target = '立体声混音'
        #逐一查找声音设备  
        for i in range(p.get_device_count()):
            devInfo = p.get_device_info_by_index(i)   
            if devInfo['name'].find(target)>=0 and devInfo['hostApi'] == 0 :      
                #print('已找到内录设备,序号是 ',i)
                return i
        print('无法找到内录设备!')
        return -1

    #开始录音,开启一个新线程进行录音操作
    def start(self):
        threading._start_new_thread(self.__record, ())

    #执行录音的线程函数
    def __record(self):
        self._running = True
        self._frames = []

        p = pyaudio.PyAudio()
        #查找内录设备
        dev_idx = self.findInternalRecordingDevice(p)
        if dev_idx < 0 :            
            return
        #在打开输入流时指定输入设备
        stream = p.open(input_device_index=dev_idx,
                        format=self.FORMAT,
                        channels=self.CHANNELS,
                        rate=self.RATE,
                        input=True,
                        frames_per_buffer=self.CHUNK)
        #循环读取输入流
        while(self._running):
            data = stream.read(self.CHUNK)
            self._frames.append(data)

        #停止读取输入流  
        stream.stop_stream()
        #关闭输入流
        stream.close()
        #结束pyaudio
        p.terminate()
        return
 
    #停止录音
    def stop(self):
        self._running = False
 
    #保存到文件
    def save(self, fileName):   
        #创建pyAudio对象
        p = pyaudio.PyAudio()
        #打开用于保存数据的文件
        wf = wave.open(fileName, 'wb')
        #设置音频参数
        wf.setnchannels(self.CHANNELS)
        wf.setsampwidth(p.get_sample_size(self.FORMAT))
        wf.setframerate(self.RATE)
        #写入数据
        wf.writeframes(b''.join(self._frames))
        #关闭文件
        wf.close()
        #结束pyaudio
        p.terminate()

1.2 调用方法

import Recorder # 建议新建文件做成一个模块

# 建立录音对象
rec = Recorder()
rec.start()

# 运行生成产生程序
	# 可以是播放某个视频的指令,也可以是生成声音的代码
	
# 停止录音,保存文件
rec.stop()
rec.save("output.wav")

2 问题一:选择设备实现内录/外录(解决报错:OSError: [Errno -9999] Unanticipated host error)

上述代码中选择录音设备对象的代码为:

    #获取内录设备序号,在windows操作系统上测试通过,hostAPI = 0 表明是MME设备
    def findInternalRecordingDevice(self,p):
        #要找查的设备名称中的关键字
        target = '立体声混音'
        #逐一查找声音设备  
        for i in range(p.get_device_count()):
            devInfo = p.get_device_info_by_index(i)   
            if devInfo['name'].find(target)>=0 and devInfo['hostApi'] == 0 :      
                #print('已找到内录设备,序号是 ',i)
                return i
        print('无法找到内录设备!')
        return -1

如果出现报错OSError: [Errno -9999] Unanticipated host error,可以先单独新建文件夹,运行一下代码,打印当前电脑的所有设备号:

import pyaudio

audio = pyaudio.PyAudio()

# get device count
device_count = audio.get_device_count()
print(f"device count: {device_count}")

# get device info
for i in range(device_count):
    device_info = audio.get_device_info_by_index(i)
    print(f"device {i}: {device_info}")

我的电脑打印信息如下

device count: 31
device 0: {'index': 0, 'structVersion': 2, 'name': 'Microsoft 声音映射器 - Input', 'hostApi': 0, 'maxInputChannels': 2, 'maxOutputChannels': 0, 'defaultLowInputLatency': 0.09, 'defaultLowOutputLatency': 0.09, 'defaultHighInputLatency': 0.18, 'defaultHighOutputLatency': 0.18, 'defaultSampleRate': 44100.0}
device 1: {'index': 1, 'structVersion': 2, 'name': '麦克风 (Realtek(R) Audio)', 'hostApi': 0, 'maxInputChannels': 2, 'maxOutputChannels': 0, 'defaultLowInputLatency': 0.09, 'defaultLowOutputLatency': 0.09, 'defaultHighInputLatency': 0.18, 'defaultHighOutputLatency': 0.18, 'defaultSampleRate': 44100.0}
device 2: {'index': 2, 'structVersion': 2, 'name': 'Microsoft 声音映射器 - Output', 'hostApi': 0, 'maxInputChannels': 0, 'maxOutputChannels': 2, 'defaultLowInputLatency': 0.09, 'defaultLowOutputLatency': 0.09, 'defaultHighInputLatency': 0.18, 'defaultHighOutputLatency': 0.18, 'defaultSampleRate': 44100.0}
device 3: {'index': 3, 'structVersion': 2, 'name': '扬声器 (Realtek(R) Audio)', 'hostApi': 0, 'maxInputChannels': 0, 'maxOutputChannels': 2, 'defaultLowInputLatency': 0.09, 'defaultLowOutputLatency': 0.09, 'defaultHighInputLatency': 0.18, 'defaultHighOutputLatency': 0.18, 'defaultSampleRate': 44100.0}
device 4: {'index': 4, 'structVersion': 2, 'name': 'PHL 245S1 (NVIDIA High Definiti', 'hostApi': 0, 'maxInputChannels': 0, 'maxOutputChannels': 2, 'defaultLowInputLatency': 0.09, 'defaultLowOutputLatency': 0.09, 'defaultHighInputLatency': 0.18, 'defaultHighOutputLatency': 0.18, 'defaultSampleRate': 44100.0}
device 5: {'index': 5, 'structVersion': 2, 'name': 'LG HDR 4K (NVIDIA High Definiti', 'hostApi': 0, 'maxInputChannels': 0, 'maxOutputChannels': 2, 'defaultLowInputLatency': 0.09, 'defaultLowOutputLatency': 0.09, 'defaultHighInputLatency': 0.18, 'defaultHighOutputLatency': 0.18, 'defaultSampleRate': 44100.0}
device 6: {'index': 6, 'structVersion': 2, 'name': '主声音捕获驱动程序', 'hostApi': 1, 'maxInputChannels': 2, 'maxOutputChannels': 0, 'defaultLowInputLatency': 0.12, 'defaultLowOutputLatency': 0.0, 'defaultHighInputLatency': 0.24, 'defaultHighOutputLatency': 0.0, 'defaultSampleRate': 44100.0}
device 7: {'index': 7, 'structVersion': 2, 'name': '麦克风 (Realtek(R) Audio)', 'hostApi': 1, 'maxInputChannels': 2, 'maxOutputChannels': 0, 'defaultLowInputLatency': 0.12, 'defaultLowOutputLatency': 0.0, 'defaultHighInputLatency': 0.24, 'defaultHighOutputLatency': 0.0, 'defaultSampleRate': 44100.0}
device 8: {'index': 8, 'structVersion': 2, 'name': '主声音驱动程序', 'hostApi': 1, 'maxInputChannels': 0, 'maxOutputChannels': 2, 'defaultLowInputLatency': 0.0, 'defaultLowOutputLatency': 0.12, 'defaultHighInputLatency': 0.0, 'defaultHighOutputLatency': 0.24, 'defaultSampleRate': 44100.0}
device 9: {'index': 9, 'structVersion': 2, 'name': '扬声器 (Realtek(R) Audio)', 'hostApi': 1, 'maxInputChannels': 0, 'maxOutputChannels': 2, 'defaultLowInputLatency': 0.0, 'defaultLowOutputLatency': 0.12, 'defaultHighInputLatency': 0.0, 'defaultHighOutputLatency': 0.24, 'defaultSampleRate': 44100.0}
device 10: {'index': 10, 'structVersion': 2, 'name': 'PHL 245S1 (NVIDIA High Definition Audio)', 'hostApi': 1, 'maxInputChannels': 0, 'maxOutputChannels': 2, 'defaultLowInputLatency': 0.0, 'defaultLowOutputLatency': 0.12, 'defaultHighInputLatency': 0.0, 'defaultHighOutputLatency': 0.24, 'defaultSampleRate': 44100.0}
device 11: {'index': 11, 'structVersion': 2, 'name': 'LG HDR 4K (NVIDIA High Definition Audio)', 'hostApi': 1, 'maxInputChannels': 0, 'maxOutputChannels': 2, 'defaultLowInputLatency': 0.0, 'defaultLowOutputLatency': 0.12, 'defaultHighInputLatency': 0.0, 'defaultHighOutputLatency': 0.24, 'defaultSampleRate': 44100.0}
device 12: {'index': 12, 'structVersion': 2, 'name': 'PHL 245S1 (NVIDIA High Definition Audio)', 'hostApi': 2, 'maxInputChannels': 0, 'maxOutputChannels': 2, 'defaultLowInputLatency': 0.0, 'defaultLowOutputLatency': 0.003, 'defaultHighInputLatency': 0.0, 'defaultHighOutputLatency': 0.01, 'defaultSampleRate': 48000.0}
device 13: {'index': 13, 'structVersion': 2, 'name': '扬声器 (Realtek(R) Audio)', 'hostApi': 2, 'maxInputChannels': 0, 'maxOutputChannels': 2, 'defaultLowInputLatency': 0.0, 'defaultLowOutputLatency': 0.003, 'defaultHighInputLatency': 0.0, 'defaultHighOutputLatency': 0.0106667, 'defaultSampleRate': 48000.0}
device 14: {'index': 14, 'structVersion': 2, 'name': 'LG HDR 4K (NVIDIA High Definition Audio)', 'hostApi': 2, 'maxInputChannels': 0, 'maxOutputChannels': 2, 'defaultLowInputLatency': 0.0, 'defaultLowOutputLatency': 0.003, 'defaultHighInputLatency': 0.0, 'defaultHighOutputLatency': 0.01, 'defaultSampleRate': 48000.0}
device 15: {'index': 15, 'structVersion': 2, 'name': '麦克风 (Realtek(R) Audio)', 'hostApi': 2, 'maxInputChannels': 2, 'maxOutputChannels': 0, 'defaultLowInputLatency': 0.003, 'defaultLowOutputLatency': 0.0, 'defaultHighInputLatency': 0.01, 'defaultHighOutputLatency': 0.0, 'defaultSampleRate': 48000.0}
device 16: {'index': 16, 'structVersion': 2, 'name': '麦克风 (Realtek HD Audio Mic input)', 'hostApi': 3, 'maxInputChannels': 2, 'maxOutputChannels': 0, 'defaultLowInputLatency': 0.01, 'defaultLowOutputLatency': 0.01, 'defaultHighInputLatency': 0.04, 'defaultHighOutputLatency': 0.04, 'defaultSampleRate': 44100.0}
device 17: {'index': 17, 'structVersion': 2, 'name': 'Speakers 1 (Realtek HD Audio output with HAP)', 'hostApi': 3, 'maxInputChannels': 0, 'maxOutputChannels': 2, 'defaultLowInputLatency': 0.01, 'defaultLowOutputLatency': 0.01, 'defaultHighInputLatency': 0.04, 'defaultHighOutputLatency': 0.04, 'defaultSampleRate': 48000.0}      
device 18: {'index': 18, 'structVersion': 2, 'name': 'Speakers 2 (Realtek HD Audio output with HAP)', 'hostApi': 3, 'maxInputChannels': 0, 'maxOutputChannels': 2, 'defaultLowInputLatency': 0.01, 'defaultLowOutputLatency': 0.01, 'defaultHighInputLatency': 0.04, 'defaultHighOutputLatency': 0.04, 'defaultSampleRate': 44100.0}      
device 19: {'index': 19, 'structVersion': 2, 'name': '电脑扬声器 (Realtek HD Audio output with HAP)', 'hostApi': 3, 'maxInputChannels': 2, 'maxOutputChannels': 0, 'defaultLowInputLatency': 0.01, 'defaultLowOutputLatency': 0.01, 'defaultHighInputLatency': 0.04, 'defaultHighOutputLatency': 0.04, 'defaultSampleRate': 48000.0}      
device 20: {'index': 20, 'structVersion': 2, 'name': '立体声混音 (Realtek HD Audio Stereo input)', 'hostApi': 3, 'maxInputChannels': 2, 'maxOutputChannels': 0, 'defaultLowInputLatency': 0.01, 'defaultLowOutputLatency': 0.01, 'defaultHighInputLatency': 0.04, 'defaultHighOutputLatency': 0.04, 'defaultSampleRate': 48000.0}
device 21: {'index': 21, 'structVersion': 2, 'name': 'Output (NVIDIA High Definition Audio)', 'hostApi': 3, 'maxInputChannels': 0, 'maxOutputChannels': 2, 'defaultLowInputLatency': 0.01, 'defaultLowOutputLatency': 0.01, 'defaultHighInputLatency': 0.04, 'defaultHighOutputLatency': 0.04, 'defaultSampleRate': 48000.0}
device 22: {'index': 22, 'structVersion': 2, 'name': 'Output (NVIDIA High Definition Audio)', 'hostApi': 3, 'maxInputChannels': 0, 'maxOutputChannels': 2, 'defaultLowInputLatency': 0.01, 'defaultLowOutputLatency': 0.01, 'defaultHighInputLatency': 0.04, 'defaultHighOutputLatency': 0.04, 'defaultSampleRate': 48000.0}

因为我的笔记本外界了显示器,显示器有音频输入输出功能,所以设备比较多,当我们想要实现内录,即录制电脑声卡产生的声音时,应该用的时上表中的第20个设备,“立体声混音”。可以看到用第一部分的代码是可以找到该设备的,但是这里的hostApi为3(不是代码中的0),强行修改代码使代码能运行后,依然会出现报错:OSError: [Errno -9999] Unanticipated host error

问题原因:电脑中的立体声混音的权限没有开启
解决办法:电脑设置-系统-声音-所有声音设备-立体声混音-允许
下图是权限开启后的界面:
在这里插入图片描述
此时再次运行设备打印代码,结果如下:

device count: 34
device 0: {'index': 0, 'structVersion': 2, 'name': 'Microsoft 声音映射器 - Input', 'hostApi': 0, 'maxInputChannels': 2, 'maxOutputChannels': 0, 'defaultLowInputLatency': 0.09, 'defaultLowOutputLatency': 0.09, 'defaultHighInputLatency': 0.18, 'defaultHighOutputLatency': 0.18, 'defaultSampleRate': 44100.0}
device 1: {'index': 1, 'structVersion': 2, 'name': '立体声混音 (Realtek(R) Audio)', 'hostApi': 0, 'maxInputChannels': 2, 'maxOutputChannels': 0, 'defaultLowInputLatency': 0.09, 'defaultLowOutputLatency': 0.09, 'defaultHighInputLatency': 0.18, 'defaultHighOutputLatency': 0.18, 'defaultSampleRate': 44100.0}
device 2: {'index': 2, 'structVersion': 2, 'name': '麦克风 (Realtek(R) Audio)', 'hostApi': 0, 'maxInputChannels': 2, 'maxOutputChannels': 0, 'defaultLowInputLatency': 0.09, 'defaultLowOutputLatency': 0.09, 'defaultHighInputLatency': 0.18, 'defaultHighOutputLatency': 0.18, 'defaultSampleRate': 44100.0}
device 3: {'index': 3, 'structVersion': 2, 'name': 'Microsoft 声音映射器 - Output', 'hostApi': 0, 'maxInputChannels': 0, 'maxOutputChannels': 2, 'defaultLowInputLatency': 0.09, 'defaultLowOutputLatency': 0.09, 'defaultHighInputLatency': 0.18, 'defaultHighOutputLatency': 0.18, 'defaultSampleRate': 44100.0}
device 4: {'index': 4, 'structVersion': 2, 'name': '扬声器 (Realtek(R) Audio)', 'hostApi': 0, 'maxInputChannels': 0, 'maxOutputChannels': 2, 'defaultLowInputLatency': 0.09, 'defaultLowOutputLatency': 0.09, 'defaultHighInputLatency': 0.18, 'defaultHighOutputLatency': 0.18, 'defaultSampleRate': 44100.0}

后面设备很多不再列举,可以看到此时device1立体声混音的hostApi已经变成了0,此时运行内录代码就不会再报错

3 问题二:运行内录代码时,必须要扬声器外放才能录到声音,插入耳机则没有声音

解决办法
电脑开始界面搜索
在这里插入图片描述

打开后选择“设备高级设置”
在这里插入图片描述
选择“经典模式”
在这里插入图片描述
重启计算机之后解决

上述设置之后插着耳机就不能再选择用电脑的扬声器播放了,只能拔了二级才能外放。但是此时插着耳机内录是可以录到声音的。

本文来自互联网用户投稿,该文观点仅代表作者本人,不代表本站立场。本站仅提供信息存储空间服务,不拥有所有权,不承担相关法律责任。如若转载,请注明出处:http://www.coloradmin.cn/o/716753.html

如若内容造成侵权/违法违规/事实不符,请联系多彩编程网进行投诉反馈,一经查实,立即删除!

相关文章

Vue Vite Manual

create project 初始化项目 $ npm create vitelatest导入vs code 方便操作 初始化的目录如下 安装依赖库 生成node_modules依赖库 和 package-lock.json. 其中package-lock.json用于锁定模块的版本号。 npm install启动项目 npm run dev项目配置 增加路由器 路由器 n…

骑行,究竟该不该佩戴护膝?应该怎么佩戴护膝才有效果?

骑行作为一项受欢迎的运动方式&#xff0c;在现代社会中越来越受到关注和热爱。随着骑行爱好者的增多&#xff0c;对于个人保护意识的重视也在逐渐提高。在这个话题中&#xff0c;一个备受关注的问题就是骑行时是否有必要戴护膝&#xff0c;以及如何正确佩戴护膝。 对于骑行爱好…

SAP生产版本和工艺路线由于批量不一致导致的报错问题解决实例

近期接到工艺用户问题&#xff0c;在维护生产版本时报错&#xff0c;状态异常&#xff0c;寻求支持。 在详细的提示信息中有一个生产版本不一致的提示&#xff0c;但不知这里的不一致具体指向什么&#xff0c;从逻辑上来推&#xff0c;这里只有一个可能&#xff0c;就是工艺路线…

windows 和华为手机使用charles抓包记录

1.下载charles 建议安装使用最新版&#xff0c;官方下载地址 https://www.charlesproxy.com/download help->Register->把上面的生成注册码放进去就行了&#xff08;在charles注册地址里面注册一下&#xff0c;charles注册地址&#xff09; 2.Proxy-> 勾选window…

网络安全(黑客)技术学习路线

谈起黑客&#xff0c;可能各位都会想到&#xff1a;盗号&#xff0c;其实不尽然&#xff1b;黑客是一群喜爱研究技术的群体&#xff0c;在黑客圈中&#xff0c;一般分为三大圈&#xff1a;娱乐圈 技术圈 职业圈。 娱乐圈&#xff1a;主要是初中生和高中生较多&#xff0c;玩网恋…

npm 安装私库包报错:请求地址错误 | 请求包错误

npm 安装私库包报错&#xff1a;请求地址错误 | 请求包错误 错误信息试错过程解决办法 在一次创建完 npm 私库之后&#xff0c;上传 npm 包没问题&#xff0c;但是下载一直出错。 老是请求一个旧的地址下载某个库&#xff0c;而那个地址已经停用了&#xff0c;因此请求很多次之…

在Layout里面创建封装如何快速切换单位

公制亦称“米制”、“米突制”。1858年《中法通商章程》签定后传入中国的一种国际度量衡制度。创始于法国。在PCB中单位为MM&#xff08;毫米&#xff09; 英制&#xff1a;英国、美国等英语国家使用的一种度量制。长度主单位为英尺&#xff0c;重量主单位为磅&#xff0c;容积…

Spring学习(三)(类注解和方法注解)

目录 1. 存储Bean对象 1.1 配置扫描路径 1.2 添加注解存储Bean对象 1.2.1 Controller(控制器存储) 1.2.2 Service&#xff08;服务存储&#xff09; 1.3 这么多注解&#xff1f;&#xff1f;&#xff1f;为什么&#xff1f;&#xff1f; 1.3.1 类注解时间的关系 1.4 方法…

leetcode:种花问题

种花问题 假设有一个很长的花坛&#xff0c;一部分地块种植了花&#xff0c;另一部分却没有。可是&#xff0c;花不能种植在相邻的地块上&#xff0c;它们会争夺水源&#xff0c;两者都会死去。 给你一个整数数组 flowerbed 表示花坛&#xff0c;由若干 0 和 1 组成&#xff0c…

Go语言网络编程:TCP粘包问题——Go实现封包拆包

一&#xff1a;TCP粘包介绍 1.1 TCP介绍 如上图&#xff0c;TCP具有面向连接、可靠、基于字节流三大特点。 字节流可以理解为一个双向的通道里流淌的数据&#xff0c;这个数据其实就是我们常说的二进制数据&#xff0c;简单来说就是一大堆 01 串。纯裸TCP收发的这些 01 串之间…

对弈人工智能!myCobot 280开源六轴机械臂Connect 4 四子棋对弈下篇

前言 在上篇文章中&#xff0c;我们探讨了如何创造一个能够进行Connect4的对弈大脑。简单的介绍了几种对弈算法&#xff0c;例如极小化极大算法&#xff0c;Alpha-Beta剪枝算法等&#xff0c;最关键的是目前最流行的神经网络算法和深度学习。神经网络算法&#xff0c;让计算机…

Dubbo zookeeper

1、RPC全称为remote procedure call&#xff0c;即远程过程调用。Dubbo作为一个RPC框架,其最核心的功能就是要实现跨网络的远程调用 2、Dubbo提供了三大核心能力&#xff1a;面向接口的远程方法调用&#xff0c;智能容错和负载均衡&#xff0c;以及服务自动注册和发现。 3、 Du…

Google SEO内容指南:您实现最大自然流量的路线图

欢迎来到令人兴奋的SEO内容世界&#xff01; SEO就像拥有一个秘方&#xff0c;结合了创造力、策略和技术诀窍的正确成分&#xff0c;使您的内容在广阔的数字环境中大放异彩。 但最好的是 – SEO内容并不是要牺牲您独特的声调或损害您的创造力。相反&#xff0c;它是关于了解搜…

从0开始,手写MySQL数据管理器DM

说在前面 从0开始&#xff0c;手写一个MySQL的学习价值在于&#xff1a; 可以深入地理解MySQL的内部机制和原理&#xff0c;MySQL可谓是面试的绝对重点和难点&#xff0c; 尼恩曾经指导过的一个7年经验小伙&#xff0c;凭借精通MySQL 搞定月薪40K。 从而更好地掌握MySQL的使…

六、Eureka服务发现(源码分析)

1 什么是服务发现 根据服务名称发现服务的实例过程客户端会在本地缓存服务端的列表拉取列表是有间隔周期的 &#xff08;导致服务上线 客户端不能第一时间感知到 &#xff08;可以容忍&#xff09;&#xff09;其实每次做服务发现 都是从本地的列表来进行的 2 测试服务发现 …

哆啦A梦和小猪佩奇(Python实现)

目录 1 哆啦A梦 2 小猪佩奇 3 Python代码实现&#xff08;哆啦A梦&#xff09; ​ 4 Python代码实现&#xff08;小猪佩奇 &#xff09; 1 哆啦A梦 “只要把愿望系在竹竿上请求月亮女神&#xff0c;心愿便能达成”。我超喜欢这句话。 哆啦A梦的创造要追溯到1969年的某个…

【PHP语言-PDO接口】PDO接口执行脚本操作数据库

目录 前言&#xff1a; 一、 PDO简介 二、 PDO对象方法 前言&#xff1a; PDO&#xff1a;数据库抽象层 简介&#xff1a;PDO扩展为PHP访问数据库定义了一个轻量级的、一致性的接口&#xff0c;PDO解决了数据库连接不统一的问题。 一、 PDO简介 1、PDO简介 &#xff08;1…

iview 文档中的三个提示彩蛋

第一个彩蛋 在iview的Collapse 折叠面板最底下&#xff0c;简洁模式的第二个&#xff0c;双击数字 19840124 是一个日期&#xff0c;也就是 1984 年 1 月 24 日&#xff0c;这一天&#xff0c;苹果发布了麦金塔电脑&#xff08;Macintosh&#xff09;&#xff0c;对于苹果来说…

当量因子法、InVEST、SolVES模型等多技术融合在生态系统服务功能社会价值评估中的应用

第一章 理论基础与研究热点分析 1. 生态系统服务与生态系统服务价值介绍 ​ 2. 生态系统服务价值研究方法 3. 生态系统服务价值研究热点 Citespace文献可视化分析 VOSviewer文献可视化分析 第二章 空间数据来源及预处理 1. 空间数据简介 2. ArcGIS Pro数据采集与分析 数…

【Python】matplotlib.pyplot 详解与使用(内有大量例子)

0. 写在前面 本文是根据 matplotlib 3.7.1 版本撰写的&#xff0c;若出现有文章与实际有出入的情况请查看版本是否一致。 我们使用 matplotlib.pyplot 需要使用以下的语句来导入它 import matplotlib as mpl import matplotlib.pyplot as plt import numpy as np1. 官方文档详…