RenderHeads / UnityPlugin-AVProVideo

AVPro Video is a multi-platform Unity plugin for advanced video playback
https://www.renderheads.com/products/avpro-video/
238 stars 28 forks source link

How to access AudioSource clip samples data #1434

Closed BestAR25 closed 1 year ago

BestAR25 commented 1 year ago

Question Now I want to implemente LiveStream video by using AVProVideo and Agora SDK. Agora SDK sent audio data from audiosource.clip.samples but I can't get access real sound data from AudioOutput script.

image This is partial screenshot of my sample project.

I want to get audio samples from that "dummy" AudioClip. But that samples data in the AudioOutput.cs is initialized with 1.

image

Can I get audio sample data from AVPro?

Chris-RH commented 1 year ago

audiodata

BestAR25 commented 1 year ago

Thanks your reply. I need that audioData. Is that audioData parameter output , right? If that's right output parameter, how can I set audioData length?

Can you show me sample right such as below. float[] audioData = SampleFunction();

Chris-RH commented 1 year ago

We have an API list in our documentation

https://www.renderheads.com/content/docs/AVProVideo/api/RenderHeads.Media.AVProVideo.BaseMediaPlayer.html#RenderHeads_Media_AVProVideo_BaseMediaPlayer_GrabAudio_System_Single___System_Int32_System_Int32_

https://www.renderheads.com/content/docs/AVProVideo/api/RenderHeads.Media.AVProVideo.AudioOutputManager.html?q=audiodata#RenderHeads_Media_AVProVideo_AudioOutputManager_RequestAudio_RenderHeads_Media_AVProVideo_AudioOutput_RenderHeads_Media_AVProVideo_MediaPlayer_System_Single___System_Int32_System_Int32_RenderHeads_Media_AVProVideo_AudioOutput_AudioOutputMode_System_Boolean_