Answer the question
In order to leave comments, you need to log in
People, can someone tell me clearly how to combine several sound streams into one ??
I have been digging this topic for a week on the same sites, nothing specific, only generalizations, descriptions, and so on. Help, only if you can, not with a link, but write the algorithm of this miracle step by step right here. More specifically. I have n audio streams represented by an array of bytes. I need to write a function that implements the algorithm for stacking these streams, and returns an array of bytes, along with stacked streams. Well, an example .. For example, how 3 people speak at the same time on Skype, and the fourth one hears them all, and swears strongly that he does not understand them, and asks to speak in turn.
This is the effect you want. Thank you very much in advance!!
Answer the question
In order to leave comments, you need to log in
1. Represent all streams as arrays of numbers of a certain type used when writing (usually short or float )
In other words, represent streams not as an array of bytes, but as an array of 16-bit (short) or 32-bit (float ) numbers (samples). After that, you can do the usual addition over the samples.
Note: if there is a stereo signal in the stream, then it must be converted into 2 arrays, according to the principle: all odd samples are the 1st channel, and all even ones are the 2nd channel.
If the signals are of the same type (number of channels, bits per channel, sampling rate - this is important!) then everything is very simple: you need to add reports (not bytes, if there are 2 bytes per report, which is most likely). Well, it’s clear that going beyond the range can easily be, therefore, as they said before, divide each term by 3. And that’s it, addition in this case reflects the PHYSICAL essence of the process of perceiving several sound waves.
Didn't find what you were looking for?
Ask your questionAsk a Question
731 491 924 answers to any question