/// <summary> /// Decompress the given encoded audio data /// </summary> /// <param name="data">The encoded audio</param> /// <param name="samples">The number of encoded samples</param> /// <param name="channels">The number of channels</param> /// <param name="threeD">Whether the audio is 3D</param> /// <param name="mode">The bandwidth mode used to encode the data</param> /// <param name="Codec">The codec to decode the data with</param> /// <param name="gain">The gain to apply to the decoded audio</param> /// <returns>32bit raw audio data</returns> public static float[] DecompressAudio(byte[] data, int samples, int channels, bool threeD, BandMode mode, ICodec Codec, float gain) { int frequency = 4000; if (mode == BandMode.Narrow) { frequency = 8000; } else if (mode == BandMode.Wide) { frequency = 16000; } byte[] d; //d = unzip( data ); d = data; short[] pcm = Codec.Decode(d, mode); tmp.Clear(); tmp.AddRange(pcm); USpeakPoolUtils.Return(pcm); return(USpeakAudioClipConverter.ShortsToAudioData(tmp.ToArray(), channels, frequency, threeD, gain)); }
// Token: 0x06004CA7 RID: 19623 RVA: 0x0019B4BC File Offset: 0x001998BC public static float[] DecompressAudio(byte[] data, int samples, int channels, bool threeD, BandMode mode, ICodec Codec, float gain) { int frequency = 4000; if (mode == BandMode.Narrow) { frequency = 8000; } else if (mode == BandMode.Wide) { frequency = 16000; } else if (mode == BandMode.UltraWide) { frequency = 32000; } else if (mode == BandMode.Opus48k) { frequency = 48000; } short[] array = Codec.Decode(data, mode); float[] result = USpeakAudioClipConverter.ShortsToAudioData(array, channels, frequency, threeD, gain); USpeakPoolUtils.Return(array); return(result); }
// Token: 0x0600047F RID: 1151 RVA: 0x00016978 File Offset: 0x00014B78 public static float[] DecompressAudio(byte[] data, int samples, int channels, bool threeD, global::BandMode mode, MoPhoGames.USpeak.Codec.ICodec Codec, float gain) { int frequency = 4000; if (mode == global::BandMode.Narrow) { frequency = 8000; } else if (mode == global::BandMode.Wide) { frequency = 16000; } short[] array = Codec.Decode(data, mode); USpeakAudioClipCompressor.tmp.Clear(); USpeakAudioClipCompressor.tmp.AddRange(array); MoPhoGames.USpeak.Core.Utils.USpeakPoolUtils.Return(array); return(USpeakAudioClipConverter.ShortsToAudioData(USpeakAudioClipCompressor.tmp.ToArray(), channels, frequency, threeD, gain)); }
public static float[] DecompressAudio(byte[] data, int samples, int channels, bool threeD, BandMode mode, ICodec Codec, float gain) { int num = 4000; if (mode == BandMode.Narrow) { num = 8000; } else if (mode == BandMode.Wide) { num = 16000; } short[] numArray = Codec.Decode(data, mode); USpeakAudioClipCompressor.tmp.Clear(); USpeakAudioClipCompressor.tmp.AddRange(numArray); USpeakPoolUtils.Return(numArray); return(USpeakAudioClipConverter.ShortsToAudioData(USpeakAudioClipCompressor.tmp.ToArray(), channels, num, threeD, gain)); }
public static float[] DecompressAudio(byte[] data, int samples, int channels, bool threeD, BandMode mode, ICodec Codec, float gain) { int frequency = 0xfa0; if (mode == BandMode.Narrow) { frequency = 0x1f40; } else if (mode == BandMode.Wide) { frequency = 0x3e80; } byte[] buffer = data; short[] collection = Codec.Decode(buffer, mode); tmp.Clear(); tmp.AddRange(collection); USpeakPoolUtils.Return(collection); return(USpeakAudioClipConverter.ShortsToAudioData(tmp.ToArray(), channels, frequency, threeD, gain)); }