Normalizing audio, how to convert a float array to a byte array?

后端 未结 5 1784
南旧
南旧 2021-02-04 21:52

Hi all, I am playing an audio file. I read it as a byte[] and then I need to normalize the audio by putting values into range of [-1,1]. I want to then put each flo

5条回答
  •  野趣味
    野趣味 (楼主)
    2021-02-04 22:08

    This works:

    float number = 0.43f;
    byte[] array = BitConverter.GetBytes(number);
    

    What does not work for you?

提交回复
热议问题