Web Audio API实现音符流播放器的使用教程

需积分: 10 0 下载量 138 浏览量 更新于2024-11-08 收藏 4KB ZIP 举报
资源摘要信息:"note-player-stream:根据输入流使用 Web Audio API 播放不同的音符" 知识点详细说明: 1. Web Audio API概念: Web Audio API是浏览器提供的一个音频处理API,它允许开发者在网页中创建和处理音频内容,实现复杂的音频操作,例如音源生成、音频信号处理、音频空间化以及音频可视化等。相较于传统的HTML音频元素,Web Audio API提供了更为强大的音频合成和效果处理功能。 2. MIDI音符表示法: 在音乐领域,MIDI(Musical Instrument Digital Interface)是一种广泛使用的协议标准,用于音序器、硬件音源和其他音乐设备之间的通信。MIDI音符编号范围通常是0到127,代表从最低的C(MIDI编号0)到最高的G(MIDI编号127),这个范围覆盖了超过7个八度的音域。 3. 模块功能: 该note-player-stream模块的设计目的是利用Web Audio API根据输入流来播放不同的音符。输入流是一个包含特定对象的流,这些对象描述了音符的播放状态、MIDI编号以及振荡器的频率。模块支持任何能输出符合上述格式的对象流,使得它可以灵活地与其他音频处理系统集成。 4. 模块安装与使用: 用户可以通过npm(Node.js的包管理器)安装note-player-stream模块。安装指令为: ``` npm install --save note-player-stream ``` 安装完成后,用户需要通过require语句引入模块,例如: ``` var playerStream = require("note-player-stream"); ``` 接下来,根据模块提供的API,用户可以将符合格式的对象流传递给模块,从而实现音符的播放。 5. 输入流对象结构: 输入流对象包含以下属性: - pressed (Boolean): 表示按钮是否被按下,如果为true表示按下,false表示释放。 - note (Number): 一个整数,范围在0到127之间,代表MIDI音符编号。 - frequency (Number): 振荡器播放的频率(赫兹)。这个属性对于自定义节点来说是必需的,因为不同的音符对应不同的频率。 6. JavaScript编程语言: 模块使用JavaScript编写,这是一门广泛用于前端开发的脚本语言,是实现Web Audio API操作的主要语言。JavaScript具有事件驱动和基于原型的特性,其代码通常在浏览器端执行,也可以通过Node.js在服务器端执行。 7. 文件压缩包命名: 给定的信息中提到了一个压缩包文件的名称:"note-player-stream-master"。这表明模块的代码可能保存在一个名为“note-player-stream”的目录中,并且这个目录包含一个“master”分支,这可能指的是Git版本控制系统的主分支。 8. 模块兼容性: 虽然描述部分没有明确说明,但根据Web Audio API和npm模块的性质,可以推断该模块主要面向前端JavaScript开发者,并且需要在支持Web Audio API的现代浏览器环境中运行。同时,由于它是通过npm安装的,这意味着它主要面向Node.js环境,尽管此处的应用场景是在浏览器端。 总结上述内容,note-player-stream模块是一个基于Web Audio API和JavaScript编写的npm模块,旨在允许开发者通过接收特定格式的输入流来控制音频的播放。开发者可以通过npm安装这个模块,并通过简单的API调用实现各种音符的播放功能。这个模块适用于那些需要在网页中嵌入音频播放功能的应用场景,比如在线音乐教育工具、音频编辑器或者游戏应用等。

[root@QAQ ~]# sudo tail -n 50 /var/log/mysql/error.log 2023-07-14T02:45:21.370949Z 0 [Note] Shutting down plugin 'partition' 2023-07-14T02:45:21.370952Z 0 [Note] Shutting down plugin 'BLACKHOLE' 2023-07-14T02:45:21.370954Z 0 [Note] Shutting down plugin 'ARCHIVE' 2023-07-14T02:45:21.370956Z 0 [Note] Shutting down plugin 'PERFORMANCE_SCHEMA' 2023-07-14T02:45:21.370993Z 0 [Note] Shutting down plugin 'MRG_MYISAM' 2023-07-14T02:45:21.370995Z 0 [Note] Shutting down plugin 'MyISAM' 2023-07-14T02:45:21.371003Z 0 [Note] Shutting down plugin 'INNODB_SYS_VIRTUAL' 2023-07-14T02:45:21.371011Z 0 [Note] Shutting down plugin 'INNODB_SYS_DATAFILES' 2023-07-14T02:45:21.371013Z 0 [Note] Shutting down plugin 'INNODB_SYS_TABLESPACES' 2023-07-14T02:45:21.371015Z 0 [Note] Shutting down plugin 'INNODB_SYS_FOREIGN_COLS' 2023-07-14T02:45:21.371017Z 0 [Note] Shutting down plugin 'INNODB_SYS_FOREIGN' 2023-07-14T02:45:21.371018Z 0 [Note] Shutting down plugin 'INNODB_SYS_FIELDS' 2023-07-14T02:45:21.371020Z 0 [Note] Shutting down plugin 'INNODB_SYS_COLUMNS' 2023-07-14T02:45:21.371022Z 0 [Note] Shutting down plugin 'INNODB_SYS_INDEXES' 2023-07-14T02:45:21.371024Z 0 [Note] Shutting down plugin 'INNODB_SYS_TABLESTATS' 2023-07-14T02:45:21.371026Z 0 [Note] Shutting down plugin 'INNODB_SYS_TABLES' 2023-07-14T02:45:21.371028Z 0 [Note] Shutting down plugin 'INNODB_FT_INDEX_TABLE' 2023-07-14T02:45:21.371030Z 0 [Note] Shutting down plugin 'INNODB_FT_INDEX_CACHE' 2023-07-14T02:45:21.371032Z 0 [Note] Shutting down plugin 'INNODB_FT_CONFIG' 2023-07-14T02:45:21.371033Z 0 [Note] Shutting down plugin 'INNODB_FT_BEING_DELETED' 2023-07-14T02:45:21.371035Z 0 [Note] Shutting down plugin 'INNODB_FT_DELETED' 2023-07-14T02:45:21.371037Z 0 [Note] Shutting down plugin 'INNODB_FT_DEFAULT_STOPWORD' 2023-07-14T02:45:21.371039Z 0 [Note] Shutting down plugin 'INNODB_METRICS' 2023-07-14T02:45:21.371041Z 0 [Note] Shutting down plugin 'INNODB_TEMP_TABLE_INFO' 2023-07-14T02:45:21.371043Z 0 [Note] Shutting down plugin 'INNODB_BUFFER_POOL_STATS' 2023-07-14T02:45:21.371045Z 0 [Note] Shutting down plugin 'INNODB_BUFFER_PAGE_LRU' 2023-07-14T02:45:21.371047Z 0 [Note] Shutting down plugin 'INNODB_BUFFER_PAGE' 2023-07-14T02:45:21.371049Z 0 [Note] Shutting down plugin 'INNODB_CMP_PER_INDEX_RESET' 2023-07-14T02:45:21.371050Z 0 [Note] Shutting down plugin 'INNODB_CMP_PER_INDEX' 2023-07-14T02:45:21.371052Z 0 [Note] Shutting down plugin 'INNODB_CMPMEM_RESET' 2023-07-14T02:45:21.371054Z 0 [Note] Shutting down plugin 'INNODB_CMPMEM' 2023-07-14T02:45:21.371056Z 0 [Note] Shutting down plugin 'INNODB_CMP_RESET' 2023-07-14T02:45:21.371058Z 0 [Note] Shutting down plugin 'INNODB_CMP' 2023-07-14T02:45:21.371060Z 0 [Note] Shutting down plugin 'INNODB_LOCK_WAITS' 2023-07-14T02:45:21.371062Z 0 [Note] Shutting down plugin 'INNODB_LOCKS' 2023-07-14T02:45:21.371064Z 0 [Note] Shutting down plugin 'INNODB_TRX' 2023-07-14T02:45:21.371066Z 0 [Note] Shutting down plugin 'InnoDB' 2023-07-14T02:45:21.371100Z 0 [Note] InnoDB: FTS optimize thread exiting. 2023-07-14T02:45:21.371135Z 0 [Note] InnoDB: Starting shutdown... 2023-07-14T02:45:21.471280Z 0 [Note] InnoDB: Dumping buffer pool(s) to /www/server/data/ib_buffer_pool 2023-07-14T02:45:21.471421Z 0 [Note] InnoDB: Buffer pool(s) dump completed at 230714 10:45:21 2023-07-14T02:45:22.992635Z 0 [Note] InnoDB: Shutdown completed; log sequence number 2767468 2023-07-14T02:45:22.993964Z 0 [Note] InnoDB: Removed temporary tablespace data file: "ibtmp1" 2023-07-14T02:45:22.993980Z 0 [Note] Shutting down plugin 'MEMORY' 2023-07-14T02:45:22.993985Z 0 [Note] Shutting down plugin 'CSV' 2023-07-14T02:45:22.993989Z 0 [Note] Shutting down plugin 'sha256_password' 2023-07-14T02:45:22.993991Z 0 [Note] Shutting down plugin 'mysql_native_password' 2023-07-14T02:45:22.994103Z 0 [Note] Shutting down plugin 'binlog' 2023-07-14T02:45:22.994915Z 0 [Note] /www/server/mysql/bin/mysqld: Shutdown complete

2023-07-20 上传

