# How I can playing byte array of WAVE file using createSound()?

**URL:** <https://qa.fmod.com/t/how-i-can-playing-byte-array-of-wave-file-using-createsound/19500>\
**Category:** FMOD Engine\
**Tags:** csharp\
**Created:** [November 10, 2022, 7:00pm UTC](https://qa.fmod.com/t/how-i-can-playing-byte-array-of-wave-file-using-createsound/19500 "2022-11-10T19:00:41Z")\
**Posts on this page:** 2\
**Page:** 1

<div class="post-metadata">

**Author:** ![logbaby](https://avatars.discourse-cdn.com/v4/letter/l/71e660/32.png) [@logbaby](https://qa.fmod.com/u/logbaby)\
**Post date:** [November 10, 2022, 7:00pm UTC](https://qa.fmod.com/t/how-i-can-playing-byte-array-of-wave-file-using-createsound/19500/1 "2022-11-10T19:00:41Z")

</div>

I need to play byte array data like sound using FMOD. How can I do it? I was searching for a long time, but I didn’t understand nothing and I didn’t find examples.

I tried like that, but I failed:

```auto
            FMOD.System mainSystem;
            FMOD.Factory.System_Create(out mainSystem);
            mainSystem.init(512, INITFLAGS.NORMAL, (IntPtr)0);
            FMOD.Sound sound = new FMOD.Sound();

            var newArr = wp.getBytesOfAssetsArray()[4];
            var info = new FMOD.CREATESOUNDEXINFO();
            info.cbsize = MarshalHelper.SizeOf(typeof(FMOD.CREATESOUNDEXINFO));
            info.format = SOUND_FORMAT.PCM16;
            info.defaultfrequency = 51000;
            info.length = (uint)newArr.Length;

            mainSystem.createSound(newArr, FMOD.MODE.OPENMEMORY | FMOD.MODE.OPENRAW | FMOD.MODE.CREATESAMPLE, ref info, out sound);
            var channelGroup = new FMOD.ChannelGroup();
            var mainChannel = new FMOD.Channel();
            var mainDSP = new FMOD.DSP();

            mainSystem.playSound(sound, channelGroup, false, out mainChannel);
            mainSystem.createDSPByType(Helper.FMODHelper.generateRandomDsp(3), out mainDSP);
            mainChannel.addDSP(0, mainDSP);
            System.Threading.Thread.Sleep(new Random().Next(5000, 8000));

            sound.release();
            mainChannel.removeDSP(mainDSP);

```

---

<div class="post-metadata">

**Author:** ![Leah\_FMOD](https://yyz2.discourse-cdn.com/flex036/user_avatar/qa.fmod.com/leah_fmod/32/3685_2.png) [@Leah\_FMOD](https://qa.fmod.com/u/Leah_FMOD)\
**Post date:** [November 14, 2022, 1:15am UTC](https://qa.fmod.com/t/how-i-can-playing-byte-array-of-wave-file-using-createsound/19500/2 "2022-11-14T01:15:32Z")

</div>

Sorry that you’ve had so much trouble getting this working - I’ve flagged some documentation improvements in our feature/improvement tracker.

The different modes that you are able to use with `System.createSound()` have specific requirements for extended information. [OPENRAW](https://www.fmod.com/docs/2.00/api/core-api-common.html#fmod_openraw) needs the audio format, default frequency, and the number of audio channels, and [OPENMEMORY](https://www.fmod.com/docs/2.00/api/core-api-common.html#fmod_openmemory) needs the length. Since you’re using OPENRAW, you just need to specify the number of audio channels in the sound you’re loading with `info.numchannels = yourNumberOfChannels;` before calling `mainSystem.createSound()`, and your code should work.
