Comments (5)
I've found a solution for this issue, it's to provide correct channelLayout
to AVAudioFormat.init
in case number of channels is more than 2 (in AudioCodec.swift). For example, for 4 channels it's AVAudioChannelLayout(layoutTag: kAudioChannelLayoutTag_AudioUnit_4)
. I also tried to create AudioChannelLayout
using custom mChannelDescriptions
to discard selected channels, but AVAudioFormat
was always nil. Next need to limit number of channels for outputFormat
to min(inSourceFormat.mChannelsPerFrame, 2)
(in AudioCodecSettings.swift). After that connecting an external mixer and streaming works fine. Will prepare a PR.
from haishinkit.swift.
Sorry, no idea yet. It may be invalid.. maybe some special microphone
from haishinkit.swift.
Indeed, it doesn't support 3-channel or 4-channel audio. While it's not causing a crash, I believe it should display an error for unsupported cases. Do you know how to capture in 3 channels or more on an iPhone or iPad?
from haishinkit.swift.
It seems that AVAssetWriterInput doesn't support 4 channels. Even when forcibly setting it to 2 channels, recording didn't work. Therefore, I made adjustments to prevent crashes. Now, you can handle it using delegate?.recorder(self, errorOccurred: .failedToCreateAssetWriterInput). #1268
from haishinkit.swift.
We have a subset of users who use external audio devices. Mostly musicians and djs. They use audio mixers that they connect to the phones using DIN (MIDI) cables with lightning or USB-C adapters. MIDI supports up to 16 channels. This way, the input audio format looks like this:
It has 4 channels and while it doesn't crash, AV can't instantiate AVAudioFormat
with this ASBD. I have EvermixBox4 (evermix does no longer exist) and was able to get the above format. Some users have iRig Pro Duo, PreSonus Audiobox USB96, Focusrite Clarett2Pro USB. I think any mixer with DIN output should reproduce the issue.
I'm wondering if we could to use Audio Toolbox in this case and discard extra channels with kAudioConverterChannelMap
. Ideally could let the user to select what channels to discard. Still looking into this, would be happy to help to debug this.
from haishinkit.swift.
Related Issues (20)
- does not conform to protocol 'NetStreamDelegate' since 1.5.6 HOT 1
- No SRTHaishinKit in 1.5.7 HOT 1
- Audio issue while transmitting. WebRTC. 4 channels HOT 29
- Reconnection from WiFi to 4G always results in lower transfer speed HOT 6
- Codec Hevc with SRT HOT 3
- The operation couldn’t be completed. (HaishinKit.IORecorder.Error error 3.) HOT 2
- Audio not transmitting after disconnected from Bluetooth HOT 1
- calling SRTConnection.performanceData results in a crash HOT 4
- MultiCam does not work in SwiftUI HOT 2
- VideoCodec still running after stream is close() HOT 9
- stream.videoCapture(for: 0)?.... is super slow HOT 1
- multiCamNotSupported when rotating to Selfie camera HOT 2
- [BUG] Updating NetStream.multiCamCaptureSettings.Mode doesn't work HOT 2
- [Crash] App crashes due to thread-safe issue of RTMPConnection.uri HOT 3
- running ios example with SRT does not work with srt-live-transmit
- It is very slow to rotate camera in PiP mode HOT 4
- MTHKView with many VideoEffects - preview is lagging HOT 5
- What happens when playing pure audio fails? We only did audio push-pull streaming, but we ran into problems playing it back. HOT 6
- When I closed the stream and then turned it back on, the log showed that it was connected, but frequent switching results in low transmission speed HOT 2
- Recording is broken if using an audio sample rate is set to 44.1 kHz HOT 1
Recommend Projects
-
React
A declarative, efficient, and flexible JavaScript library for building user interfaces.
-
Vue.js
🖖 Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.
-
Typescript
TypeScript is a superset of JavaScript that compiles to clean JavaScript output.
-
TensorFlow
An Open Source Machine Learning Framework for Everyone
-
Django
The Web framework for perfectionists with deadlines.
-
Laravel
A PHP framework for web artisans
-
D3
Bring data to life with SVG, Canvas and HTML. 📊📈🎉
-
Recommend Topics
-
javascript
JavaScript (JS) is a lightweight interpreted programming language with first-class functions.
-
web
Some thing interesting about web. New door for the world.
-
server
A server is a program made to process requests and deliver data to clients.
-
Machine learning
Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.
-
Visualization
Some thing interesting about visualization, use data art
-
Game
Some thing interesting about game, make everyone happy.
Recommend Org
-
Facebook
We are working to build community through open source technology. NB: members must have two-factor auth.
-
Microsoft
Open source projects and samples from Microsoft.
-
Google
Google ❤️ Open Source for everyone.
-
Alibaba
Alibaba Open Source for everyone
-
D3
Data-Driven Documents codes.
-
Tencent
China tencent open source team.
from haishinkit.swift.