-
Notifications
You must be signed in to change notification settings - Fork 178
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
Playing some mp3 file during call, is it possible? #226
Comments
This should now be possible if you use 2.0.0-beta1 and write a custom TVIAudioDevice, but we don't have sample code which demonstrates it yet. There was a similar question asked in (#157) as well. If you're looking for full duplex playback + recording + mp3 player today you would probably need to write your own AudioUnit based device using a VoiceProcessingIO unit and with the 2nd output being the contents of the mp3 that you would like to play. Another option, which we're looking to add sample code coverage on, is using AVAudioEngine instead of CoreAudio / AudioUnit. We have an example which shows a playback only device using AudioUnits. I'd bet this one works with AVPlayer out of the box, but it doesn't do recording and echo cancellation. Regards, |
Thank you for quick answer and explanation. Could you send me some example how to do that, or when you plan to add your example to this git project. I don’t have idea how to do that. Thank you. |
Hi, It's not scheduled this week, but we would like to add this example sooner than later. I'll keep this ticket updated once we have something available to try. Best, |
Ok thank you very much for your help. All the best, |
Hey @TorlendorPrivate, We've posted a WIP pull request which plays music alongside regular Room audio. We are looking to merge it later this week. Best, |
Thanks @ceaglest for the information. I will try it when i found time and then tell you my impresion. Thank’s once again. All the best, |
We've now merged the updated TVIAudioDevice example into master. I'm going to keep this ticket open, since we're still considering adding this feature to TVIDefaultAudioDevice. If you're willing to try out sample code and TVIAudioDevice APIs, you don't need to wait for us to update the default device. Best, |
Hi @ceaglest. I have problem with playing audio file while call is active. I don't use localVideoTrack just localAudioTrack. When I enter into the call my microphone doesn't work and often speaker also doesn't work. I don't know what can be problem, because when i enter the call without avplayer instance everything works well. Thank's for help. All the best, |
Did this ever get added to the default audio options? We are still seeing similar issues and can't find any way to configure it |
Hi @gileze33, The ability to mix multiple streams of audio is not part of TVIDefaultAudioDevice at this time. We have an example that demonstrates using AVAudioEngine to mix an audio file with audio from the SDK. We are currently updating the example (#464) to improve compatibility with bluetooth audio, and the changes should be merged this week. Best, |
@ceaglest Do you know if it's possible to easily adapt that engine to play with an HLS livestream? Right now we have a livestream (HLS with video and audio) that's playing from another source, and when you connect to the Twilio Room, we want that livestream to keep playing, and the Room to continue to have full duplex playback + recording. Note that we don't want to transmit any of the audio from the livestream to the Room, we just want it to continue playing alongside any Room audio locally. A little more on the situation: We have the livestream playing, and everything is fine. We then initiate a connection to a Twilio Room, and the livestream video and audio pause for a second, after which we’re successfully connected to the Room, with all Room input and output working fine, and the livestream audio and video restarting alongside the room audio. While connected to the Room, the livestream audio quality is significantly reduced, whether being played out of the speakers or through bluetooth. I guess the main question is how to 1) prevent any pause in the livestream from happening when connecting to the Room, and 2) maintain the livestream’s audio quality while being played locally alongside the Room audio. Would an adapted version of the engine you mentioned solve these, or is there an easier way? |
Hi @piyushtank , In I've the lasted code, the music plays on the device, however, I'm not able to hear music on the other end. Some details about my test:
The app crashes on one device, at the below assertion:
Any idea what could be wrong? Thanks! |
@piyushtank @ceaglest Would appreciate if you can please review the previous comment. Thanks in advance! |
@liyamahendra The |
@piyushtank thank you for your reply. I realize I had used the wrong wordings in my below message:
In my test which I performed, I did select Any idea why the sample crashes on one device, as soon as someone enters the room? |
@liyamahendra Can you share the crash logs? |
Following are the debug logs from Xcode:
================ Following is the crash log from the device:
============ Apart from these, attaching a screencast showing the crash. crash.mp4Kindly let me know if this helps and if you need any more details. Have a nice weekend! |
@piyushtank is the information I shared sufficient? Do you need any more details please? |
@
Can you enable Video SDK logs and share please?
|
@piyushtank I'm getting an error saying Please let me know. |
@liyamahendra yeah I meant |
@piyushtank - here are the logs from debug console:
|
@piyushtank were the updated logs I shared helpful? Do you need any more details please? |
Hi @piyushtank, are the details I shared helpful? Please let me know if you need any assistance from my side. |
@liyamahendra Its throwing an assertion failure at this line -
Since we are not able to reproduce the crash, can you make sure initializeCapturer is called and this line was executed before? |
@piyushtank thank you for replying back! what would be the ideal method to ensure what you suggested? Would you mind briefly mentioning the steps please? So that it’s done properly as expected? |
@liyamahendra you may wanna add logs at places where mixedAudioBufferList is assigned and set to nil. You can use breakpoints as well. |
@piyushtank did you get a chance to see my previous comment? |
This clearly doesn't seem to work as expected. @piyushtank would you advise I drop using this feature in the app? @ceaglest do you've any comments please? |
Description
We want to play some mp3 file using AVAudioPlayer, but when we play mp3 file there is no sound any more between participants. Is it possible to play some mp3 file during video call? This should be a main feature in our application so that's why I ask this. Thank you very much on your time and help.
Nemanja
Expected Behavior
We want to play some mp3 file using AVAudioPlayer during video call
Actual Behavior
When we play mp3 file there is no sound any more between participants
Reproduces How Often
100%
Xcode
9.2
iOS Version
iOS 10.0 and above
iOS Device
any
The text was updated successfully, but these errors were encountered: