You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
Hi I would like to know the way to play sound backwards, I tryed to reverse audioBuffer array before to read or write (in UpdateRunner) but it didn´t work, maybe I edited the wrong class
The text was updated successfully, but these errors were encountered:
Hi,
Just reversing the byte array will likely produce garbled noise. This is because each sample for each channel is 16 bits, stored as two bytes. Each two bytes are considered together when determining the value of that sample, and just reversing the array thus swaps the order of each pair of bytes, giving a different 16 bit value when combined. Effectively, reversing the array switches the endianness of the data.
For example, consider an array with only one sample in it, consisting of bytes A and B in order. Read in that order they might be (in binary) something like:
A[01010101]B[00001111] -> Sample[0101010100001111]
If you reverse the array though, you get them in order B then A:
B[00001111]A[01010101] -> Sample[0000111101010101]
A completely different value for the same sample.
If you want to reverse the audio then, you'll need to either reverse by pairs of bytes, or modify the order in which bytes are merged when read off of the array.
Hi I would like to know the way to play sound backwards, I tryed to reverse audioBuffer array before to read or write (in UpdateRunner) but it didn´t work, maybe I edited the wrong class
The text was updated successfully, but these errors were encountered: