unity本地录音并保存本地源码项目 支持pc和Android端

上传者: DYFdingyifei | 上传时间: 2024-12-01 10:53:00 | 文件大小: 31.4MB | 文件类型: RAR
Unity是一款强大的跨平台游戏开发引擎,它支持创建2D、3D、VR和AR等多种类型的游戏。在本项目中,我们关注的是Unity的本地录音功能,这是一个非常实用的特性,可以用于游戏内的语音对话、语音识别或者玩家之间的语音交流等功能。这个项目提供了完整的源码,不仅适用于PC平台,还兼容Android设备,拓展了应用的广泛性。 我们要理解Unity的音频处理系统。Unity支持多种音频格式,并且内置了音频播放器和音频剪辑管理器。在本地录音时,Unity会利用系统的音频输入设备(如麦克风)捕获声音,并将其转换为数字信号。这个过程涉及到音频采样率、位深度和声道数等概念,它们决定了音频的质量和数据量。 为了实现录音功能,Unity通常会使用C#脚本来控制AudioSource和AudioRecorder类。AudioSource是播放音频的组件,而AudioRecorder则用于录制音频。在这个项目中,源码可能包含了启动、停止录音的函数,以及设置录音参数的代码。例如,开发者可能会用到`Microphone.Start()`和`Microphone.End()`来开启和结束录音,以及`Microphone.GetDeviceName()`获取可用的麦克风设备名。 Android平台的录音需要额外的考虑,因为Android系统的权限管理更加严格。在Android上运行时,Unity应用需要请求“录音”权限,这通常在AndroidManifest.xml中配置,并在运行时通过Unity的PlayerSettings来处理。同时,Android的录音可能需要使用特定于平台的API,如Java的MediaRecorder类,通过Unity的JniBridge与C#代码进行交互。 在保存录音文件方面,Unity提供了File或StreamingAssets目录来存储本地文件。录音数据会被编码成特定的音频格式(如WAV或MP3),然后使用File类的WriteAllBytes方法写入磁盘。为了跨平台兼容,开发者可能需要选择一个在不同平台上都广泛支持的音频格式。 此外,这个项目可能还包含了对录音质量的设置,如采样率、位深度和编码方式。这些设置会影响录音文件的大小和音质。例如,高采样率和位深度可以提供更好的音质,但也会增加文件大小。 考虑到这是一个源码项目,开发者可能还提供了用户界面元素,如按钮来控制录音的开始和停止,以及显示录音状态的文本或图形指示器。UI设计和交互逻辑通常会使用Unity的UI系统,如Canvas、Button、Text等组件。 这个"unity本地录音并保存本地源码项目"涵盖了Unity的音频处理、Android权限管理、文件操作和用户界面交互等多个方面,是学习和实践Unity跨平台录音功能的好素材。通过深入研究和理解这些代码,开发者能够掌握如何在Unity中实现实用的录音功能,并扩展到其他应用场景。

文件下载

资源详情

[{"title":"( 2000 个子文件 31.4MB ) unity本地录音并保存本地源码项目 支持pc和Android端","children":[{"title":"ProjectSettings.asset <span style='color:#111;'> 16.90KB </span>","children":null,"spread":false},{"title":"InputManager.asset <span style='color:#111;'> 5.66KB </span>","children":null,"spread":false},{"title":"QualitySettings.asset <span style='color:#111;'> 4.75KB </span>","children":null,"spread":false},{"title":"EditorUserBuildSettings.asset <span style='color:#111;'> 4.59KB </span>","children":null,"spread":false},{"title":"GraphicsSettings.asset <span style='color:#111;'> 2.24KB </span>","children":null,"spread":false},{"title":"Physics2DSettings.asset <span style='color:#111;'> 1.37KB </span>","children":null,"spread":false},{"title":"NavMeshAreas.asset <span style='color:#111;'> 1.28KB </span>","children":null,"spread":false},{"title":"UnityConnectSettings.asset <span style='color:#111;'> 812B </span>","children":null,"spread":false},{"title":"DynamicsManager.asset <span style='color:#111;'> 763B </span>","children":null,"spread":false},{"title":"UnityEditor.GridBrush.asset <span style='color:#111;'> 711B </span>","children":null,"spread":false},{"title":"EditorSettings.asset <span style='color:#111;'> 589B </span>","children":null,"spread":false},{"title":"TagManager.asset <span style='color:#111;'> 383B </span>","children":null,"spread":false},{"title":"AudioManager.asset <span style='color:#111;'> 357B </span>","children":null,"spread":false},{"title":"EditorBuildSettings.asset <span style='color:#111;'> 221B </span>","children":null,"spread":false},{"title":"TimeManager.asset <span style='color:#111;'> 202B </span>","children":null,"spread":false},{"title":"NetworkManager.asset <span style='color:#111;'> 151B </span>","children":null,"spread":false},{"title":"ClusterInputManager.asset <span style='color:#111;'> 114B </span>","children":null,"spread":false},{"title":"sharedassets0.assets <span style='color:#111;'> 14.40MB </span>","children":null,"spread":false},{"title":"globalgamemanagers.assets <span style='color:#111;'> 41.42KB </span>","children":null,"spread":false},{"title":"dcafeb453e985aff7c50fd332f46d4d2.bin <span style='color:#111;'> 22.63KB </span>","children":null,"spread":false},{"title":"0ecebb101351ff0b0aaf6a0b2608f90d.bin <span style='color:#111;'> 22.63KB </span>","children":null,"spread":false},{"title":"1249c4085b57183581cb8cfaefa054bb.bin <span style='color:#111;'> 16.88KB </span>","children":null,"spread":false},{"title":"2313a5fe8502fc6e07630f6e9f13ea9f.bin <span style='color:#111;'> 16.88KB </span>","children":null,"spread":false},{"title":"ddd395ba64f7a85eeb4e1f5a017f0cd2.bin <span style='color:#111;'> 16.50KB </span>","children":null,"spread":false},{"title":"81d0c75148e89525c79ffe76a4c8613a.bin <span style='color:#111;'> 16.50KB </span>","children":null,"spread":false},{"title":"27dc933fee67e6be4eb4b066316cbaf9.bin <span style='color:#111;'> 16.50KB </span>","children":null,"spread":false},{"title":"ed0824f27f840b2e62d47741ae18254b.bin <span style='color:#111;'> 13.39KB </span>","children":null,"spread":false},{"title":"aee89d8636a4ccc4354fbd1fa16be328.bin <span style='color:#111;'> 13.39KB </span>","children":null,"spread":false},{"title":"990c7aa9e3207eb40864e151b175337c.bin <span style='color:#111;'> 13.39KB </span>","children":null,"spread":false},{"title":"0111e4df0c175f9fa85e5a179c5c6f4e.bin <span style='color:#111;'> 12.26KB </span>","children":null,"spread":false},{"title":"a86e89a3258e2c691441e2d17ef0c90e.bin <span style='color:#111;'> 12.26KB </span>","children":null,"spread":false},{"title":"6dcdaa7327970336b93d43ac4455ad29.bin <span style='color:#111;'> 12.26KB </span>","children":null,"spread":false},{"title":"e2329698669c2f61b562d962693d3c21.bin <span style='color:#111;'> 11.38KB </span>","children":null,"spread":false},{"title":"1ce424f9dc1fa91d08d29bcfc49a6aeb.bin <span style='color:#111;'> 10.56KB </span>","children":null,"spread":false},{"title":"c54b269f37ceb59a0f0f9e5037d155c8.bin <span style='color:#111;'> 10.41KB </span>","children":null,"spread":false},{"title":"9cf38ee8b4adcbcc9abce39c3a5f6810.bin <span style='color:#111;'> 10.41KB </span>","children":null,"spread":false},{"title":"1d71a2889344d63a98640e11f9c3bc73.bin <span style='color:#111;'> 10.41KB </span>","children":null,"spread":false},{"title":"cb1c68c5c7ef82b37ce3c8ae4c665f27.bin <span style='color:#111;'> 10.24KB </span>","children":null,"spread":false},{"title":"9ff1276e7ba7d3e3aa72fbf828fb42d5.bin <span style='color:#111;'> 10.24KB </span>","children":null,"spread":false},{"title":"02637819f073d319b9561189ae26e7ad.bin <span style='color:#111;'> 9.91KB </span>","children":null,"spread":false},{"title":"01a264152e8eadb46a53eb03b7e7656b.bin <span style='color:#111;'> 9.91KB </span>","children":null,"spread":false},{"title":"c70ac16935686c36e80518abf0d1ea07.bin <span style='color:#111;'> 9.77KB </span>","children":null,"spread":false},{"title":"06f96218bd9db4de42cbdb6001b1b9ff.bin <span style='color:#111;'> 9.40KB </span>","children":null,"spread":false},{"title":"6519549ad0057652fadeef2d7c72a10b.bin <span style='color:#111;'> 9.40KB </span>","children":null,"spread":false},{"title":"2654b872af744426bc10b0e5f8e84e67.bin <span style='color:#111;'> 8.93KB </span>","children":null,"spread":false},{"title":"df887b4b0d0d0d91b4ecd90abbf3e717.bin <span style='color:#111;'> 8.92KB </span>","children":null,"spread":false},{"title":"e1a8db82c50237f76a11af3ef0ec1df2.bin <span style='color:#111;'> 8.92KB </span>","children":null,"spread":false},{"title":"89965183cd2083878aae30d202069adf.bin <span style='color:#111;'> 8.92KB </span>","children":null,"spread":false},{"title":"daa0a0566e3534b01382bcbb4a289501.bin <span style='color:#111;'> 8.89KB </span>","children":null,"spread":false},{"title":"ed471d6fdacca7f277c2c9b245b2292b.bin <span style='color:#111;'> 8.75KB </span>","children":null,"spread":false},{"title":"cee22e0ef278cff3bdb441e342528a2f.bin <span style='color:#111;'> 8.71KB </span>","children":null,"spread":false},{"title":"2dbf1ddddc90110865936030734eb1bb.bin <span style='color:#111;'> 8.71KB </span>","children":null,"spread":false},{"title":"8080db6050e81d34e1093d8da8385bc4.bin <span style='color:#111;'> 8.31KB </span>","children":null,"spread":false},{"title":"2557e4da7a0ee869df8760f73c777e2f.bin <span style='color:#111;'> 8.31KB </span>","children":null,"spread":false},{"title":"1889562fc0bd2f6862c4e46a14bcf2e2.bin <span style='color:#111;'> 8.31KB </span>","children":null,"spread":false},{"title":"ebfd65a1bcd0a786cd660578dff1cc08.bin <span style='color:#111;'> 8.28KB </span>","children":null,"spread":false},{"title":"62c705a9c44336b5a7ab493cbab675d0.bin <span style='color:#111;'> 8.28KB </span>","children":null,"spread":false},{"title":"63e09bf5b3e7b6c6b64c27a43a3189f3.bin <span style='color:#111;'> 8.27KB </span>","children":null,"spread":false},{"title":"a77df60b45964adfaa8148d76b3390bd.bin <span style='color:#111;'> 8.23KB </span>","children":null,"spread":false},{"title":"2b7cd32cf70f1535a7522614492e0baa.bin <span style='color:#111;'> 8.23KB </span>","children":null,"spread":false},{"title":"008e339b2c32a12cbe985c09afd9cf6f.bin <span style='color:#111;'> 8.20KB </span>","children":null,"spread":false},{"title":"08b4c976ee4a77b67c49571652f71a92.bin <span style='color:#111;'> 8.19KB </span>","children":null,"spread":false},{"title":"8e6f84cc79a4e58dcbc72788ee5c6724.bin <span style='color:#111;'> 8.19KB </span>","children":null,"spread":false},{"title":"64cb3d99427124528e2a03ea2b4cda7b.bin <span style='color:#111;'> 8.19KB </span>","children":null,"spread":false},{"title":"2cdad541f99cd7e2581e348514ee6c9c.bin <span style='color:#111;'> 8.18KB </span>","children":null,"spread":false},{"title":"ed19dabc90212fe1cdcd25849bcdd652.bin <span style='color:#111;'> 8.18KB </span>","children":null,"spread":false},{"title":"05c986dd7a64b6c2784a69146cd36720.bin <span style='color:#111;'> 8.16KB </span>","children":null,"spread":false},{"title":"28fed880c17426059ea9865a5967ec5b.bin <span style='color:#111;'> 8.16KB </span>","children":null,"spread":false},{"title":"d8e86186f2265c1d0ab7ba9a5eb1c6bf.bin <span style='color:#111;'> 8.14KB </span>","children":null,"spread":false},{"title":"9bff0bfcde918ff9a893abf4befc05e5.bin <span style='color:#111;'> 8.14KB </span>","children":null,"spread":false},{"title":"692a9ca0aaf39a07af8a633e16495c0d.bin <span style='color:#111;'> 8.14KB </span>","children":null,"spread":false},{"title":"047296c57484e896e617434d8472a0b6.bin <span style='color:#111;'> 8.13KB </span>","children":null,"spread":false},{"title":"0567df165b775ac3bb107d236b3991e0.bin <span style='color:#111;'> 8.13KB </span>","children":null,"spread":false},{"title":"60b00d6589247e43a206a414792f4669.bin <span style='color:#111;'> 8.13KB </span>","children":null,"spread":false},{"title":"efacb271b9ff98c8faf7eecf9b6e86a5.bin <span style='color:#111;'> 8.07KB </span>","children":null,"spread":false},{"title":"2e3d0a169bb60335b40eab9268b918a7.bin <span style='color:#111;'> 8.07KB </span>","children":null,"spread":false},{"title":"12c5335c02ffa6557d1710637c1823f7.bin <span style='color:#111;'> 8.01KB </span>","children":null,"spread":false},{"title":"9b3df3fd96b5c286a05a64a899ce6d99.bin <span style='color:#111;'> 7.97KB </span>","children":null,"spread":false},{"title":"8aad8f0a016883e567d429537800eb48.bin <span style='color:#111;'> 7.94KB </span>","children":null,"spread":false},{"title":"8c6884e68401a7efcf88612a049e74ab.bin <span style='color:#111;'> 7.94KB </span>","children":null,"spread":false},{"title":"0c4c406fed3e9a8eb550a6955ae19fd4.bin <span style='color:#111;'> 7.87KB </span>","children":null,"spread":false},{"title":"a1057c96aeee736456b1b465501d54b0.bin <span style='color:#111;'> 7.87KB </span>","children":null,"spread":false},{"title":"13ee44772ebf66bde9d68b9ad8bf859a.bin <span style='color:#111;'> 7.85KB </span>","children":null,"spread":false},{"title":"c0498714e3b0ad98e4ee43c8683980db.bin <span style='color:#111;'> 7.82KB </span>","children":null,"spread":false},{"title":"d0eed50925b226835d81332085840c93.bin <span style='color:#111;'> 7.80KB </span>","children":null,"spread":false},{"title":"6bd3d286b0f3bf2e38fdf610bb3c9188.bin <span style='color:#111;'> 7.80KB </span>","children":null,"spread":false},{"title":"608aa28c459310b37f800a88efbabcfd.bin <span style='color:#111;'> 7.80KB </span>","children":null,"spread":false},{"title":"db30ecc37706e4a5ed5d918b37279da6.bin <span style='color:#111;'> 7.70KB </span>","children":null,"spread":false},{"title":"ec066eeb612037c9a05187d550e3920e.bin <span style='color:#111;'> 7.70KB </span>","children":null,"spread":false},{"title":"992c36f5e57efd8e55cb727019d8ca41.bin <span style='color:#111;'> 7.70KB </span>","children":null,"spread":false},{"title":"d783b925bdec39ba0aed4d13e20a057d.bin <span style='color:#111;'> 7.69KB </span>","children":null,"spread":false},{"title":"2030d12fb5fa7d6443dbc2db35d66ff3.bin <span style='color:#111;'> 7.69KB </span>","children":null,"spread":false},{"title":"29040629cbd63df1c98e9d233afb1bfa.bin <span style='color:#111;'> 7.69KB </span>","children":null,"spread":false},{"title":"0f17da236c2a5e729dcd61b2034a9ed9.bin <span style='color:#111;'> 7.65KB </span>","children":null,"spread":false},{"title":"2b5b44691996bfda39ab45f93f2578a2.bin <span style='color:#111;'> 7.65KB </span>","children":null,"spread":false},{"title":"03351790e79bd5774e4cc1064176e4d2.bin <span style='color:#111;'> 7.65KB </span>","children":null,"spread":false},{"title":"cfc4d274cd2548aa132b2d2e7d2bdee7.bin <span style='color:#111;'> 7.65KB </span>","children":null,"spread":false},{"title":"ea9267050f42f49b9c62b87801e648ef.bin <span style='color:#111;'> 7.64KB </span>","children":null,"spread":false},{"title":"8761f0a288102899199bbdc1037d80f6.bin <span style='color:#111;'> 7.62KB </span>","children":null,"spread":false},{"title":"c501ded76ae0632bc280e5e1456350f1.bin <span style='color:#111;'> 7.61KB </span>","children":null,"spread":false},{"title":"......","children":null,"spread":false},{"title":"<span style='color:steelblue;'>文件过多,未全部展示</span>","children":null,"spread":false}],"spread":true}]

评论信息

免责申明

【只为小站】的资源来自网友分享,仅供学习研究,请务必在下载后24小时内给予删除,不得用于其他任何用途,否则后果自负。基于互联网的特殊性,【只为小站】 无法对用户传输的作品、信息、内容的权属或合法性、合规性、真实性、科学性、完整权、有效性等进行实质审查;无论 【只为小站】 经营者是否已进行审查,用户均应自行承担因其传输的作品、信息、内容而可能或已经产生的侵权或权属纠纷等法律责任。
本站所有资源不代表本站的观点或立场,基于网友分享,根据中国法律《信息网络传播权保护条例》第二十二条之规定,若资源存在侵权或相关问题请联系本站客服人员,zhiweidada#qq.com,请把#换成@,本站将给予最大的支持与配合,做到及时反馈和处理。关于更多版权及免责申明参见 版权及免责申明