-
Notifications
You must be signed in to change notification settings - Fork 7.4k
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Updated AudioInputManager and ViewController to read audio data appro… #388
base: master
Are you sure you want to change the base?
Conversation
…priate to the iOS documentation
Now cant import anything it's showing "PortAudio library not found" error while importing |
Hi @Sanjay2802, is this occurring on the following branch from which I have raised PR? |
Noo , i suppose |
@thumbarnirmal Could you clarify what's the issue with the current code? @Sanjay2802 The
|
Hi @khanhlvg The inputNode.installTap callback in AudioInputManager.swift file returns audio data in range of [100, 400] milliseconds. This is specified in the iOS documentation which can be checked in xcode. It is not specified in apple developer docs website. When the audio data returned by installTap callback is converted and saved in pcmBuffer, the pcmBuffer will have only 400 ms of unique data. The same audio data is repeated to fill the pcmBuffer for 1 second. This can be checked by trying to match pcmBuffer array from index[0:399] and index[400:799]. Above explanation is based on the assumption that inputNode.installTap has buffersize which is greater than or equal to 400 ms. If, for example, buffer size is equivalent to 200 ms, same issue would occur, but data would repeat in pcmBuffer from index 200, 400 and so on. |
For sake of brevity, I have mentioned time in milliseconds as indexing value in array. Actual array index would be calculated by multiplying the pcmBuffer's sampling rate with the time value in seconds. |
…priate to the iOS documentation