[root@QAQ ~]# sudo tail -n 50 /var/log/mysql/error.log 2023-07-14T02:43:01.816556Z 0 [Note] Shutting down plugin 'partition' 2023-07-14T02:43:01.816558Z 0 [Note] Shutting down plugin 'BLACKHOLE' 2023-07-14T02:43:01.816566Z 0 [Note] Shutting down plugin 'ARCHIVE' 2023-07-14T02:43:01.816568Z 0 [Note] Shutting down plugin 'PERFORMANCE_SCHEMA' 2023-07-14T02:43:01.816594Z 0 [Note] Shutting down plugin 'MRG_MYISAM' 2023-07-14T02:43:01.816597Z 0 [Note] Shutting down plugin 'MyISAM' 2023-07-14T02:43:01.816605Z 0 [Note] Shutting down plugin 'INNODB_SYS_VIRTUAL' 2023-07-14T02:43:01.816608Z 0 [Note] Shutting down plugin 'INNODB_SYS_DATAFILES' 2023-07-14T02:43:01.816610Z 0 [Note] Shutting down plugin 'INNODB_SYS_TABLESPACES' 2023-07-14T02:43:01.816612Z 0 [Note] Shutting down plugin 'INNODB_SYS_FOREIGN_COLS' 2023-07-14T02:43:01.816614Z 0 [Note] Shutting down plugin 'INNODB_SYS_FOREIGN' 2023-07-14T02:43:01.816616Z 0 [Note] Shutting down plugin 'INNODB_SYS_FIELDS' 2023-07-14T02:43:01.816618Z 0 [Note] Shutting down plugin 'INNODB_SYS_COLUMNS' 2023-07-14T02:43:01.816620Z 0 [Note] Shutting down plugin 'INNODB_SYS_INDEXES' 2023-07-14T02:43:01.816622Z 0 [Note] Shutting down plugin 'INNODB_SYS_TABLESTATS' 2023-07-14T02:43:01.816624Z 0 [Note] Shutting down plugin 'INNODB_SYS_TABLES' 2023-07-14T02:43:01.816626Z 0 [Note] Shutting down plugin 'INNODB_FT_INDEX_TABLE' 2023-07-14T02:43:01.816628Z 0 [Note] Shutting down plugin 'INNODB_FT_INDEX_CACHE' 2023-07-14T02:43:01.816630Z 0 [Note] Shutting down plugin 'INNODB_FT_CONFIG' 2023-07-14T02:43:01.816632Z 0 [Note] Shutting down plugin 'INNODB_FT_BEING_DELETED' 2023-07-14T02:43:01.816634Z 0 [Note] Shutting down plugin 'INNODB_FT_DELETED' 2023-07-14T02:43:01.816636Z 0 [Note] Shutting down plugin 'INNODB_FT_DEFAULT_STOPWORD' 2023-07-14T02:43:01.816638Z 0 [Note] Shutting down plugin 'INNODB_METRICS' 2023-07-14T02:43:01.816640Z 0 [Note] Shutting down plugin 'INNODB_TEMP_TABLE_INFO' 2023-07-14T02:43:01.816642Z 0 [Note] Shutting down plugin 'INNODB_BUFFER_POOL_STATS' 2023-07-14T02:43:01.816644Z 0 [Note] Shutting down plugin 'INNODB_BUFFER_PAGE_LRU' 2023-07-14T02:43:01.816645Z 0 [Note] Shutting down plugin 'INNODB_BUFFER_PAGE' 2023-07-14T02:43:01.816647Z 0 [Note] Shutting down plugin 'INNODB_CMP_PER_INDEX_RESET' 2023-07-14T02:43:01.816649Z 0 [Note] Shutting down plugin 'INNODB_CMP_PER_INDEX' 2023-07-14T02:43:01.816651Z 0 [Note] Shutting down plugin 'INNODB_CMPMEM_RESET' 2023-07-14T02:43:01.816653Z 0 [Note] Shutting down plugin 'INNODB_CMPMEM' 2023-07-14T02:43:01.816655Z 0 [Note] Shutting down plugin 'INNODB_CMP_RESET' 2023-07-14T02:43:01.816657Z 0 [Note] Shutting down plugin 'INNODB_CMP' 2023-07-14T02:43:01.816659Z 0 [Note] Shutting down plugin 'INNODB_LOCK_WAITS' 2023-07-14T02:43:01.816661Z 0 [Note] Shutting down plugin 'INNODB_LOCKS' 2023-07-14T02:43:01.816664Z 0 [Note] Shutting down plugin 'INNODB_TRX' 2023-07-14T02:43:01.816666Z 0 [Note] Shutting down plugin 'InnoDB' 2023-07-14T02:43:01.816703Z 0 [Note] InnoDB: FTS optimize thread exiting. 2023-07-14T02:43:01.816748Z 0 [Note] InnoDB: Starting shutdown... 2023-07-14T02:43:01.916861Z 0 [Note] InnoDB: Dumping buffer pool(s) to /www/server/data/ib_buffer_pool 2023-07-14T02:43:01.917024Z 0 [Note] InnoDB: Buffer pool(s) dump completed at 230714 10:43:01 2023-07-14T02:43:03.438469Z 0 [Note] InnoDB: Shutdown completed; log sequence number 2767449 2023-07-14T02:43:03.439797Z 0 [Note] InnoDB: Removed temporary tablespace data file: "ibtmp1" 2023-07-14T02:43:03.439814Z 0 [Note] Shutting down plugin 'MEMORY' 2023-07-14T02:43:03.439819Z 0 [Note] Shutting down plugin 'CSV' 2023-07-14T02:43:03.439823Z 0 [Note] Shutting down plugin 'sha256_password' 2023-07-14T02:43:03.439825Z 0 [Note] Shutting down plugin 'mysql_native_password' 2023-07-14T02:43:03.439939Z 0 [Note] Shutting down plugin 'binlog' 2023-07-14T02:43:03.440752Z 0 [Note] /www/server/mysql/bin/mysqld: Shutdown complete

2023-07-15 上传

2023-06-08T02:25:37.583259Z 1 [Note] WSREP: GCache history reset: 00000000-0000-0000-0000-000000000000:0 -> c443b2d8-05a0-11ee-86b8-2e0fddf21737:0 2023-06-08T02:25:39.261528Z WSREP_SST: [INFO] Streaming with xbstream 2023-06-08T02:25:39.273174Z WSREP_SST: [INFO] WARNING: Stale temporary SST directory: /data/mysql//.sst from previous state transfer. Removing 2023-06-08T02:25:39.279749Z WSREP_SST: [INFO] Proceeding with SST......... 2023-06-08T02:25:39.519583Z 0 [Note] WSREP: (c05c7a4e, 'tcp://0.0.0.0:4567') turning message relay requesting off 2023-06-08T02:25:39.553817Z WSREP_SST: [INFO] ............Waiting for SST streaming to complete! 2023-06-08T02:25:49.257301Z WSREP_SST: [ERROR] ******************* FATAL ERROR ********************** 2023-06-08T02:25:49.260159Z WSREP_SST: [ERROR] xtrabackup_checkpoints missing. xtrabackup/SST failed on DONOR. Check DONOR log 2023-06-08T02:25:49.262811Z WSREP_SST: [ERROR] ****************************************************** 2023-06-08T02:25:49.266472Z WSREP_SST: [ERROR] Cleanup after exit with status:2 2023-06-08T02:25:49.289335Z 0 [Warning] WSREP: 1.0 (host78): State transfer to 0.0 (host79) failed: -22 (Invalid argument) 2023-06-08T02:25:49.289400Z 0 [ERROR] WSREP: gcs/src/gcs_group.cpp:gcs_group_handle_join_msg():811: Will never receive state. Need to abort. 2023-06-08T02:25:49.289465Z 0 [Note] WSREP: gcomm: terminating thread 2023-06-08T02:25:49.289494Z 0 [Note] WSREP: gcomm: joining thread 2023-06-08T02:25:49.289662Z 0 [Note] WSREP: gcomm: closing backend 2023-06-08T02:25:49.593055Z 0 [ERROR] WSREP: Process completed with error: wsrep_sst_xtrabackup-v2 --role 'joiner' --address '10.106.113.79' --datadir '/data/mysql/' --defaults-file '/etc/my.cnf' --defaults-group-suffix '' --parent '9996' --mysqld-version '5.7.41-44-57' '' : 2 (No such file or directory) 2023-06-08T02:25:49.593124Z 0 [ERROR] WSREP: Failed to read uuid:seqno from joiner script. 2023-06-08T02:25:49.593137Z 0 [ERROR] WSREP: SST script aborted with error 2 (No such file or directory) 2023-06-08T02:25:49.593186Z 0 [ERROR] WSREP: SST failed: 2 (No such file or directory) 2023-06-08T02:25:49.593234Z 0 [ERROR] Aborting 2023-06-08T02:25:49.593269Z 0 [Note] WSREP: Signalling cancellation of the SST request. 2023-06-08T02:25:49.593306Z 0 [Note] WSREP: SST request was cancelled 2023-06-08T02:25:49.593337Z 0 [Note] Giving 2 client threads a chance to die gracefully 2023-06-08T02:25:49.593357Z 1 [Note] WSREP: Closing send monitor... 2023-06-08T02:25:49.593370Z 1 [Note] WSREP: Closed send monitor. 2023-06-08T02:25:50.292465Z 0 [Note] WSREP: Current view of cluster as seen by this node

2023-06-09 上传