Get audio as float[] from mixer group? (like OnAudioFilterRead?)
Hi!
I'm making a music-based game and I need to stream audio from one client to all the other clients. I need the audio as a float[] buffer so that I can stream it using Photon Voice.
I believe that using OnAudioFilterRead() on an audio source will let me get the audio from that one audio source, and using it on an audio listener will allow me to get the whole mix. But I do not want the whole mix, as there are other sounds like voice chat etc and I only want to stream the musical clips.
Is there a similar function I can use for just one mixer group instead?
Thanks!
@hadjisss No, at that time there seemed to be no way to achieve this apart from writing my own mixer which someone suggested here ( https://stackoverflow.com/questions/49613749/getting-audio-from-certain-audio-sources-as-buffer-in-unity ), which I did not want to do for this project so I just settled for strea$$anonymous$$g all audio in the game. I haven't checked if this has changed in any recent unity updates though
Thanks for the reply @shadowsora . Is it possible to assist me on how you streamed the audio in the game? I am new to the whole networking thing and with audio on top it feels like it's impossible.
Your answer
Follow this Question
Related Questions
Streaming and Decompress On Load music type playback time difference. 0 Answers
Background Music Masks Sound Effects 1 Answer
Designate unity audio as music. Play in background and when phone is on silent. IOS 0 Answers
Can't Stream an Audio file from a website in a WebGL Build 0 Answers
Change sound depending health 2 Answers