How to mute local audio playback while still receiving raw audio data with Agora API? - unity3d

I'm trying to play back raw audio data from an Agora remote stream through an AudioSource in Unity. For this, I have to first disable the default playback method used by the Agora SDK. I have tried MuteAllRemoteAudioStreams but this stops the API from receiving remote audio data altogether.
I have also tried AdjustPlaybackSignalVolume and AdjustAudioMixingVolume, which successfully mute the audio playback but this also makes the OnPlaybackAudioFrameHandler callback receive empty audio frames, stopping me from accessing raw audio data.
SetAudioPlaybackDeviceMute simply mutes the playback device, which is not what I am looking for.
Is there a way to only mute the playback of remote streams while also being able to access raw audio data?

Try mRtcEngine.AdjustPlaybackSignalVolume(0);
This will turn the playback volume from the channel, but your AudioSource volume is not affected.
If you have other issues, please come chat with us and search for answers in our slack group:
https://agoraiodev.slack.com/messages/unity-help-me

Related

Flutter record live broadcast sound without microphone

I want to record live broadcast (podcast,m3u8 etc.) audio with Flutter without needing a microphone.
The recordings are not successful because the microphone is constantly recording external sounds.
Thanx
I tried recording with ffmpeg. But I couldn't get good results.

Play two audio sources during a live video stream

I'm working with the Azure Media Player( https://ampdemo.azureedge.net/ ). I need a second audio source (which will be music) to be overlaid on top of the video with presenter talking. I see there's the ability to select multiple audio streams if the video is stored on Azure. (English/spanish/etc...) However, in my case it will be video and presenter(talking) on the video live stream and I'd like to be able to select a music stream of the viewers choice during the live stream which will be stored music in Azure.
Is this possible?
Then take it to the next step, does the player provide the capability of setting the volume on each stream? If not, is the player extendable?
Azure Media Player(AMP) doesn't allow playing multiple audio streams at the same time. You could achieve your desired behavior by including a hidden HTML5 video player and use that to play your additional audio. You'll probably want to use javascript to "synchronize" the hidden video player with Azure Media Player, i.e. When AMP plays, you play the hidden video player. When AMP pauses, you pause the hidden video player.

Recording Radio Streaming in IOS

I am working on radio app in which i want to record live radio streaming on an record button click.It should record just the radio streaming sound. Currently i am recording from Mike but its not the way i want as it also captures the surrounding/background voice. I did read few post but all of them are regarding AVaudioRecorder. I have used wunderradio api for playing the radio from url. I haven't got any method/function in their api which will record that audio from url. I want to record the buffered audio only from that url,so that I can play that recorded file later.
Any help would be appreciated.
Recording audio playback by using the microphone is really not the right way to do it. If you're using AudioQueue services for audio playback you can use the AudioFileWritePackets function to write audio data to a file.
If you implement recording this way you can write audio files in the format they're streamed in. So an mp3 audio stream can be written as an mp3 file to disk since you're writing encoded audio packets with the AudioFileWritePackets function.
To get a better understanding of how this all should be implemented you can have a look at the SpeakHere sample code of Apple. The SpeakHere project records from the microphone but it's still a good example to see how the AudioFileWritePackets function works. In your case you need to use the AudioFileWritePackets function in the output callback of your AudioQueue. This is the callback that's called when a buffer is finished playing. So it's a good to place to write the already played audio buffers data to a file.

Record iphone System or audio player sound

I am developing an app module in which i am doing audio recording with also video recording.
but i want to record only device intrnal playing sound , not the device external voice.
If any advise or suggestion to got it..!!
I'm not sure but maybe you can use buffers to write them into a file Audio units or Audio Queues without using mic

Record HTTP Live Streaming Video To File While Watching?

I am trying to create a streaming video DVR like functionality in an app I am developing. I have an HTTP Live Stream that I have successfully gotten to play on the iPad. I want the user to be able to push the "Record" button, and begin recording the video that is currently playing from that point. This video file will be accessible from the app or from the camera roll. Currently, I am using the MPMoviePlayerController object to play the video stream. I do not see any methods of accessing the data from the object in Apple's documentation. Here are some thoughts I had on ways of going about this.
1) Somehow access the video data from MPMoviePlayerController, and write this to a file. Or use another type of player object that will allow me to play the video and access the currently playing data.
2) Implement some sort of screen capture recording that gets a video capture of the iPad's screen. This would allow me to record the video in a "screenshot" sort of way.
3) Locate the HTTP Live Streaming video segments where they are stored by MPMoviePlayerController. Presumably they need to be stored somewhere on the iPad for playback. Is there a way of accessing these files?
4) Manually download the stream video segments over http while streaming the file. This seems like its not ideal since the stream would have to be downloaded twice.
5) This could work. Periodically download the video segments to the iPhone. Set up a local http server on the iPhone and server the videos to the MPMoviePlayerController. This way the video segments could be marked for recording and assembled into a video.
6) I do have control of the streaming server. I could write some server side code to record the video on the server end, then send the video to the iPad after the fact. I would rather not do this.
Has anyone done any of these things? Ideally the iPhone would just be able to access the video data somehow and easily record it. I would rather not get into options 4, 5, or 6 (above) if I don't have to.
Thanks in advance.
DVR on the device is somewhat not encouraged, due to the limited space available and other factors like battery life, processing power, cleanup procedures after the user stops the dvr, etc.
If you want to achieve DVR playback on iOS devices (or other devices using HLS), I suggest you keep the video server side. The live stream is already captured and segmented server side, all you would have to do is keep the segments a bit longer, instead of deleting them. By using the EXT-X-PLAYLIST-TYPE and EXT-X-MEDIA-SEQUENCE tags, you can suggest to the player that he's opening a live stream which has DVR (earlier) video available.
Alternatively, you can use a server that does that out of the box, for example Wowza. Here's an article on how to achieve this with Wowza