-
Notifications
You must be signed in to change notification settings - Fork 127
Audio mix recorder #632
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
Audio mix recorder #632
Conversation
it seems like you haven't added any nanpa changeset files to this PR. if this pull request includes changes to code, make sure to add a changeset, by writing a file to
refer to the manpage for more information. |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
this is awesome and it works!
I found one bug, not sure what the cause is, but if I do (pseudo-code)
room.connect()
audioRecorder = audiomixrecorder(filePath:"../..")
audiomanager.shared.add(localRenderer: audioRecorder.newSource())
audiomanager.shared.add(remoteRendered: audioRecorder.newSource())
then at disconnect
room.disconnect()
audioRecorder.stop()
audioRecorder = nil
then if I try to connect again, i get a crash. I can fix the crash by manually removing the old sources from the audiomanager delegates. so it suggests that the sources (which should be stored weakly in audiomanager) aren't getting deallocated and maybe there is a retain cycle inside AudioMixRecorder
otherwise this is perfect
Thanks for testing, will take a look 🙂 |
@hiroshihorie update: I missed the "removeAllSources" method. when i call that too at disconnect then the crash no longer happens when the next session starts but instead when it ends. which doesn't really make sense... |
@bcherry Can you try to reproduce the crash again ? |
I was unable to reproduce the crash following the steps Ben described. |
This might be out of the scope of this PR, but maybe we could define an var settings = AudioSettings()
settings.formatID = .mpeg4aac
settings.sampleRate = 48_000
settings.channelCount = 1
settings.pcm.bitDepth = 32
settings.pcm.isFloat = true
settings.pcm.isInterleaved = false
settings.pcm.isBigEndian = false An additional overload of |
@ladvoc I agree we can improve the AudioSettings but maybe we can add that later. I think it's a bit hard to properly cover all settings. |
Easily mix and record multiple audio sources (AudioRenderer protocol).
Can add additional source while recording.
TODO:
Example usage