- html - 出于某种原因,IE8 对我的 Sass 文件中继承的 html5 CSS 不友好?
- JMeter 在响应断言中使用 span 标签的问题
- html - 在 :hover and :active? 上具有不同效果的 CSS 动画
- html - 相对于居中的 html 内容固定的 CSS 重复背景?
我目前正处于一个项目的研究和原型(prototype)设计阶段,该项目旨在开发一个 native iOS 应用程序 (Swift 3),其中包括一个多 channel 音频播放器(多个立体声 MP3 文件)。我在网上找到的信息非常有限,尤其是用 Swift 3 编写的信息,因此我想在继续研究时我会在这里提出一个问题。
关于框架,从我到目前为止所看到的来看,似乎很清楚 AVFoundation将会完成这项工作。它的级别不太低,并且具有一套很好的功能。它支持播放多个音频文件 AVAudioPlayer 。我计划很快开始用这个制作原型(prototype)。
但是我对 Swift 和拥有大量库的 iOS 开发还是新手,所以我想知道我是否遗漏了任何东西,我是否走在正确的轨道上。任何包含一般信息和对此的想法的答案都将被投票。对于接受的答案,一些使用适当框架、AVFoundation 或合理替代方案的示例大纲代码。
如果没有答案,我会在到达那里时发布我自己的代码。
具体来说,我需要从项目资源中的 MP3 文件中获得两到十个输入 channel ,每个 channel 都有自己的增益,可以单独调整,然后所有这些混合,保持其立体声 channel ,到单个输出(设备)与主增益。有些轨道需要循环播放,有些则不需要。轨道需要精确同步。这只是为了提供信息,大纲代码就可以涵盖要点。
研究笔记和资源
与 AVFoundation 相关的资源集合。
<强> Apple: AVFoundation Programming Guide
这份文档乍一看似乎令人鼓舞,但实际上只涉及视频。它说:
There are two facets to the AVFoundation framework—APIs related to video and APIs related just to audio. The older audio-related classes provide easy ways to deal with audio. They are described in the Multimedia Programming Guide, not in this document.
苹果公司其他地方也提到了与此相关的“多媒体编程指南”,但从未链接过,谷歌结果指向苹果网站上未找到的页面。好像消失了。
<强> Rudi Strahl: Mixing Multiple Audio Tracks with AVFoundation
使用 AVComposition 进行比较使用多个 AVPlayer s。示例代码是 Objective-C。不确定 AVPlayers 在第二个解决方案中是如何混合的。也许与 AVAudioMix 。目前正在看这个。这篇文章对此进行了一些讨论,但没有提供任何具体细节。
<强> Audio Session Programming Guide
本文档着眼于 AVAudioSession它提供支持功能:
AVAudioSession gives you control your app’s audio behavior. You can:
- Select the appropriate input and output routes for your app
- Determine how your app integrates audio from other apps
- Handle interruptions from other apps
- Automatically configure audio for the type of app your are creating
<强> Techotopia: Playing Audio on iOS 10 using AVAudioPlayer
有关使用 AVAudioPlayer 的一些有用信息.
<强> Stack Overflow: Playing a Sound with AVAudioPlayer
用于播放声音的基本 Swift 代码。有些答案包括一些额外的功能。
<强> Hacking with Swift: How to Play Sounds Using AVAudioPlayer
再次涵盖基础知识。
<强> Sweet Tutos: How To Play Sounds Files And Manage Duration Progress – AVAudioPlayer Tutorial
已更新至 Swift 3。一些有用的信息。
<强> Xamarin: Playing Sound with AVAudioPlayer
我认为是用 Swift 2 编写的。
<强> Apple Video: WWDC 2013 Moving to AV Kit and AV Foundation
虽然没有直接相关,但我发现该视频的前 30 分钟向开发人员介绍了 OS X 10 中的 AV Kit 和 AV Foundation,提供了对该技术的有用概述。
最佳答案
我正在解决同样的问题,我能做的最好的事情就是对要使用 avplayer 播放的媒体内容进行转码,这里是 draft ,也许能有所帮助。
关于使用 AVFoundation 和 Swift 的 iOS 多 channel 音频,我们在Stack Overflow上找到一个类似的问题: https://stackoverflow.com/questions/40876363/
我一直在为实时流和静态文件(HTTP 上的 MP3)构建网络广播播放器。我选了Howler.js作为规范化 quirks 的后端的 HTML5 Audio (思考:自动播放、淡入/淡出、进度事件)。
vue移动端input上传视频、音频,供大家参考,具体内容如下 html部分 ?
关闭。这个问题需要更多 focused .它目前不接受答案。 想改进这个问题?更新问题,使其仅关注一个问题 editing this post . 7年前关闭。 Improve this questi
我想在我的程序中访问音频和视频。 MAC里面可以吗? 我们的程序在 Windows 上运行,我使用 directshow 进行音频/视频编程。但我想在 MAC 中开发相同的东西。 有没有像direct
我的应用程序(使用 Flutter 制作,但这应该无关紧要)具有类似于计时器的功能,可以定期(10 秒到 3 分钟)发出滴答声。我在我的 Info.plist 中激活了背景模式 Audio、AirPl
我是 ionic 2 的初学者 我使用了音频文件。 import { Component } from '@angular/core'; import {NavController, Alert
我有一个包含ListView和图片的数据库,我想在每个语音数据中包含它们。我已经尝试过,但是有很多错误。以下是我的java和xml。 数据库.java package com.example.data
我在zend framework 2上建立了一个音乐社交网络。您可以想象它与SoundCloud相同,用户上传歌曲,其他用户播放它们,这些是网站上的基本操作。 我知道将要托管该页面的服务器将需要大量带
我正在尝试在android应用中播放音频,但是在代码中AssetFileDescriptor asset1及其下一行存在错误。这是代码: MediaPlayer mp; @Override prote
我对 WordPress Audio Shortcode有问题。我这样使用它: 但是在前面,在HTML代码中我得到了: document.createElement('audio');
我正在做一项关于降低噪音的滤波技术的实验。我在数据集中的样本是音频文件(.wav),因此,我有:原始录制的音频文件,我将它们与噪声混合,因此变得混合(噪声信号),我将这些噪声信号通过滤波算法传递,输出
一个人会使用哪种类型的神经网络架构将声音映射到其他声音?神经网络擅长学习从序列到其他序列,因此声音增强/生成似乎是它们的一种非常流行的应用(但不幸的是,事实并非如此-我只能找到一个(相当古老的)洋红色
这个让我抓狂: 在专用于此声音播放/录制应用程序的 Vista+ 计算机上,我需要我的应用程序确保(默认)麦克风电平被推到最大。我该怎么做? 我找到了 Core Audio lib ,找到了如何将 I
{ "manifest_version": 2, "name": "Kitten Radio Extension", "description": "Listen while browsi
class Main { WaveFileReader reader; short[] sample; Complex[] tmpComplexArray; publi
我正在使用电话录音软件(android),该软件可以记录2个人在电话中的通话。每个电话的输出是一个音频文件,其中包含来自 call 者和被 call 者的声音。 但是,大多数情况下,运行此软件的电话发
我正在构建一个需要语音激活命令的Web应用程序。我正在使用getUserMedia作为音频输入。 对于语音激活命令,该过程是用户将需要通过记录其语音来“校准”命令。例如,对于“停止”命令,用户将说出“
我正在开发一个Cordova应用程序,并将PouchDB用作数据库,当连接可用时,它将所有信息复制到CouchDB。 我成功存储了简单的文本和图像。 我一直在尝试存储视频和音频,但是没有运气。 我存储
我正在开发web application,我必须在其中使用.MP3的地方使用播放声音,但是会发生问题。 声音为play good in chrome, Firefox,但为safari its not
如何减少音频文件的位深?是否忽略了MSB或LSB?两者混合吗? (旁问:这叫什么?) 最佳答案 TL / DR:将音频曲线高度变量右移至较低位深度 可以将音频视为幅度(Y轴)随时间(X轴)的模拟曲线。
我是一名优秀的程序员,十分优秀!